Package org.globus.gsi
Class GlobusCredential
java.lang.Object
org.globus.gsi.GlobusCredential
- All Implemented Interfaces:
Serializable
Deprecated.
Provides a Java object representation of Globus credential which can include the proxy file or host
certificates.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGlobusCredential
(InputStream input) Deprecated.Creates a GlobusCredential from an input stream.GlobusCredential
(String proxyFile) Deprecated.Creates a GlobusCredential from a proxy file.GlobusCredential
(String certFile, String unencryptedKeyFile) Deprecated.Creates a GlobusCredential from certificate file and a unencrypted key file.GlobusCredential
(PrivateKey key, X509Certificate[] certs) Deprecated.Creates a GlobusCredential from a private key and a certificate chain. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the certificate chain of this credential.int
Deprecated.Returns the number of certificates in the credential without the self-signed certificates.static GlobusCredential
Deprecated.Returns the default credential.Deprecated.Returns the identity of this credential.Deprecated.Returns the identity certificate of this credential.Deprecated.Returns the issuer DN of the first certificate in the chain.int
Deprecated.Returns the path length constraint.Deprecated.Returns the private key of this credential.int
Deprecated.Returns the certificate type of the first certificate in the chain.int
Deprecated.Returns strength of the private/public key in bits.Deprecated.Returns the subject DN of the first certificate in the chain.long
Deprecated.Returns time left of this credential.void
save
(OutputStream out) Deprecated.Saves the credential into a specified output stream.static void
Deprecated.Sets default credential.toString()
Deprecated.void
verify()
Deprecated.Verifies the validity of the credentials.
-
Constructor Details
-
GlobusCredential
Deprecated.Creates a GlobusCredential from a private key and a certificate chain.- Parameters:
key
- the private keycerts
- the certificate chain
-
GlobusCredential
Deprecated.Creates a GlobusCredential from a proxy file.- Parameters:
proxyFile
- the file to load the credential from.- Throws:
GlobusCredentialException
- if the credential failed to load.
-
GlobusCredential
public GlobusCredential(String certFile, String unencryptedKeyFile) throws GlobusCredentialException Deprecated.Creates a GlobusCredential from certificate file and a unencrypted key file.- Parameters:
certFile
- the file containing the certificateunencryptedKeyFile
- the file containing the private key. The key must be unencrypted.- Throws:
GlobusCredentialException
- if something goes wrong.
-
GlobusCredential
Deprecated.Creates a GlobusCredential from an input stream.- Parameters:
input
- the stream to load the credential from.- Throws:
GlobusCredentialException
- if the credential failed to load.
-
-
Method Details
-
save
Deprecated.Saves the credential into a specified output stream. The self-signed certificates in the certificate chain will not be saved. The output stream should always be closed after calling this function.- Parameters:
out
- the output stream to write the credential to.- Throws:
IOException
- if any error occurred during saving.
-
verify
Deprecated.Verifies the validity of the credentials. All certificate path validation is performed using trusted certificates in default locations.- Throws:
GlobusCredentialException
- if one of the certificates in the chain expired or if path validiation fails.
-
getIdentityCertificate
Deprecated.Returns the identity certificate of this credential. The identity certificate is the first certificate in the chain that is not an impersonation proxy certificate.- Returns:
X509Certificate
the identity cert. Null, if unable to get the identity certificate (an error occurred)
-
getPathConstraint
public int getPathConstraint()Deprecated.Returns the path length constraint. The shortest length in the chain of certificates is returned as the credential's path length.- Returns:
- The path length constraint of the credential. -1 is any error occurs.
-
getIdentity
Deprecated.Returns the identity of this credential.- Returns:
- The identity cert in Globus format (e.g. /C=US/..). Null, if unable to get the identity (an error occurred)
- See Also:
-
getPrivateKey
Deprecated.Returns the private key of this credential.- Returns:
PrivateKey
the private key
-
getCertificateChain
Deprecated.Returns the certificate chain of this credential.- Returns:
X509Certificate []
the certificate chain
-
getCertNum
public int getCertNum()Deprecated.Returns the number of certificates in the credential without the self-signed certificates.- Returns:
- number of certificates without counting self-signed certificates
-
getStrength
public int getStrength()Deprecated.Returns strength of the private/public key in bits.- Returns:
- strength of the key in bits. Returns -1 if unable to determine it.
-
getSubject
Deprecated.Returns the subject DN of the first certificate in the chain.- Returns:
- subject DN.
-
getIssuer
Deprecated.Returns the issuer DN of the first certificate in the chain.- Returns:
- issuer DN.
-
getProxyType
public int getProxyType()Deprecated.Returns the certificate type of the first certificate in the chain. Returns -1 if unable to determine the certificate type (an error occurred)- Returns:
- the type of first certificate in the chain. -1 if unable to determine the certificate type.
- See Also:
-
getTimeLeft
public long getTimeLeft()Deprecated.Returns time left of this credential. The time left of the credential is based on the certificate with the shortest validity time.- Returns:
- time left in seconds. Returns 0 if the certificate has expired.
-
getDefaultCredential
Deprecated.Returns the default credential. The default credential is usually the user proxy certificate.
The credential will be loaded on the initial call. It must not be expired. All subsequent calls to this function return cached credential object. Once the credential is cached, and the underlying file changes, the credential will be reloaded.- Returns:
- the default credential.
- Throws:
GlobusCredentialException
- if the credential expired or some other error with the credential.
-
setDefaultCredential
Deprecated.Sets default credential.- Parameters:
cred
- the credential to set a default.
-
toString
Deprecated.
-