Package org.globus.gsi.gssapi
Class GlobusGSSCredentialImpl
- java.lang.Object
-
- org.globus.gsi.gssapi.GlobusGSSCredentialImpl
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,ExtendedGSSCredential
,org.ietf.jgss.GSSCredential
public class GlobusGSSCredentialImpl extends java.lang.Object implements ExtendedGSSCredential, java.io.Serializable
An implementation ofGlobusGSSCredential
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private X509Credential
cred
private org.ietf.jgss.GSSName
name
private static long
serialVersionUID
private int
usage
-
Fields inherited from interface org.gridforum.jgss.ExtendedGSSCredential
IMPEXP_MECH_SPECIFIC, IMPEXP_OPAQUE
-
-
Constructor Summary
Constructors Constructor Description GlobusGSSCredentialImpl()
Creates anonymous credential.GlobusGSSCredentialImpl(X509Credential cred, int usage)
Creates regular credential from specified X509Credential object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(org.ietf.jgss.GSSName aName, int initLifetime, int acceptLifetime, org.ietf.jgss.Oid mech, int usage)
Currently not implemented.void
dispose()
boolean
equals(java.lang.Object obj)
byte[]
export(int option)
Exports this credential so that another process might import it.byte[]
export(int option, org.ietf.jgss.Oid mech)
Exports this credential so that another process might import it.java.security.cert.X509Certificate[]
getCertificateChain()
Returns certificate chain of this credential (if any).org.ietf.jgss.Oid[]
getMechs()
org.ietf.jgss.GSSName
getName()
org.ietf.jgss.GSSName
getName(org.ietf.jgss.Oid mech)
java.security.PrivateKey
getPrivateKey()
Returns the private key of this credential (if any).int
getRemainingAcceptLifetime(org.ietf.jgss.Oid mech)
int
getRemainingInitLifetime(org.ietf.jgss.Oid mech)
int
getRemainingLifetime()
int
getUsage()
int
getUsage(org.ietf.jgss.Oid mech)
X509Credential
getX509Credential()
Returns actual X509Credential object represented by this credential (if any).int
hashCode()
java.lang.Object
inquireByOid(org.ietf.jgss.Oid oid)
Retrieves arbitrary data about this credential.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
usage
private int usage
-
cred
private X509Credential cred
-
name
private org.ietf.jgss.GSSName name
-
-
Constructor Detail
-
GlobusGSSCredentialImpl
public GlobusGSSCredentialImpl()
Creates anonymous credential.
-
GlobusGSSCredentialImpl
public GlobusGSSCredentialImpl(X509Credential cred, int usage) throws org.ietf.jgss.GSSException
Creates regular credential from specified X509Credential object.- Parameters:
cred
- the credentialusage
- credential usage- Throws:
org.ietf.jgss.GSSException
-
-
Method Detail
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceorg.ietf.jgss.GSSCredential
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceorg.ietf.jgss.GSSCredential
- Overrides:
equals
in classjava.lang.Object
-
dispose
public void dispose() throws org.ietf.jgss.GSSException
- Specified by:
dispose
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getName
public org.ietf.jgss.GSSName getName() throws org.ietf.jgss.GSSException
- Specified by:
getName
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getName
public org.ietf.jgss.GSSName getName(org.ietf.jgss.Oid mech) throws org.ietf.jgss.GSSException
- Specified by:
getName
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
add
public void add(org.ietf.jgss.GSSName aName, int initLifetime, int acceptLifetime, org.ietf.jgss.Oid mech, int usage) throws org.ietf.jgss.GSSException
Currently not implemented.- Specified by:
add
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getUsage
public int getUsage() throws org.ietf.jgss.GSSException
- Specified by:
getUsage
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getUsage
public int getUsage(org.ietf.jgss.Oid mech) throws org.ietf.jgss.GSSException
- Specified by:
getUsage
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getRemainingLifetime
public int getRemainingLifetime() throws org.ietf.jgss.GSSException
- Specified by:
getRemainingLifetime
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getRemainingInitLifetime
public int getRemainingInitLifetime(org.ietf.jgss.Oid mech) throws org.ietf.jgss.GSSException
- Specified by:
getRemainingInitLifetime
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getRemainingAcceptLifetime
public int getRemainingAcceptLifetime(org.ietf.jgss.Oid mech) throws org.ietf.jgss.GSSException
- Specified by:
getRemainingAcceptLifetime
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
getMechs
public org.ietf.jgss.Oid[] getMechs() throws org.ietf.jgss.GSSException
- Specified by:
getMechs
in interfaceorg.ietf.jgss.GSSCredential
- Throws:
org.ietf.jgss.GSSException
-
export
public byte[] export(int option) throws org.ietf.jgss.GSSException
Description copied from interface:ExtendedGSSCredential
Exports this credential so that another process might import it. The exported credential might be imported again using theExtendedGSSManager.createCredential
method.- Specified by:
export
in interfaceExtendedGSSCredential
- Parameters:
option
- The export type. If set toExtendedGSSCredential.IMPEXP_OPAQUE
exported buffer is an opaque buffer suitable for storage in memory or on disk or passing to another process. If set toExtendedGSSCredential.IMPEXP_MECH_SPECIFIC
exported buffer is a buffer filled with mechanism-specific information that the calling application can use to pass the credential to another process that is not written to the GSS-API.- Returns:
- The buffer containing the credential
- Throws:
org.ietf.jgss.GSSException
- containing the following major error codes:GSSException.CREDENTIAL_EXPIRED, GSSException.UNAVAILABLE, GSSException.FAILURE
-
export
public byte[] export(int option, org.ietf.jgss.Oid mech) throws org.ietf.jgss.GSSException
Description copied from interface:ExtendedGSSCredential
Exports this credential so that another process might import it. The exported credential might be imported again using theExtendedGSSManager.createCredential
method.- Specified by:
export
in interfaceExtendedGSSCredential
- Parameters:
option
- The export type. If set toExtendedGSSCredential.IMPEXP_OPAQUE
exported buffer is an opaque buffer suitable for storage in memory or on disk or passing to another process. If set toExtendedGSSCredential.IMPEXP_MECH_SPECIFIC
exported buffer is a buffer filled with mechanism-specific information that the calling application can use to pass the credential to another process that is not written to the GSS-API.mech
- Desired mechanism for exported credential, may be null to indicate system default.- Returns:
- The buffer containing the credential
- Throws:
org.ietf.jgss.GSSException
- containing the following major error codes:GSSException.CREDENTIAL_EXPIRED, GSSException.UNAVAILABLE, GSSException.BAD_MECH, GSSException.FAILURE
-
inquireByOid
public java.lang.Object inquireByOid(org.ietf.jgss.Oid oid) throws org.ietf.jgss.GSSException
Retrieves arbitrary data about this credential. Currently supported oid:-
GSSConstants.X509_CERT_CHAIN
returns certificate chain of this credential (X509Certificate[]
).
- Specified by:
inquireByOid
in interfaceExtendedGSSCredential
- Parameters:
oid
- the oid of the information desired.- Returns:
- the information desired. Might be null.
- Throws:
org.ietf.jgss.GSSException
- containing the following major error codes:GSSException.FAILURE
-
-
getX509Credential
public X509Credential getX509Credential()
Returns actual X509Credential object represented by this credential (if any).- Returns:
- The credential object. Might be null if this is an anonymous credential.
-
getPrivateKey
public java.security.PrivateKey getPrivateKey() throws org.ietf.jgss.GSSException
Returns the private key of this credential (if any).- Returns:
- The private key. Might be null if this is an anonymous credential.
- Throws:
org.ietf.jgss.GSSException
-
getCertificateChain
public java.security.cert.X509Certificate[] getCertificateChain()
Returns certificate chain of this credential (if any).- Returns:
- The certificate chain. Might be null if this is an anonymous credential.
-
-