APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.security.jgss

public Class GSSCredentialImpl

extends Object
implements GSSCredential
Class Inheritance
All Implemented Interfaces
org.ietf.jgss.GSSCredential, java.lang.Cloneable
Imports
org.ietf.jgss.*, sun.security.jgss.spi.*, java.util.*, sun.security.jgss.spnego.SpNegoCredElement

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private boolean
private GSSManagerImpl
private Hashtable<GSSCredentialImpl.SearchKey, GSSCredentialSpi>
private GSSCredentialSpi

Constructor Summary

AccessConstructor and Description
public
protected
pack-priv
GSSCredentialImpl(GSSManagerImpl gssManager, int usage)

pack-priv
GSSCredentialImpl(GSSManagerImpl gssManager, GSSName name, int lifetime, Oid mech, int usage)

pack-priv
GSSCredentialImpl(GSSManagerImpl gssManager, GSSName name, int lifetime, Oid[] mechs, int usage)

public

Method Summary

Modifier and TypeMethod and Description
public void
add(GSSName name, int initLifetime, int acceptLifetime, Oid mech, int usage)

Implements org.ietf.jgss.GSSCredential.add.

Adds a mechanism specific credential-element to an existing credential.

public void
dispose()

Implements org.ietf.jgss.GSSCredential.dispose.

Releases any sensitive information that the GSSCredential object may be containing.

public boolean
equals(Object another)

Overrides java.lang.Object.equals.

Implements org.ietf.jgss.GSSCredential.equals.

Tests if this GSSCredential asserts the same entity as the supplied object.

public GSSCredentialSpi

Returns:

mechanism credential object
getElement
(Oid
the oid for mechanism to retrieve
mechOid
,
boolean
boolean indicating if the function is to throw exception or return null when element is not found.
initiate
)

Returns the specified mechanism's credential-element.

pack-priv Set<GSSCredentialSpi>
private static String
getElementStr(Oid mechOid, int usage)

public Oid[]
getMechs()

Implements org.ietf.jgss.GSSCredential.getMechs.

Returns a list of mechanisms supported by this credential.

public GSSName
getName()

Implements org.ietf.jgss.GSSCredential.getName.

Retrieves the name of the entity that the credential asserts.

public GSSName
getName(Oid mech)

Implements org.ietf.jgss.GSSCredential.getName.

Retrieves a Mechanism Name of the entity that the credential asserts.

public int
getRemainingAcceptLifetime(Oid mech)

Implements org.ietf.jgss.GSSCredential.getRemainingAcceptLifetime.

Returns the lifetime in seconds for the credential to remain capable of accepting security contexts using the specified mechanism.

public int
getRemainingInitLifetime(Oid mech)

Implements org.ietf.jgss.GSSCredential.getRemainingInitLifetime.

Returns the lifetime in seconds for the credential to remain capable of initiating security contexts using the specified mechanism.

public int
getRemainingLifetime()

Implements org.ietf.jgss.GSSCredential.getRemainingLifetime.

Returns the remaining lifetime of this credential.

public int
getUsage()

Implements org.ietf.jgss.GSSCredential.getUsage.

Returns the usage mode for this credential.

public int
getUsage(Oid mech)

Implements org.ietf.jgss.GSSCredential.getUsage.

Returns the credential usage mode for a specific mechanism.

public int

Returns:

a hashcode value for this GSSCredential
hashCode
()

Overrides java.lang.Object.hashCode.

Implements org.ietf.jgss.GSSCredential.hashCode.

Returns a hashcode value for this GSSCredential.

public GSSCredential
pack-priv void
init(GSSManagerImpl gssManager)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

destroyedback to summary
private boolean destroyed
gssManagerback to summary
private GSSManagerImpl gssManager
hashtableback to summary
private Hashtable<GSSCredentialImpl.SearchKey, GSSCredentialSpi> hashtable
tempCredback to summary
private GSSCredentialSpi tempCred

