|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.gsi.GlobusCredential
public class GlobusCredential
Provides a Java object representation of Globus credential which can include the proxy file or host certificates.
Constructor Summary | |
---|---|
GlobusCredential(InputStream input)
Creates a GlobusCredential from an input stream. |
|
GlobusCredential(PrivateKey key,
X509Certificate[] certs)
Creates a GlobusCredential from a private key and a certificate chain. |
|
GlobusCredential(String proxyFile)
Creates a GlobusCredential from a proxy file. |
|
GlobusCredential(String certFile,
String unencryptedKeyFile)
Creates a GlobusCredential from certificate file and a unencrypted key file. |
Method Summary | |
---|---|
X509Certificate[] |
getCertificateChain()
Returns the certificate chain of this credential. |
int |
getCertNum()
Returns the number of certificates in the credential without the self-signed certificates. |
static GlobusCredential |
getDefaultCredential()
Returns the default credential. |
String |
getIdentity()
Returns the identity of this credential. |
X509Certificate |
getIdentityCertificate()
Returns the identity certificate of this credential. |
String |
getIssuer()
Returns the issuer DN of the first certificate in the chain. |
int |
getPathConstraint()
Returns the path length constraint. |
PrivateKey |
getPrivateKey()
Returns the private key of this credential. |
int |
getProxyType()
Returns the certificate type of the first certificate in the chain. |
int |
getStrength()
Returns strength of the private/public key in bits. |
String |
getSubject()
Returns the subject DN of the first certificate in the chain. |
long |
getTimeLeft()
Returns time left of this credential. |
protected void |
load(InputStream input)
|
void |
save(OutputStream out)
Saves the credential into a specified output stream. |
static void |
setDefaultCredential(GlobusCredential cred)
Sets default credential. |
String |
toString()
|
void |
verify()
Verifies the validity of the credential. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GlobusCredential(PrivateKey key, X509Certificate[] certs)
key
- the private keycerts
- the certificate chainpublic GlobusCredential(String proxyFile) throws GlobusCredentialException
proxyFile
- the file to load the credential from.
GlobusCredentialException
- if the credential failed to
load.public GlobusCredential(String certFile, String unencryptedKeyFile) throws GlobusCredentialException
certFile
- the file containing the certificateunencryptedKeyFile
- the file containing the private key. The key
must be unencrypted.
GlobusCredentialException
- if something goes wrong.public GlobusCredential(InputStream input) throws GlobusCredentialException
input
- the stream to load the credential from.
GlobusCredentialException
- if the credential failed to
load.Method Detail |
---|
protected void load(InputStream input) throws GlobusCredentialException
GlobusCredentialException
public void save(OutputStream out) throws IOException
out
- the output stream to write the credential to.
IOException
- if any error occurred during saving.public void verify() throws GlobusCredentialException
GlobusCredentialException
- if one of the certificates in
the chain expired or some other error.public X509Certificate getIdentityCertificate()
X509Certificate
the identity cert. Null,
if unable to get the identity certificate (an error
occurred)public int getPathConstraint()
public String getIdentity()
getIdentityCertificate()
public PrivateKey getPrivateKey()
PrivateKey
the private keypublic X509Certificate[] getCertificateChain()
X509Certificate []
the certificate chainpublic int getCertNum()
public int getStrength()
public String getSubject()
public String getIssuer()
public int getProxyType()
BouncyCastleUtil.getCertificateType(X509Certificate)
public long getTimeLeft()
public static GlobusCredential getDefaultCredential() throws GlobusCredentialException
GlobusCredentialException
- if the credential expired or
some other error with the credential.public static void setDefaultCredential(GlobusCredential cred)
cred
- the credential to set a default.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |