com.sun.xml.ws.security.trust
Class WSTrustElementFactory

java.lang.Object
  extended by com.sun.xml.ws.security.trust.WSTrustElementFactory
Direct Known Subclasses:
WSTrustElementFactoryImpl, WSTrustElementFactoryImpl

public abstract class WSTrustElementFactory
extends java.lang.Object

A Factory for creating the WS-Trust schema elements, and marshalling/un-marshalling them

The default Implementation classes for all these WS-Trust schema Elements would assume that JAXB Bindings were generated for ws-trust.xsd schema in a particular fixed namespace/package. The default implementation classes for all these WS-Trust Element Interfaces would hence wrap the schema generated classes.

An STS Service can create a RequestSecurityToken from the JAXBBean(i.e RequestSecurityTokenType) it receives, as an SEI method parameter, in the following manner

 RequestSecurityTokenType tok=...//obtained as JAXWS SEI method paramater
 ObjectFactory factory = new ObjectFactory();
 JAXBElement<RequestSecurityTokenType> rst= factory.createRequestSecurityToken(tok);
 WSTrustElementFactory fact= ..
 RequestSecurityToken requestSecurityToken= fact.createRSTFrom(rst);
 

To get back a JAXB Bean from an instance of RequestSecurityToken the following can be done

 JAXBElement<RequestSecurityTokenType> elem = fact.toJAXBElement(requestSecurityToken);
 RequestSecurityTokenType tok = elem.getValue();
 


Constructor Summary
WSTrustElementFactory()
           
 
Method Summary
abstract  BinarySecret createBinarySecret(byte[] rawValue, java.lang.String type)
          Create a BinarySecret
abstract  BinarySecret createBinarySecret(org.w3c.dom.Element elem)
          Create a BinarySecret
abstract  CancelTarget createCancelTarget(SecurityTokenReference str)
           
abstract  Claims createClaims(org.w3c.dom.Element elem)
           
abstract  DirectReference createDirectReference(java.lang.String valueType, java.lang.String uri)
           
abstract  Entropy createEntropy(BinarySecret secret)
          Create an Entropy with a BinarySecret
abstract  Entropy createEntropy(com.sun.xml.ws.security.EncryptedKey key)
          Create an Entropy with an xenc:EncryptedKey
abstract  IssuedTokens createIssuedTokens(RequestSecurityTokenResponseCollection issuedTokens)
          Create a wst:IssuedTokens object
abstract  KeyIdentifier createKeyIdentifier(java.lang.String valueType, java.lang.String encodingType)
           
abstract  Lifetime createLifetime(com.sun.xml.ws.security.wsu10.AttributedDateTime created, com.sun.xml.ws.security.wsu10.AttributedDateTime expires)
          Create a Lifetime.
abstract  OnBehalfOf createOnBehalfOf(com.sun.xml.ws.security.Token oboToken)
           
abstract  RenewTarget createRenewTarget(SecurityTokenReference str)
           
abstract  RequestedAttachedReference createRequestedAttachedReference(SecurityTokenReference str)
          Create a RequestedAttachedReference.
abstract  RequestedProofToken createRequestedProofToken()
          Create a RequestedProofToken.
abstract  RequestedSecurityToken createRequestedSecurityToken()
           
abstract  RequestedSecurityToken createRequestedSecurityToken(com.sun.xml.ws.security.Token token)
          Create a RequestedSecurityToken.
abstract  RequestedUnattachedReference createRequestedUnattachedReference(SecurityTokenReference str)
          Create a RequestedUnattachedReference.
abstract  RequestSecurityToken createRST()
          Create an Empty RST
abstract  RequestSecurityToken createRSTForCancel(java.net.URI requestType, CancelTarget target)
          Create an RST for Token Cancellation
abstract  RequestSecurityToken createRSTForIssue(java.net.URI tokenType, java.net.URI requestType, java.net.URI context, com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes, Claims claims, Entropy entropy, Lifetime lifetime)
          Create an RST for Issue from the given arguments Any of the arguments can be null since they are all optional, but one of tokenType and AppliesTo must be present
abstract  RequestSecurityToken createRSTForRenew(java.net.URI tokenType, java.net.URI requestType, java.net.URI context, RenewTarget target, AllowPostdating apd, Renewing renewingInfo)
          Create an RST for a Renewal Request
abstract  RequestSecurityToken createRSTForValidate(java.net.URI tokenType, java.net.URI requestType)
          Create an RST for Token Validation
abstract  RequestSecurityToken createRSTFrom(org.w3c.dom.Element elem)
          create an RST from DOM Element
abstract  RequestSecurityToken createRSTFrom(javax.xml.bind.JAXBElement elem)
          create an RST from JAXBElement
abstract  RequestSecurityToken createRSTFrom(javax.xml.transform.Source src)
          create an RST from a Source
abstract  RequestSecurityTokenResponse createRSTR()
          Create an Empty RSTR
abstract  RequestSecurityTokenResponseCollection createRSTRC(java.util.List<RequestSecurityTokenResponse> rstrs)
           
abstract  RequestSecurityTokenResponseCollection createRSTRCollectionForIssue(java.net.URI tokenType, java.net.URI context, RequestedSecurityToken token, com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes, RequestedAttachedReference attachedRef, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime)
          Create a collection of RequestSecurityTokenResponse(s)
abstract  RequestSecurityTokenResponseCollection createRSTRCollectionFrom(org.w3c.dom.Element elem)
          Create RSTR Collection from Element
abstract  RequestSecurityTokenResponseCollection createRSTRCollectionFrom(javax.xml.bind.JAXBElement elem)
          create an RSTR Collection from JAXBElement
abstract  RequestSecurityTokenResponseCollection createRSTRCollectionFrom(javax.xml.transform.Source src)
          Create RSTR Collection from Source
abstract  RequestSecurityTokenResponse createRSTRForCancel()
          Create an RSTR for a Successful Token Cancellation
abstract  RequestSecurityTokenResponse createRSTRForIssue(java.net.URI tokenType, java.net.URI context, RequestedSecurityToken token, com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes, RequestedAttachedReference attachedRef, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime)
          create an RSTR for Issue from the given arguments Any of the arguments can be null since they are all optional, but one of RequestedSecurityToken or RequestedProofToken should be returned
abstract  RequestSecurityTokenResponse createRSTRForRenew(java.net.URI tokenType, java.net.URI context, RequestedSecurityToken token, RequestedAttachedReference attachedReference, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime)
          Create an RSTR for a Renewal Response
abstract  RequestSecurityTokenResponse createRSTRForValidate(java.net.URI tokenType, RequestedSecurityToken token, Status status)
          create an RSTR for validate request.
abstract  RequestSecurityTokenResponse createRSTRFrom(org.w3c.dom.Element elem)
          create an RSTR from DOM Element
abstract  RequestSecurityTokenResponse createRSTRFrom(javax.xml.bind.JAXBElement elem)
          create an RSTR from JAXBElement
abstract  RequestSecurityTokenResponse createRSTRFrom(javax.xml.transform.Source src)
          create an RSTR from a Source
abstract  SecondaryParameters createSecondaryParameters()
          Create SecondaryParameters
abstract  SecurityTokenReference createSecurityTokenReference(javax.xml.bind.JAXBElement elem)
           
abstract  SecurityTokenReference createSecurityTokenReference(Reference ref)
           
abstract  Status createStatus(java.lang.String code, java.lang.String reason)
           
abstract  UseKey createUseKey(com.sun.xml.ws.security.Token token, java.lang.String sig)
           
abstract  ValidateTarget createValidateTarget(com.sun.xml.ws.security.Token token)
           
static javax.xml.bind.JAXBContext getContext()
           
static javax.xml.bind.JAXBContext getContext(WSTrustVersion wstVer)
           
static WSTrustElementFactory newInstance()
           
static WSTrustElementFactory newInstance(WSSCVersion wsscVer)
           
static WSTrustElementFactory newInstance(WSTrustVersion wstVer)
           
abstract  org.w3c.dom.Element toElement(BaseSTSRequest request)
           
abstract  org.w3c.dom.Element toElement(BaseSTSResponse response)
           
abstract  org.w3c.dom.Element toElement(BinarySecret binarySecret)
          Marshal an BinarySecret to a DOM Element
abstract  org.w3c.dom.Element toElement(BinarySecret binarySecret, org.w3c.dom.Document doc)
          Marshal an BinarySecret to a DOM Element.
abstract  org.w3c.dom.Element toElement(RequestSecurityToken rst)
          Marshal an RST to a DOM Element.
abstract  org.w3c.dom.Element toElement(RequestSecurityTokenResponse rstr)
          Marshal an RSTR to DOM Element
abstract  org.w3c.dom.Element toElement(RequestSecurityTokenResponseCollection rstrCollection)
          Marshal an RSTR Collection to a DOM Element
abstract  org.w3c.dom.Element toElement(RequestSecurityTokenResponse rstr, org.w3c.dom.Document doc)
           
abstract  org.w3c.dom.Element toElement(SecurityTokenReference str, org.w3c.dom.Document doc)
          Marshal an STR to a DOM Element.
abstract  javax.xml.bind.JAXBElement toJAXBElement(BaseSTSRequest request)
           
abstract  javax.xml.bind.JAXBElement toJAXBElement(BaseSTSResponse response)
           
abstract  javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityToken rst)
          convert an RST to a JAXBElement
abstract  javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponse rstr)
          convert an RSTR to a JAXBElement
abstract  javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponseCollection rstrCollection)
          convert an RSTR Collection to a JAXBElement
abstract  javax.xml.bind.JAXBElement toJAXBElement(SecurityTokenReference str)
          convert an SecurityTokenReference to a JAXBElement
abstract  javax.xml.transform.Source toSource(BaseSTSRequest request)
           
abstract  javax.xml.transform.Source toSource(BaseSTSResponse response)
           
abstract  javax.xml.transform.Source toSource(RequestSecurityToken rst)
          Marshal an RST to a Source.
abstract  javax.xml.transform.Source toSource(RequestSecurityTokenResponse rstr)
          Marshal an RSTR to a Source
abstract  javax.xml.transform.Source toSource(RequestSecurityTokenResponseCollection rstrCollection)
          Marshal an RSTR Collection to a Source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSTrustElementFactory

public WSTrustElementFactory()
Method Detail

getContext

public static javax.xml.bind.JAXBContext getContext()

getContext

public static javax.xml.bind.JAXBContext getContext(WSTrustVersion wstVer)

newInstance

public static WSTrustElementFactory newInstance()

newInstance

public static WSTrustElementFactory newInstance(WSTrustVersion wstVer)

newInstance

public static WSTrustElementFactory newInstance(WSSCVersion wsscVer)

createRSTForIssue

public abstract RequestSecurityToken createRSTForIssue(java.net.URI tokenType,
                                                       java.net.URI requestType,
                                                       java.net.URI context,
                                                       com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes,
                                                       Claims claims,
                                                       Entropy entropy,
                                                       Lifetime lifetime)
                                                throws WSTrustException
Create an RST for Issue from the given arguments Any of the arguments can be null since they are all optional, but one of tokenType and AppliesTo must be present

Throws:
WSTrustException

createRSTRForIssue

public abstract RequestSecurityTokenResponse createRSTRForIssue(java.net.URI tokenType,
                                                                java.net.URI context,
                                                                RequestedSecurityToken token,
                                                                com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes,
                                                                RequestedAttachedReference attachedRef,
                                                                RequestedUnattachedReference unattachedRef,
                                                                RequestedProofToken proofToken,
                                                                Entropy entropy,
                                                                Lifetime lifetime)
                                                         throws WSTrustException
create an RSTR for Issue from the given arguments Any of the arguments can be null since they are all optional, but one of RequestedSecurityToken or RequestedProofToken should be returned

Throws:
WSTrustException

createRSTRCollectionForIssue

public abstract RequestSecurityTokenResponseCollection createRSTRCollectionForIssue(java.net.URI tokenType,
                                                                                    java.net.URI context,
                                                                                    RequestedSecurityToken token,
                                                                                    com.sun.xml.ws.policy.impl.bindings.AppliesTo scopes,
                                                                                    RequestedAttachedReference attachedRef,
                                                                                    RequestedUnattachedReference unattachedRef,
                                                                                    RequestedProofToken proofToken,
                                                                                    Entropy entropy,
                                                                                    Lifetime lifetime)
                                                                             throws WSTrustException
Create a collection of RequestSecurityTokenResponse(s)

Throws:
WSTrustException

createIssuedTokens

public abstract IssuedTokens createIssuedTokens(RequestSecurityTokenResponseCollection issuedTokens)
Create a wst:IssuedTokens object


createEntropy

public abstract Entropy createEntropy(BinarySecret secret)
Create an Entropy with a BinarySecret


createEntropy

public abstract Entropy createEntropy(com.sun.xml.ws.security.EncryptedKey key)
Create an Entropy with an xenc:EncryptedKey


createSecondaryParameters

public abstract SecondaryParameters createSecondaryParameters()
Create SecondaryParameters


createBinarySecret

public abstract BinarySecret createBinarySecret(byte[] rawValue,
                                                java.lang.String type)
Create a BinarySecret


createBinarySecret

public abstract BinarySecret createBinarySecret(org.w3c.dom.Element elem)
                                         throws WSTrustException
Create a BinarySecret

Throws:
WSTrustException

createUseKey

public abstract UseKey createUseKey(com.sun.xml.ws.security.Token token,
                                    java.lang.String sig)

createOnBehalfOf

public abstract OnBehalfOf createOnBehalfOf(com.sun.xml.ws.security.Token oboToken)