Constructor Detail

GSSCredentialImplback to summary
public GSSCredentialImpl()
GSSCredentialImplback to summary
protected GSSCredentialImpl(GSSCredentialImpl src)
GSSCredentialImplback to summary
pack-priv GSSCredentialImpl(GSSManagerImpl gssManager, int usage) throws GSSException
GSSCredentialImplback to summary
pack-priv GSSCredentialImpl(GSSManagerImpl gssManager, GSSName name, int lifetime, Oid mech, int usage) throws GSSException
GSSCredentialImplback to summary
pack-priv GSSCredentialImpl(GSSManagerImpl gssManager, GSSName name, int lifetime, Oid[] mechs, int usage) throws GSSException
GSSCredentialImplback to summary
public GSSCredentialImpl(GSSManagerImpl gssManager, GSSCredentialSpi mechElement) throws GSSException

Method Detail

addback to summary
public void add(GSSName name, int initLifetime, int acceptLifetime, Oid mech, int usage) throws GSSException

Implements org.ietf.jgss.GSSCredential.add.

Doc from org.ietf.jgss.GSSCredential.add.

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 acceptor 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.

As always, GSS-API implementations must impose a local access-control policy on callers to prevent unauthorized callers from acquiring credentials to which they are not entitled. Non-default values for initLifetime and acceptLifetime cannot always be honored by the underlying mechanisms, thus callers should be prepared to call getRemainingInitLifetime and getRemainingAcceptLifetime on the credential.

Exceptions
GSSException:
containing the following major error codes: GSSException.DUPLICATE_ELEMENT, GSSException.BAD_MECH, GSSException.BAD_NAMETYPE, GSSException.NO_CRED, GSSException.CREDENTIALS_EXPIRED, GSSException.FAILURE
disposeback to summary
public void dispose() throws GSSException

Implements org.ietf.jgss.GSSCredential.dispose.

Doc from org.ietf.jgss.GSSCredential.dispose.

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.

Exceptions
GSSException:
containing the following major error codes: GSSException.FAILURE
equalsback to summary
public boolean equals(Object another)

Overrides java.lang.Object.equals.

Implements org.ietf.jgss.GSSCredential.equals.

Doc from org.ietf.jgss.GSSCredential.equals.

Tests if this GSSCredential asserts the same entity as the supplied object. The two credentials must be acquired over the same mechanisms and must refer to the same principal.

Annotations
@Override
getElementback to summary
public GSSCredentialSpi getElement(Oid mechOid, boolean initiate) throws GSSException

Returns the specified mechanism's credential-element.

Parameters
mechOid:Oid

the oid for mechanism to retrieve

initiate:boolean

boolean indicating if the function is to throw exception or return null when element is not found.

Returns:GSSCredentialSpi

mechanism credential object

Exceptions
GSSException:
of invalid mechanism
getElementsback to summary
pack-priv Set<GSSCredentialSpi> getElements()
getElementStrback to summary
private static String getElementStr(Oid mechOid, int usage)
getMechsback to summary
public Oid[] getMechs() throws GSSException

Implements org.ietf.jgss.GSSCredential.getMechs.

Doc from org.ietf.jgss.GSSCredential.getMechs.

Returns a list of mechanisms supported by this credential. It does not tell us which ones can be used to initiate contexts and which ones can be used to accept contexts. The application must call the getUsage method with each of the returned Oid's to determine the possible modes of usage.

Exceptions
GSSException:
containing the following major error codes: GSSException.FAILURE
getNameback to summary
public GSSName getName() throws GSSException

Implements org.ietf.jgss.GSSCredential.getName.

Doc from org.ietf.jgss.GSSCredential.getName.

Retrieves the name of the entity that the credential asserts.

Exceptions
GSSException:
containing the following major error codes: GSSException.FAILURE
getNameback to summary
public GSSName getName(Oid mech) throws GSSException

