com.ibm.security.jgss

Class GSSCredentialImpl

  1. java.lang.Object
  2. extended bycom.ibm.security.jgss.GSSCredentialImpl
All implemented interfaces:
java.lang.Cloneable, GSSCredential

  1. public class GSSCredentialImpl
  2. extends java.lang.Object
  3. 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
  1. void
add(GSSName name,int initLifetime,int acceptLifetime,Oid mech,int usage)
  1. void
dispose()
  1. boolean
equals(java.lang.Object other)
  1. GSSCredentialSpi
getCred(Oid mech,int usage)
  1. Oid[]
getMechs()
  1. GSSName
getName()
  1. GSSName
getName(Oid mech)
  1. int
getRemainingAcceptLifetime(Oid mech)
  1. int
getRemainingInitLifetime(Oid mech)
  1. int
getRemainingLifetime()
Returns the minimum lifetime of any of the mechanisms for any usage.
  1. int
getUsage()
Returns usage acroding to RFC2743 section 2.1.3.
  1. int
getUsage(Oid mech)
  1. int
hashCode()
  1. java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

GSSCredentialImpl

  1. public GSSCredentialImpl(GSSManagerImpl manager,
  2. int usage)
  3. throws GSSException
Throws:

GSSCredentialImpl

  1. public GSSCredentialImpl(GSSManagerImpl manager,
  2. GSSName name,
  3. int lifetime,
  4. Oid mech,
  5. int usage)
  6. throws GSSException
Throws:

GSSCredentialImpl

  1. public GSSCredentialImpl(GSSManagerImpl manager,
  2. GSSName name,
  3. int lifetime,
  4. Oid[] mechs,
  5. int usage)
  6. throws GSSException
Throws:

Method Detail

add

  1. public void add(GSSName name,
  2. int initLifetime,
  3. int acceptLifetime,
  4. Oid mech,
  5. int usage)
  6. throws GSSException
Description copied from interface: GSSCredential
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

  1. public void dispose()
  2. 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

  1. public GSSName getName()
  2. throws GSSException
Description copied from interface: GSSCredential
Retrieves the name of the entity that the credential asserts.
Specified by:
getName in interface GSSCredential
Returns:
The name of the principal that owns this credential.
Throws:

getName

  1. public GSSName getName(Oid mech)
  2. 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

  1. public int getRemainingLifetime( )
  2. throws GSSException
Returns the minimum lifetime of any of the mechanisms for any usage.
Specified by:
Throws:

getRemainingInitLifetime

  1. public int getRemainingInitLifetime( Oid mech)
  2. 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:
Returns:
The time for which this credential remains valid for context initiation.
Throws:

getRemainingAcceptLifetime

  1. public int getRemainingAcceptLifetime( Oid mech)
  2. 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:
Parameters:
mech - The mechanism for which information should be returned.
Returns:
The time for which this credential remains valid for context acceptance.
Throws:

getUsage

  1. public int getUsage()
  2. 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

  1. public int getUsage(Oid mech)
  2. 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

  1. public Oid[] getMechs()
  2. throws GSSException
Description copied from interface: GSSCredential
Returns an array of mechanisms supported by this credential.
Specified by:
getMechs in interface GSSCredential
Returns:
A list of mechanisms supported by this credential.
Throws:

equals

  1. 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.
Specified by:
equals in interface GSSCredential
Overrides:
equals in class java.lang.Object
Returns:
"true" if the two credentials are the same, "false" otherwise.

hashCode

  1. public int hashCode()
Description copied from interface: GSSCredential
Returns a hashcode value for this GSSCredential.
Specified by:
hashCode in interface GSSCredential
Overrides:
hashCode in class java.lang.Object
Returns:
a hashCode value

getCred

  1. public GSSCredentialSpi getCred( Oid mech,
  2. int usage)
  3. throws GSSException
Throws:

toString

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object