com.ibm.security.jgss
Class GSSCredentialImpl
- java.lang.Object
com.ibm.security.jgss.GSSCredentialImpl
All implemented interfaces:
java.lang.Cloneable, GSSCredential
- public class GSSCredentialImpl
- extends java.lang.Object
- implements GSSCredential
Author:
Thomas Owusu
Field Summary
Fields inherited from interface org.ietf.jgss.GSSCredential |
---|
ACCEPT_ONLY, DEFAULT_LIFETIME, INDEFINITE_LIFETIME, INITIATE_AND_ACCEPT, INITIATE_ONLY |
Constructor Summary
Constructor and Description |
---|
GSSCredentialImpl(GSSManagerImpl manager,GSSName name,int lifetime,Oid[] mechs,int usage)
|
GSSCredentialImpl(GSSManagerImpl manager,GSSName name,int lifetime,Oid mech,int usage)
|
GSSCredentialImpl(GSSManagerImpl manager,int usage)
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
add(GSSName name,int initLifetime,int acceptLifetime,Oid mech,int usage)
|
|
dispose()
|
|
equals(java.lang.Object other)
|
getCred(Oid mech,int usage)
|
|
|
getMechs()
|
getName()
|
|
getName(Oid mech)
|
|
|
getRemainingAcceptLifetime(Oid mech)
|
|
getRemainingInitLifetime(Oid mech)
|
|
getRemainingLifetime()
Returns the minimum lifetime of any of the mechanisms
for any usage.
|
|
getUsage()
Returns usage acroding to RFC2743 section 2.1.3.
|
|
getUsage(Oid mech)
|
|
hashCode()
|
|
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail
GSSCredentialImpl
- public GSSCredentialImpl(GSSManagerImpl manager,
- int usage)
- throws GSSException
Throws:
GSSCredentialImpl
- public GSSCredentialImpl(GSSManagerImpl manager,
- GSSName name,
- int lifetime,
- Oid mech,
- int usage)
- throws GSSException
Throws:
GSSCredentialImpl
- public GSSCredentialImpl(GSSManagerImpl manager,
- GSSName name,
- int lifetime,
- Oid[] mechs,
- int usage)
- throws GSSException
Throws:
Method Detail
add
- public void add(GSSName name,
- int initLifetime,
- int acceptLifetime,
- Oid mech,
- int usage)
- throws GSSException
Adds a mechanism specific credential-element to an existing
credential. This method allows the construction of credentials one
mechanism at a time.
This routine is envisioned to be used mainly by context acceptors during the creation of acceptance credentials which are to be used with a variety of clients using different security mechanisms. This routine adds the new credential element "in-place". To add the element in a new credential, first call clone() to obtain a copy of this credential, then call its add() method.
Specified by:
add
in interface GSSCredential
Parameters:
name
- Name of the principal for whom this credential is to be
acquired. Use "null" to specify the default principal. initLifetime
- The number of seconds that credentials should remain
valid for initiating of security contexts.
GSSCredential.INDEFINITE_LIFETIME to request that the
credentials have the maximum permitted lifetime.
Use GSSCredential.DEFAULT_LIFETIME
to request default credential lifetime. acceptLifetime
- The number of seconds that credentials should
remain valid for accepting of security contexts.
Use GSSCredential.INDEFINITE_LIFETIME to request that the
credentials have the maximum permitted lifetime.
Use GSSCredential.DEFAULT_LIFETIME
to request default credential lifetime. mech
- The mechanisms over which the credential is to be acquired. usage
- The intended usage for this credential object.
The value of this parameter must be one of:
GSSCredential.ACCEPT_AND_INITIATE,
GSSCredential.ACCEPT_ONLY, GSSCredential.INITIATE_ONLY Throws:
dispose
- public void dispose()
- throws GSSException
Description copied from interface:
GSSCredential
Releases any sensitive information that the GSSCredential object may
be containing. Applications should call this method as soon as the
credential is no longer needed to minimize the time any sensitive
information is maintained.
Specified by:
dispose
in interface GSSCredential
Throws:
getName
- public GSSName getName()
- throws GSSException
Description copied from interface:
GSSCredential
Retrieves the name of the entity that the credential asserts.
Specified by:
getName
in interface GSSCredential
getName
- public GSSName getName(Oid mech)
- throws GSSException
Description copied from interface:
GSSCredential
Retrieves a mechanism name of the entity that the credential asserts.
Equivalent to calling canonicalize() on the name returned by 7.3.3.
Specified by:
getName
in interface GSSCredential
Parameters:
mech
- The mechanism for which information should be returned. Returns:
The name of the principal that owns this credential.
Throws:
getRemainingLifetime
- public int getRemainingLifetime( )
- throws GSSException
Returns the minimum lifetime of any of the mechanisms
for any usage.
Specified by:
getRemainingLifetime
in interface GSSCredential
Throws:
getRemainingInitLifetime
- public int getRemainingInitLifetime( Oid mech)
- throws GSSException
Description copied from interface:
GSSCredential
Returns the remaining lifetime is seconds for the credential to
remain capable of initiating security contexts under the specified
mechanism.
A return value of GSSCredential.INDEFINITE_LIFETIME indicates that
the credential does not expire for context initiation. A return
value of 0 indicates that the credential is already expired.
Specified by:
getRemainingInitLifetime
in interface GSSCredential
Returns:
The time for which this credential remains valid for
context initiation.
Throws:
getRemainingAcceptLifetime
- public int getRemainingAcceptLifetime( Oid mech)
- throws GSSException
Description copied from interface:
GSSCredential
Returns the remaining lifetime is seconds for the credential to
remain capable of accepting security contexts under the specified
mechanism.
A return value of GSSCredential.INDEFINITE_LIFETIME indicates that
the credential does not expire for context acceptance. A return
value of 0 indicates that the credential is already expired.
Specified by:
getRemainingAcceptLifetime
in interface GSSCredential
Parameters:
mech
- The mechanism for which information should be returned. Returns:
The time for which this credential remains valid for
context acceptance.
Throws:
getUsage
- public int getUsage()
- throws GSSException
Returns usage acroding to RFC2743 section 2.1.3.
Specified by:
getUsage
in interface GSSCredential
Returns:
How this credential is to be used: INITIATE_ONLY,
ACCEPT_ONLY or INITIATE_AND_ACCEPT.
Throws:
getUsage
- public int getUsage(Oid mech)
- throws GSSException
Description copied from interface:
GSSCredential
Returns the credential usage flag for the specified credential
mechanism. The return value will be one of
GSSCredential.INITIATE_ONLY, GSSCredential.ACCEPT_ONLY, or
GSSCredential.INITIATE_AND_ACCEPT.
Specified by:
getUsage
in interface GSSCredential
Parameters:
mech
- The mechanism for which information should be returned. Returns:
How this credential is to be used
for the given mechanism: INITIATE_ONLY,
ACCEPT_ONLY or INITIATE_AND_ACCEPT.
Throws:
getMechs
- public Oid[] getMechs()
- throws GSSException
Description copied from interface:
GSSCredential
Returns an array of mechanisms supported by this credential.
Specified by:
getMechs
in interface GSSCredential
equals
- public boolean equals(java.lang.Object other)
Description copied from interface:
GSSCredential
Tests if this GSSCredential refers to the same entity as the supplied
object. The two credentials must be acquired over the same
mechanisms and must refer to the same principal. Returns "true" if
the two GSSCredentials refer to the same entity; "false" otherwise.
Returns:
"true" if the two credentials are the same,
"false" otherwise.
hashCode
- public int hashCode()
Description copied from interface:
GSSCredential
Returns a hashcode value for this GSSCredential.
Returns:
a hashCode value
getCred
- public GSSCredentialSpi getCred( Oid mech,
- int usage)
- throws GSSException
Throws:
toString
- public java.lang.String toString( )
Overrides:
toString
in class java.lang.Object
GSSCredential