com.ibm.wsspi.wssecurity.auth.token

Class X509BSToken

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.wssecurity.auth.token.WSSToken
  3. extended bycom.ibm.wsspi.wssecurity.auth.token.X509BSToken
All implemented interfaces:
PropagationToken, Token, java.lang.Cloneable

  1. public class X509BSToken
  2. extends WSSToken
This class is a token object implementation for X.509 binary security tokens. It extends the WSSToken class, which implements the Token class. It will typically be created by the X509TokenGenerator and process by the X509TokenConsumer. Protected by following Java 2 Security permissions: com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.X509BSToken.setCert") com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.X509BSToken.setBytes")
See Also:
WSSToken, Token

Nested Class Summary

Nested classes/interfaces inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
WSSToken.AttributesEnumerator

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
CERT_INFO
This is the key used when the X509 certificate is passed to from a KeyLocator object to a TokenConsumer object or from a TokenConsumer object to a LoginModule object.
  1. static
  2. java.lang.String
CERT_STORES
This is the key used when the CertStore object is passed from a TokenGenerator object to a CallbackHandler object or from a TokenConsumer object to a LoginModule object.
  1. static
  2. java.lang.String
KEY_LOCATOR
This is the key used when the object is passed to from a KeyInfoContentConsumer object to a TokenConsumer object.
  1. static
  2. java.lang.String
PKIX_BUILDERPARAM
This is the key used when the PkiXBuilderParameter object is passed from a TokenConsumer object to a LoginModule object.
  1. static
  2. java.lang.String
PROVIDER
This is the key used when the Provider object is passed from a TokenGenerator object to a CallbackHandler object or from a TokenConsumer object to a LoginModule object.
  1. static
  2. java.lang.String
TRUST_ANY
This is the key used when the flag to indicate that any certificates are trusted is passed to from a TokenConsumer object to a LoginModule object.
Fields inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
_attributes, _callerChecked, _error, _keyInfoType, _processed, _referenced, _tokenelem, _tokenId, _trusted, _usedTokenConsumer, _usedTokenGenerator, _usedToLogin, _version, _vtype

Constructor Summary

Constructor and Description
X509BSToken(java.lang.String tokenId,java.security.cert.X509Certificate cert,javax.xml.namespace.QName vtype)
Constructor

Method Summary

Modifier and Type Method and Description
  1. boolean
equals(java.lang.Object o)
  1. byte[]
getBytes()
  1. java.security.cert.X509Certificate
getCert()
Gets the Certificate from X509 Binary Security Token
  1. long
getExpiration()
  1. java.lang.String
getPrincipal()
  1. java.lang.String
getUniqueID()
  1. short
getVersion()
  1. int
hashCode()
  1. boolean
isValid()
  1. void
setBytes(byte[] binary)
  1. void
setCert(java.security.cert.X509Certificate cert)
Sets a reference to the X509Certificate object.
  1. void
setExpiration(long expiration)
  1. java.lang.String
toString()
Methods inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
addAttribute, clone, getAttributeNames, getAttributes, getCallerChecked, getElement, getError, getId, getKeyInfoType, getName, getType, getUsedTokenConsumer, getUsedTokenGenerator, getUsedToLogin, isForwardable, isProcessed, isReadOnly, isReferenced, isTrusted, setCallerChecked, setElement, setError, setId, setKeyInfoType, setProcessed, setReadOnly, setReferenced, setTrusted, setType, setType, setUsedTokenConsumer, setUsedTokenGenerator, setUsedToLogin
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

KEY_LOCATOR

  1. public static final java.lang.String KEY_LOCATOR

This is the key used when the object is passed to from a KeyInfoContentConsumer object to a TokenConsumer object.

See Also:

CERT_INFO

  1. public static final java.lang.String CERT_INFO

This is the key used when the X509 certificate is passed to from a KeyLocator object to a TokenConsumer object or from a TokenConsumer object to a LoginModule object.

See Also:

TRUST_ANY

  1. public static final java.lang.String TRUST_ANY

This is the key used when the flag to indicate that any certificates are trusted is passed to from a TokenConsumer object to a LoginModule object.

See Also:

PROVIDER

  1. public static final java.lang.String PROVIDER

This is the key used when the Provider object is passed from a TokenGenerator object to a CallbackHandler object or from a TokenConsumer object to a LoginModule object.

See Also:

PKIX_BUILDERPARAM

  1. public static final java.lang.String PKIX_BUILDERPARAM

This is the key used when the PkiXBuilderParameter object is passed from a TokenConsumer object to a LoginModule object.

See Also:

CERT_STORES

  1. public static final java.lang.String CERT_STORES

This is the key used when the CertStore object is passed from a TokenGenerator object to a CallbackHandler object or from a TokenConsumer object to a LoginModule object.

See Also:

Constructor Detail

X509BSToken

  1. public X509BSToken(java.lang.String tokenId,
  2. java.security.cert.X509Certificate cert,
  3. javax.xml.namespace.QName vtype)
Constructor
Parameters:
tokenId -
cert -
vtype -

Method Detail

getCert

  1. public java.security.cert.X509Certificate getCert( )
  2. throws SoapSecurityException
Gets the Certificate from X509 Binary Security Token
Returns:
X509Certificate
Throws:

setCert

  1. public void setCert(java.security.cert.X509Certificate cert)
Sets a reference to the X509Certificate object.
Parameters:
cert - X509Certificate object Protected by Java 2 Security permission com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.X509BSToken.setCert")

getBytes

  1. public byte[] getBytes()
Description copied from class: WSSToken
Returns the byte array representation of this token if possible.
Specified by:
getBytes in interface Token
Overrides:
getBytes in class WSSToken
Returns:
The byte array representation of this token

setBytes

  1. public void setBytes(byte[] binary)
Parameters:
binary - Protected by Java 2 Security permission com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.X509BSToken.setBytes")

getExpiration

  1. public long getExpiration()
Description copied from interface: Token

This returns the expiration time in milli-seconds.

Returns:
long

setExpiration

  1. public void setExpiration(long expiration)

getPrincipal

  1. public java.lang.String getPrincipal( )
Description copied from interface: Token

Gets the principal that this Token belongs to. If this is an authorization token, this principal string must match the authentication token principal string or the message will be rejected. CSIv2 has stringent rules about validating authorization tokens using either the Identity Token or Authentication Token principal.

Returns:
String

getUniqueID

  1. public java.lang.String getUniqueID( )
Description copied from interface: Token

Returns a unique identifier of the token based upon information that the provider considers to be unique. This will be used for caching purposes and may be used in combination with other token unique IDs that are part of the same Subject to form a Subject unique identifier.

An implementation of this method should be careful to only change the token uniqueness when required. Any login which generates a new unique ID will create a Subject entry in the cache, which will increase memory requirements.

This method should return null if the token does not need to affect the cache uniqueness. Typically, if using only static registry attributes, this should return null. However, if dynamic attributes are used including strength of authentication, time of day, etc. you may affect the cache uniqueness by returning a non-null value that reflects how you want the cache key too look. Typically, the token implementation will know what is most unique about the dynamic data, however, an alternative is to return a UUID. The values of getUniqueID() from all custom tokens present in the Subject will be added together and used in the SSO token for lookup. A one-way hash of this string will be created as the unique ID. When altering a token to contain a non-null value here, the token must be added to the Subject prior to the commit phase or before the wsMap module commit is called.

Returns:
String

hashCode

  1. public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

  1. public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

isValid

  1. public boolean isValid()
Description copied from interface: Token

Called by the runtime to determine if a token is valid still in terms of expiration, digital signature, etc. The implementation determines what valid means. If this returns false to the WebSphere runtime, an exception will be thrown (appropriate to where the call was made, e.g., NO_PERMISSION, WSLoginFailedException, etc.) and the request will be rejected.

Returns:
boolean

getVersion

  1. public short getVersion()
Description copied from class: WSSToken
Returns the implementation version
Specified by:
getVersion in interface Token
Overrides:
getVersion in class WSSToken
Returns:
The implementation version

toString

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