|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.gssapi.GSSCredential
public class GSSCredential
This class manages GSS-API credentials and their associated operations. A credential contains all the necessary cryptographic information to enable the creation of a context on behalf of the entity that it represents. It may contain multiple distinct mechanism specific credential elements, each containing mechanism specific information, and all referring to the same entity.
A credential may be used to perform context initiation, acceptance, or both.
| Field Summary | |
|---|---|
static int |
ACCEPT_ONLY
Credential usage flag requesting that it be able to be used for context acceptance only. |
static int |
INDEFINITE
Indefinite lifetime for a credential. |
static int |
INITIATE_AND_ACCEPT
Credential usage flag requesting that it be able to be used for both context initiation and acceptance. |
static int |
INITIATE_ONLY
Credential usage flag requesting that it be able to be used for context initiation only. |
| Constructor Summary | |
|---|---|
GSSCredential(GSSName aName,
int usage)
Constructor for default mechanism credential. |
|
GSSCredential(GSSName aName,
int lifetime,
Oid[] mechs,
int usage)
Constructor for a credential over a set of mechanisms. |
|
GSSCredential(GSSName aName,
int lifetime,
Oid mechOid,
int usage)
Constructor for a single mechanism credential. |
|
GSSCredential(int usage)
Constructor for default credentials. |
|
| Method Summary | |
|---|---|
void |
add(GSSName aName,
int initLifetime,
int acceptLifetime,
Oid mech,
int usage)
This method enables the construction of credentials one mechanism at a time. |
void |
dispose()
Used to dispose of any sensitive information that the GSSCredential may be containing. |
boolean |
equals(java.lang.Object another)
Tests if this GSSCredential refers to the same entity as the supplied object. |
GSSName |
getGSSName()
Retrieves the name of the entity that the credential has been acquired for. |
GSSName |
getGSSName(Oid mechOID)
Queries the selected mechanism for the principal name of the credential. |
Oid[] |
getMechs()
Returns the mechanism oids over which the credential has been acquired. |
int |
getRemainingAcceptLifetime(Oid mech)
Returns the remaining lifetime in seconds for the credential to remain capable of accepting security context under the specified mechanism. |
int |
getRemainingInitLifetime(Oid mech)
Returns the remaining lifetime in seconds for the credential to remain capable of initiating security context under the specified mechanism. |
int |
getRemainingLifetime()
Obtains the remaining lifetime for a credential. |
int |
getUsage()
Retrieve the credential usage flag, which is one of INITIATE_ONLY, ACCEPT_ONLY, INITIATE_AND_ACCEPT. |
int |
getUsage(Oid mechOID)
Retrieve the credential usage flag, which is one of INITIATE_ONLY, ACCEPT_ONLY, INITIATE_AND_ACCEPT, for a specific credential mechanism. |
java.lang.String |
toString()
Debugging aid. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int INITIATE_AND_ACCEPT
public static final int INITIATE_ONLY
public static final int ACCEPT_ONLY
public static final int INDEFINITE
getRemainingLifetime(),
Constant Field Values| Constructor Detail |
|---|
public GSSCredential(int usage)
throws GSSException
usage - - the intended usage for this credential; this
must be one of the constants defined in this class.
GSSException - with possible major code of FAILURE
public GSSCredential(GSSName aName,
int usage)
throws GSSException
aName - - name of the principal for whom this credential
is to be acquiredusage - - the intended usage for this credential; this
must be one of the constants defined in this class
GSSException - with possible major codes of FAILURE and
BAD_NAME
public GSSCredential(GSSName aName,
int lifetime,
Oid mechOid,
int usage)
throws GSSException
aName - - name of the principal for whom this credential
is to be acquired; use null for system specific default
principallifetime - - the duration of this credentialmechOid - - mechanism over which this credential is to
be acquiredusage - - the intended usage for this credential; this
must be one of the constants defined in this class
GSSException - with possible major codes of FAILURE,
BAD_MECH, and BAD_NAME
public GSSCredential(GSSName aName,
int lifetime,
Oid[] mechs,
int usage)
throws GSSException
aName - - name of the principal for whom this credential
is to be acquired; use null for system specific default
principallifetime - - the desired duration of this credentialmechs - - mechanisms over which this credential is to
be acquiredusage - - the intended usage for this credential; this
must be one of the constants defined in this class
GSSException - with possible major codes of FAILURE,
BAD_MECH, and BAD_NAME| Method Detail |
|---|
public void dispose()
throws GSSException
GSSException - with possible major code of FAILURE
public GSSName getGSSName()
throws GSSException
GSSException - with possible major codes of FAILURE,
NO_CRED, DEFECTIVE_CREDENTIAL, CREDENTIAL_EXPIRED
public GSSName getGSSName(Oid mechOID)
throws GSSException
mechOID - the credential mechanism to be queried
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, CREDENTIALS_EXPIRED, FAILURE and
BAD_MECH
public int getRemainingLifetime()
throws GSSException
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, FAILURE.
public int getRemainingInitLifetime(Oid mech)
throws GSSException
mech - Oid for the credential mechanism to be queried
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, FAILURE and BAD_MECH
public int getRemainingAcceptLifetime(Oid mech)
throws GSSException
mech - Oid for the credential mechanism to be queried
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, FAILURE and BAD_MECH
public int getUsage()
throws GSSException
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, CREDENTIALS_EXPIRED, FAILURE.
public int getUsage(Oid mechOID)
throws GSSException
oid - for the credential mechanism to query
GSSException - with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, CREDENTIALS_EXPIRED, FAILURE.
public Oid[] getMechs()
throws GSSException
GSSException - with possible major codes of FAILURE,
NO_CRED, DEFECTIVE_CREDENTIAL, CREDENTIAL_EXPIRED
public void add(GSSName aName,
int initLifetime,
int acceptLifetime,
Oid mech,
int usage)
throws GSSException
aName - - name of the principal for whom this credential
is to be acquired; use null for system specific default
principalinitLifetime - - the desired duration of this credential
initiation lifetime; value in secondsacceptLifetime - - the desired duration of this credential
accept lifetime; value in secondsmechs - - mechanism over which this credential is to
be acquiredusage - - the intended usage for this credential; this
must be one of the constants defined in this class
GSSException - with possible major codes of
DUPLICATE_ELEMENT, BAD_MECH, BAD_NAME, BAD_NAME, NO_CRED,
or FAILURE.public boolean equals(java.lang.Object another)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||