|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.wmsui.apij.UserCredential
The UserCredential class allows to control the general user security certificate's validity.
This class can manipulate standard proxies as well as VOMS certificates, in order to extract the extension information The main operation are:
Constructor Summary | |
|
UserCredential()
Empty Constructor try to Load the default proxycertificate |
|
UserCredential(java.io.File credPath)
Constructor with File. |
protected |
UserCredential(org.globus.gsi.GlobusCredential proxy)
Empty Constructor set a proxy |
Method Summary | |
void |
checkProxy()
Check if the Proxy Certificate is valid |
boolean |
containsVO(java.lang.String voName)
Returns a Boolean value indicating if the Virtual Organisation voName is present in the VOMS proxy extension or not. |
static UserCredential |
createProxy(java.lang.String passPhrase)
Create the default proxy Create the default proxy certificate with all the default values: 512-key-length bits, 24c hours, not limited |
static UserCredential |
createProxy(java.lang.String passPhrase,
java.lang.String userProxy,
java.lang.String userCert,
java.lang.String userKey,
int bits,
int hours,
boolean limited)
Create a different proxy than the default one |
void |
destroyProxy()
Destroy the proxy file used |
boolean |
getCredType()
Return whether the proxy is a full proxy (true) or a limited proxy (false) |
static java.lang.String |
getDefaultCert()
retrieve the default path for user cert |
static java.lang.String |
getDefaultDir()
retrieve the default path for cert dir |
java.util.Vector |
getDefaultGroups()
Returns a String Vector containing the names of all default Virtual Organisation groups present in the proxy certificate extension if the proxy certificate is a VOMS proxy certificate. |
static java.lang.String |
getDefaultKey()
retrieve the default path for user key |
static java.lang.String |
getDefaultProxy()
Retrieve the default path for proxy and check whether the file exists |
static java.lang.String |
getDefaultProxyName()
Retrieve where default proxy file should be created |
java.lang.String |
getDefaultVOName()
Returns the name of the default Virtual Organisation contained in the proxy certificate if the proxy certificate is a VOMS proxy certificate. |
java.util.Vector |
getGroups(java.lang.String voName)
Returns a String Vector containing the names of all voName groups present in the proxy certificate extension if the proxy certificate is a VOMS proxy certificate. |
java.lang.String |
getIssuer()
Return the Issuer of the Proxy Certificate |
int |
getStrenght()
Return the Cred type of the Proxy Certificate |
java.lang.String |
getSubject()
Return the Subject of the Proxy Certificate |
int |
getTimeLeft()
Return the Strenght of the Proxy Certificate |
java.lang.String |
getUserProxy()
Retrieve the actual proxy certificate file and check if it exist |
java.util.Vector |
getVONames()
Returns a Vector containing the names of all Virtual Organisations contained in the proxy certificate extension if the proxy certificate is a VOMS proxy certificate. |
java.lang.String |
getX500UserSubject()
Returns the proxy user subject removing all occurencies of "CN=/Proxy". |
static java.lang.String |
getX500UserSubject(java.lang.String proxySubject)
Returns the proxy user subject removing all occurencies of "CN=/Proxy" from the specified proxySubject String. |
boolean |
hasVOMSExtension()
Returns a Boolean value indicating if the proxy certificate has a VOMS extension or not (if the proxy is a VOMS proxy certificate or not). |
static void |
setDefaultProxy(java.lang.String proxyName)
Set statically the default proxy used for the current session. |
void |
setEnvCert(java.lang.String certPath)
Set the specified path to be the default x509 certificate file |
void |
setEnvDir(java.lang.String dirPath)
Set the specified path to be the default x509 user cert diectory |
void |
setEnvKey(java.lang.String keyPath)
Set the specified path to be the default x509 key file |
void |
setEnvProxy(java.lang.String proxyPath)
Set the specified path to be the default x509 proxy file |
void |
setProxy(java.io.File credPath)
Set the proxy certificate to a non-default value |
void |
unsetProxy()
Unset a previous non-default proxy and look for the default one |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected UserCredential(org.globus.gsi.GlobusCredential proxy)
proxy
- an instance of a proxy certificatepublic UserCredential() throws java.io.FileNotFoundException, org.globus.gsi.GlobusCredentialException
java.io.FileNotFoundException
- Unable to retrieve find the default proxy certificate
org.globus.gsi.GlobusCredentialException
- Unable to parse the default proxy certificatepublic UserCredential(java.io.File credPath) throws java.io.FileNotFoundException, org.globus.gsi.GlobusCredentialException
credPath
- a File where to load the proxy from
java.io.FileNotFoundException
- Unable to retrieve find the default proxy certificate
org.globus.gsi.GlobusCredentialException
- Unable to parse the default proxy certificateMethod Detail |
public void destroyProxy()
public static UserCredential createProxy(java.lang.String passPhrase) throws java.io.FileNotFoundException, java.io.IOException, java.security.GeneralSecurityException, java.io.FileNotFoundException, org.globus.gsi.GlobusCredentialException
passPhrase
- the passphrase needed in oprder to generate the proxy certificate
java.io.FileNotFoundException
- unable to find one or more default files
java.io.IOException
- when Input Output occurred while creating/loading certificates
java.security.GeneralSecurityException
- when error occurred while decrypting keys/passphrase
org.globus.gsi.GlobusCredentialException
- unable to create the proxy certificatepublic static UserCredential createProxy(java.lang.String passPhrase, java.lang.String userProxy, java.lang.String userCert, java.lang.String userKey, int bits, int hours, boolean limited) throws java.io.FileNotFoundException, java.io.IOException, java.security.GeneralSecurityException, org.globus.gsi.GlobusCredentialException
passPhrase
- the passphrase needed in oprder to generate the proxy certificateuserProxy
- a string representing the file that will be createduserCert
- the String which point to the user cert file if different from the default oneuserKey
- the String which point to the user key file if different from the default onebits
- the key-length bits dimension ( default value is 512 )hours
- the validity length of proxy in hours (default value is 24)limited
- Deterimne whether the proxy is limited or not (default value is false)
java.io.FileNotFoundException
- unable to find one or more default files
java.io.IOException
- when Input Output occurred while creating/loading certificates
java.security.GeneralSecurityException
- when error occurred while decrypting keys/passphrase
org.globus.gsi.GlobusCredentialException
- unable to create the proxy certificatepublic static java.lang.String getDefaultProxyName()
public static void setDefaultProxy(java.lang.String proxyName)
proxyName
- the string representation of the proxy file namepublic java.lang.String getUserProxy() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the file is not presentpublic static java.lang.String getDefaultProxy() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the file is not presentpublic static java.lang.String getDefaultCert() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the file is not presentpublic static java.lang.String getDefaultKey() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the file is not presentpublic static java.lang.String getDefaultDir() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the dir is not presentpublic void setEnvProxy(java.lang.String proxyPath)
public void setEnvCert(java.lang.String certPath)
public void setEnvKey(java.lang.String keyPath)
public void setEnvDir(java.lang.String dirPath)
public void setProxy(java.io.File credPath) throws org.globus.gsi.GlobusCredentialException
credPath
- the path pointing to the proxy certificate file
org.globus.gsi.GlobusCredentialException
- - Unable to get the specified proxy certificatepublic void unsetProxy() throws org.globus.gsi.GlobusCredentialException, java.io.FileNotFoundException
org.globus.gsi.GlobusCredentialException
- - Unable to get the default proxy certificate
java.io.FileNotFoundException
public void checkProxy() throws org.globus.gsi.GlobusCredentialException
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic java.lang.String getSubject() throws org.globus.gsi.GlobusCredentialException
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic java.lang.String getIssuer() throws org.globus.gsi.GlobusCredentialException
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic boolean getCredType()
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic int getStrenght()
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic int getTimeLeft()
org.globus.gsi.GlobusCredentialException
- - Unable to get the proxy certificatepublic java.lang.String getX500UserSubject() throws org.globus.gsi.GlobusCredentialException
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.public static java.lang.String getX500UserSubject(java.lang.String proxySubject)
public java.util.Vector getVONames() throws java.io.FileNotFoundException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
java.io.FileNotFoundException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
public java.lang.String getDefaultVOName() throws java.io.IOException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
java.io.IOException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
public java.util.Vector getGroups(java.lang.String voName) throws java.io.IOException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
voName
- the name of the Virtual Organisation.
java.io.IOException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
public java.util.Vector getDefaultGroups() throws java.io.IOException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
java.io.IOException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
public boolean containsVO(java.lang.String voName) throws java.io.IOException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
voName
- the name of the Virtual Organisation.
java.io.IOException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
public boolean hasVOMSExtension() throws java.io.IOException, org.globus.gsi.GlobusCredentialException, java.lang.Exception
java.io.IOException
- - Unable to find proxy certificate file.
org.globus.gsi.GlobusCredentialException
- - Unable to load proxy certificate.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |