public class GSSCredential
extends java.lang.Object
A credential may be used to perform context initiation, acceptance, or both.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 Valuespublic 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 FAILUREpublic 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 classGSSException
- with possible major codes of FAILURE and
BAD_NAMEpublic 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 classGSSException
- with possible major codes of FAILURE,
BAD_MECH, and BAD_NAMEpublic 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 classGSSException
- with possible major codes of FAILURE,
BAD_MECH, and BAD_NAMEpublic void dispose() throws GSSException
GSSException
- with possible major code of FAILUREpublic GSSName getGSSName() throws GSSException
GSSException
- with possible major codes of FAILURE,
NO_CRED, DEFECTIVE_CREDENTIAL, CREDENTIAL_EXPIREDpublic GSSName getGSSName(Oid mechOID) throws GSSException
mechOID
- the credential mechanism to be queriedGSSException
- with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, CREDENTIALS_EXPIRED, FAILURE and
BAD_MECHpublic 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 queriedGSSException
- with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, FAILURE and BAD_MECHpublic int getRemainingAcceptLifetime(Oid mech) throws GSSException
mech
- Oid for the credential mechanism to be queriedGSSException
- with possible major codes of NO_CRED,
DEFECTIVE_CREDENTIAL, FAILURE and BAD_MECHpublic 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 queryGSSException
- 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_EXPIREDpublic 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 classGSSException
- 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.Object
public java.lang.String toString()
toString
in class java.lang.Object