Implements org.ietf.jgss.GSSCredential.getName.

Doc from org.ietf.jgss.GSSCredential.getName.

Retrieves a Mechanism Name of the entity that the credential asserts. This is equivalent to calling canonicalize on the value returned by the other form of getName.

Exceptions
GSSException:
containing the following major error codes: GSSException.BAD_MECH, GSSException.FAILURE
getRemainingAcceptLifetimeback to summary
public int getRemainingAcceptLifetime(Oid mech) throws GSSException

Implements org.ietf.jgss.GSSCredential.getRemainingAcceptLifetime.

Doc from org.ietf.jgss.GSSCredential.getRemainingAcceptLifetime.

Returns the lifetime in seconds for the credential to remain capable of accepting security contexts using the specified mechanism. This method queries the acceptor credential element that belongs to the specified mechanism.

Exceptions
GSSException:
containing the following major error codes: GSSException.BAD_MECH, GSSException.FAILURE
getRemainingInitLifetimeback to summary
public int getRemainingInitLifetime(Oid mech) throws GSSException

Implements org.ietf.jgss.GSSCredential.getRemainingInitLifetime.

Doc from org.ietf.jgss.GSSCredential.getRemainingInitLifetime.

Returns the lifetime in seconds for the credential to remain capable of initiating security contexts using the specified mechanism. This method queries the initiator credential element that belongs to the specified mechanism.

Exceptions
GSSException:
containing the following major error codes: GSSException.BAD_MECH, GSSException.FAILURE
getRemainingLifetimeback to summary
public int getRemainingLifetime() throws GSSException

Implements org.ietf.jgss.GSSCredential.getRemainingLifetime.

Returns the remaining lifetime of this credential. The remaining lifetime is defined as the minimum lifetime, either for initiate or for accept, across all elements contained in it. Not terribly useful, but required by GSS-API.

Exceptions
GSSException:

Doc from org.ietf.jgss.GSSCredential.getRemainingLifetime.

containing the following major error codes: GSSException.FAILURE

getUsageback to summary
public int getUsage() throws GSSException

Implements org.ietf.jgss.GSSCredential.getUsage.

Returns the usage mode for this credential. Returns INITIATE_AND_ACCEPT if any one element contained in it supports INITIATE_AND_ACCEPT or if two different elements exist where one support INITIATE_ONLY and the other supports ACCEPT_ONLY.

Exceptions
GSSException:

Doc from org.ietf.jgss.GSSCredential.getUsage.

containing the following major error codes: GSSException.FAILURE

getUsageback to summary
public int getUsage(Oid mech) throws GSSException

Implements org.ietf.jgss.GSSCredential.getUsage.

Doc from org.ietf.jgss.GSSCredential.getUsage.

Returns the credential usage mode for a specific mechanism. In other words, it tells us if this credential can be used for initiating or accepting security contexts with a given underlying mechanism.

Exceptions
GSSException:
containing the following major error codes: GSSException.BAD_MECH, GSSException.FAILURE
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.ietf.jgss.GSSCredential.hashCode.

Returns a hashcode value for this GSSCredential.

Returns:int

a hashcode value for this GSSCredential

Annotations
@Override
impersonateback to summary
public GSSCredential impersonate(GSSName name) throws GSSException
initback to summary
pack-priv void init(GSSManagerImpl gssManager)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

sun.security.jgss back to summary

pack-priv Class GSSCredentialImpl.SearchKey

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Oid
private int

Constructor Summary

AccessConstructor and Description
public
SearchKey(Oid mechOid, int usage)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object other)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Oid
public int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

mechOidback to summary
private final Oid mechOid
usageback to summary
private int usage

Constructor Detail

SearchKeyback to summary
public SearchKey(Oid mechOid, int usage)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

getMechback to summary
public Oid getMech()
getUsageback to summary
public int getUsage()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.