createValidateTarget

public abstract ValidateTarget createValidateTarget(com.sun.xml.ws.security.Token token)

createStatus

public abstract Status createStatus(java.lang.String code,
                                    java.lang.String reason)

createLifetime

public abstract Lifetime createLifetime(com.sun.xml.ws.security.wsu10.AttributedDateTime created,
                                        com.sun.xml.ws.security.wsu10.AttributedDateTime expires)
Create a Lifetime.


createRequestedProofToken

public abstract RequestedProofToken createRequestedProofToken()
Create a RequestedProofToken.


createRequestedSecurityToken

public abstract RequestedSecurityToken createRequestedSecurityToken(com.sun.xml.ws.security.Token token)
Create a RequestedSecurityToken.


createRequestedSecurityToken

public abstract RequestedSecurityToken createRequestedSecurityToken()

createDirectReference

public abstract DirectReference createDirectReference(java.lang.String valueType,
                                                      java.lang.String uri)

createKeyIdentifier

public abstract KeyIdentifier createKeyIdentifier(java.lang.String valueType,
                                                  java.lang.String encodingType)

createSecurityTokenReference

public abstract SecurityTokenReference createSecurityTokenReference(Reference ref)

createRequestedAttachedReference

public abstract RequestedAttachedReference createRequestedAttachedReference(SecurityTokenReference str)
Create a RequestedAttachedReference.


createRequestedUnattachedReference

public abstract RequestedUnattachedReference createRequestedUnattachedReference(SecurityTokenReference str)
Create a RequestedUnattachedReference.


createRSTForRenew

public abstract RequestSecurityToken createRSTForRenew(java.net.URI tokenType,
                                                       java.net.URI requestType,
                                                       java.net.URI context,
                                                       RenewTarget target,
                                                       AllowPostdating apd,
                                                       Renewing renewingInfo)
Create an RST for a Renewal Request


createRSTRForRenew

public abstract RequestSecurityTokenResponse createRSTRForRenew(java.net.URI tokenType,
                                                                java.net.URI context,
                                                                RequestedSecurityToken token,
                                                                RequestedAttachedReference attachedReference,
                                                                RequestedUnattachedReference unattachedRef,
                                                                RequestedProofToken proofToken,
                                                                Entropy entropy,
                                                                Lifetime lifetime)
                                                         throws WSTrustException
Create an RSTR for a Renewal Response

Throws:
WSTrustException

createRenewTarget

public abstract RenewTarget createRenewTarget(SecurityTokenReference str)

createCancelTarget

public abstract CancelTarget createCancelTarget(SecurityTokenReference str)

createRSTForCancel

public abstract RequestSecurityToken createRSTForCancel(java.net.URI requestType,
                                                        CancelTarget target)
Create an RST for Token Cancellation


createRSTRForCancel

public abstract RequestSecurityTokenResponse createRSTRForCancel()
Create an RSTR for a Successful Token Cancellation


createRSTForValidate

public abstract RequestSecurityToken createRSTForValidate(java.net.URI tokenType,
                                                          java.net.URI requestType)
Create an RST for Token Validation

TODO: Not clear from Spec whether the Token to be validated is ever sent ? TODO: There is a mention of special case where a SOAPEnvelope may be specified as a security token if the requestor desires the envelope to be validated.


createRSTRForValidate

public abstract RequestSecurityTokenResponse createRSTRForValidate(java.net.URI tokenType,
                                                                   RequestedSecurityToken token,
                                                                   Status status)
create an RSTR for validate request.


createRSTRC

public abstract RequestSecurityTokenResponseCollection createRSTRC(java.util.List<RequestSecurityTokenResponse> rstrs)

createRST

public abstract RequestSecurityToken createRST()
Create an Empty RST


createRSTR

public abstract RequestSecurityTokenResponse createRSTR()
Create an Empty RSTR


createRSTFrom

public abstract RequestSecurityToken createRSTFrom(javax.xml.transform.Source src)
create an RST from a Source


createRSTFrom

public abstract RequestSecurityToken createRSTFrom(org.w3c.dom.Element elem)
create an RST from DOM Element


createRSTRFrom

public abstract RequestSecurityTokenResponse createRSTRFrom(javax.xml.transform.Source src)
create an RSTR from a Source


createRSTRFrom

public abstract RequestSecurityTokenResponse createRSTRFrom(org.w3c.dom.Element elem)
create an RSTR from DOM Element


createRSTRCollectionFrom

public abstract RequestSecurityTokenResponseCollection createRSTRCollectionFrom(javax.xml.transform.Source src)
Create RSTR Collection from Source


createRSTRCollectionFrom

public abstract RequestSecurityTokenResponseCollection createRSTRCollectionFrom(org.w3c.dom.Element elem)
Create RSTR Collection from Element


createClaims

public abstract Claims createClaims(org.w3c.dom.Element elem)
                             throws WSTrustException
Throws:
WSTrustException

createRSTFrom

public abstract RequestSecurityToken createRSTFrom(javax.xml.bind.JAXBElement elem)
create an RST from JAXBElement

NOTE: an STS Implementor can call

 JAXBElement<RequestSecurityTokenType> elem= 
 ObjectFactory.createRequestSecurityToken(<JAXBBean for RST>)
 
The JAXBBean for RST is the one generated from the ws-trust.xsd schema The default implementation expects the packagename of the generated JAXB Beans to be fixed.


createRSTRFrom

public abstract RequestSecurityTokenResponse createRSTRFrom(javax.xml.bind.JAXBElement elem)
create an RSTR from JAXBElement

NOTE: an STS Implementor can call

 JAXBElement<RequestSecurityTokenResponseType> elem= 
 ObjectFactory.createRequestSecurityTokenResponse(<JAXBBean for RSTR>);
 
The <JAXBBean for RSTR> is the one generated from the ws-trust.xsd schema The default implementation expects the packagename of the generated JAXB Beans to be fixed.


createRSTRCollectionFrom

public abstract RequestSecurityTokenResponseCollection createRSTRCollectionFrom(javax.xml.bind.JAXBElement elem)
create an RSTR Collection from JAXBElement

NOTE: an STS Implementor can call

 JAXBElement<RequestSecurityTokenResponseCollectionType> elem= 
 ObjectFactory.createRequestSecurityTokenResponseCollection(<JAXBBean for RSTR Collection>
 
The <JAXBBean for RSTR Collection> is the one generated from the ws-trust.xsd schema The default implementation expects the packagename of the generated JAXB Beans to be fixed.


createSecurityTokenReference

public abstract SecurityTokenReference createSecurityTokenReference(javax.xml.bind.JAXBElement elem)

toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(BaseSTSRequest request)

toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(BaseSTSResponse response)

toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(SecurityTokenReference str)
convert an SecurityTokenReference to a JAXBElement


toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityToken rst)
convert an RST to a JAXBElement


toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponse rstr)
convert an RSTR to a JAXBElement


toJAXBElement

public abstract javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponseCollection rstrCollection)
convert an RSTR Collection to a JAXBElement


toSource

public abstract javax.xml.transform.Source toSource(BaseSTSRequest request)

toSource

public abstract javax.xml.transform.Source toSource(BaseSTSResponse response)

toSource

public abstract javax.xml.transform.Source toSource(RequestSecurityToken rst)
Marshal an RST to a Source.

Note: Useful for Dispatch Client implementations


toSource

public abstract javax.xml.transform.Source toSource(RequestSecurityTokenResponse rstr)
Marshal an RSTR to a Source

Note: Useful for STS implementations which are JAXWS Providers


toSource

public abstract javax.xml.transform.Source toSource(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a Source

Note: Useful for STS implementations which are JAXWS Providers


toElement

public abstract org.w3c.dom.Element toElement(BaseSTSRequest request)

toElement

public abstract org.w3c.dom.Element toElement(BaseSTSResponse response)

toElement

public abstract org.w3c.dom.Element toElement(RequestSecurityToken rst)
Marshal an RST to a DOM Element.

Note: Useful for Dispatch Client implementations


toElement

public abstract org.w3c.dom.Element toElement(RequestSecurityTokenResponse rstr)
Marshal an RSTR to DOM Element

Note: Useful for STS implementations which are JAXWS Providers


toElement

public abstract org.w3c.dom.Element toElement(RequestSecurityTokenResponse rstr,
                                              org.w3c.dom.Document doc)

toElement

public abstract org.w3c.dom.Element toElement(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a DOM Element

Note: Useful for STS implementations which are JAXWS Providers


toElement

public abstract org.w3c.dom.Element toElement(BinarySecret binarySecret)
Marshal an BinarySecret to a DOM Element

Note: Useful for STS implementations which are JAXWS Providers


toElement

public abstract org.w3c.dom.Element toElement(SecurityTokenReference str,
                                              org.w3c.dom.Document doc)
Marshal an STR to a DOM Element.

Note: Useful for Dispatch Client implementations


toElement

public abstract org.w3c.dom.Element toElement(BinarySecret binarySecret,
                                              org.w3c.dom.Document doc)
Marshal an BinarySecret to a DOM Element.

Note: Useful for Dispatch Client implementations