com.sun.identity.wss.security
Class SecurityTokenFactory

java.lang.Object
  extended by com.sun.identity.wss.security.SecurityTokenFactory

public class SecurityTokenFactory
extends Object

This class SecurityTokenFactory represents a factory class to create WS-Security tokens. This class uses pluggable TokenProviders to generate the WS-Security tokens. If the TokenProvider is not specified, this class will use the default implementation of the Token Provider.


Constructor Summary
protected SecurityTokenFactory(TokenProvider provider)
          Protected constructor.
 
Method Summary
static SecurityTokenFactory getInstance(SSOToken credential)
          Returns the Security Token factory instance.
static SecurityTokenFactory getInstance(TokenProvider provider)
          Returns the Security Token factory instance.
 SecurityToken getSecurityToken(SecurityTokenSpec tokenSpec)
          Returns / Creates a security token from the security token specificaion.
 TokenProvider getTokenProvider()
          Returns the provider of this Security Token factory object.
 

Constructor Detail

SecurityTokenFactory

protected SecurityTokenFactory(TokenProvider provider)
Protected constructor.

Method Detail

getInstance

public static SecurityTokenFactory getInstance(SSOToken credential)
                                        throws SecurityException
Returns the Security Token factory instance. The default TokenProvider is used to generate the WS-Security tokens.

Parameters:
credential - The credential of the authenticated subject.
Throws:
SecurityException - if unable to create the the security token factory.

getInstance

public static SecurityTokenFactory getInstance(TokenProvider provider)
                                        throws SecurityException
Returns the Security Token factory instance.

Parameters:
provider - the token provider implementation.
Throws:
SecurityException - if unable to create the the security token factory.

getSecurityToken

public SecurityToken getSecurityToken(SecurityTokenSpec tokenSpec)
                               throws SecurityException
Returns / Creates a security token from the security token specificaion.

Parameters:
tokenSpec - Security Token Specification that is needed to generate the security tokens.
Returns:
SecurityToken the security token.
Throws:
SecurityException - if the security token could not be generated.

getTokenProvider

public TokenProvider getTokenProvider()
Returns the provider of this Security Token factory object.

Returns:
the token provider.