Class WSTrustElementFactory
- java.lang.Object
-
- com.sun.xml.ws.security.trust.WSTrustElementFactory
-
- Direct Known Subclasses:
WSTrustElementFactoryImpl,WSTrustElementFactoryImpl
public abstract class WSTrustElementFactory extends Object
A Factory for creating the WS-Trust schema elements, and marshalling/un-marshalling themThe 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();
- Author:
- Kumar Jayanti
-
-
Constructor Summary
Constructors Constructor Description WSTrustElementFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ActAscreateActAs(Token token)abstract BinarySecretcreateBinarySecret(byte[] rawValue, String type)Create a BinarySecretabstract BinarySecretcreateBinarySecret(Element elem)Create a BinarySecretabstract CancelTargetcreateCancelTarget(SecurityTokenReference str)abstract ClaimscreateClaims()abstract ClaimscreateClaims(Claims claims)abstract ClaimscreateClaims(Element elem)abstract DirectReferencecreateDirectReference(String valueType, String uri)abstract EntropycreateEntropy(EncryptedKey key)Create an Entropy with an xenc:EncryptedKeyabstract EntropycreateEntropy(BinarySecret secret)Create an Entropy with a BinarySecretabstract IssuedTokenscreateIssuedTokens(RequestSecurityTokenResponseCollection issuedTokens)Create a wst:IssuedTokens objectabstract KeyIdentifiercreateKeyIdentifier(String valueType, String encodingType)abstract LifetimecreateLifetime(AttributedDateTime created, AttributedDateTime expires)Create a Lifetime.abstract OnBehalfOfcreateOnBehalfOf(Token oboToken)abstract RenewTargetcreateRenewTarget(SecurityTokenReference str)abstract RequestedAttachedReferencecreateRequestedAttachedReference(SecurityTokenReference str)Create a RequestedAttachedReference.abstract RequestedProofTokencreateRequestedProofToken()Create a RequestedProofToken.abstract RequestedSecurityTokencreateRequestedSecurityToken()abstract RequestedSecurityTokencreateRequestedSecurityToken(Token token)Create a RequestedSecurityToken.abstract RequestedUnattachedReferencecreateRequestedUnattachedReference(SecurityTokenReference str)Create a RequestedUnattachedReference.abstract RequestSecurityTokencreateRST()Create an Empty RSTabstract RequestSecurityTokencreateRSTForCancel(URI requestType, CancelTarget target)Create an RST for Token Cancellationabstract RequestSecurityTokencreateRSTForIssue(URI tokenType, URI requestType, URI context, 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 presentabstract RequestSecurityTokencreateRSTForRenew(URI tokenType, URI requestType, URI context, RenewTarget target, AllowPostdating apd, Renewing renewingInfo)Create an RST for a Renewal Requestabstract RequestSecurityTokencreateRSTForValidate(URI tokenType, URI requestType)Create an RST for Token Validationabstract RequestSecurityTokencreateRSTFrom(javax.xml.bind.JAXBElement elem)create an RST from JAXBElementabstract RequestSecurityTokencreateRSTFrom(Source src)create an RST from a Sourceabstract RequestSecurityTokencreateRSTFrom(Element elem)create an RST from DOM Elementabstract RequestSecurityTokenResponsecreateRSTR()Create an Empty RSTRabstract RequestSecurityTokenResponseCollectioncreateRSTRC(List<RequestSecurityTokenResponse> rstrs)abstract RequestSecurityTokenResponseCollectioncreateRSTRCollectionForIssue(URI tokenType, URI context, RequestedSecurityToken token, AppliesTo scopes, RequestedAttachedReference attachedRef, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime)Create a collection of RequestSecurityTokenResponse(s)abstract RequestSecurityTokenResponseCollectioncreateRSTRCollectionFrom(javax.xml.bind.JAXBElement elem)create an RSTR Collection from JAXBElementabstract RequestSecurityTokenResponseCollectioncreateRSTRCollectionFrom(Source src)Create RSTR Collection from Sourceabstract RequestSecurityTokenResponseCollectioncreateRSTRCollectionFrom(Element elem)Create RSTR Collection from Elementabstract RequestSecurityTokenResponsecreateRSTRForCancel()Create an RSTR for a Successful Token Cancellationabstract RequestSecurityTokenResponsecreateRSTRForIssue(URI tokenType, URI context, RequestedSecurityToken token, 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 returnedabstract RequestSecurityTokenResponsecreateRSTRForRenew(URI tokenType, URI context, RequestedSecurityToken token, RequestedAttachedReference attachedReference, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime)Create an RSTR for a Renewal Responseabstract RequestSecurityTokenResponsecreateRSTRForValidate(URI tokenType, RequestedSecurityToken token, Status status)create an RSTR for validate request.abstract RequestSecurityTokenResponsecreateRSTRFrom(javax.xml.bind.JAXBElement elem)create an RSTR from JAXBElementabstract RequestSecurityTokenResponsecreateRSTRFrom(Source src)create an RSTR from a Sourceabstract RequestSecurityTokenResponsecreateRSTRFrom(Element elem)create an RSTR from DOM Elementabstract SecondaryParameterscreateSecondaryParameters()Create SecondaryParametersabstract SecurityContextTokencreateSecurityContextToken(URI identifier, String instance, String wsuId)abstract SecurityTokenReferencecreateSecurityTokenReference(Reference ref)abstract SecurityTokenReferencecreateSecurityTokenReference(javax.xml.bind.JAXBElement elem)abstract StatuscreateStatus(String code, String reason)abstract UseKeycreateUseKey(Token token, String sig)abstract ValidateTargetcreateValidateTarget(Token token)static javax.xml.bind.JAXBContextgetContext()static javax.xml.bind.JAXBContextgetContext(WSTrustVersion wstVer)abstract javax.xml.bind.MarshallergetMarshaller()static WSTrustElementFactorynewInstance()static WSTrustElementFactorynewInstance(WSSCVersion wsscVer)static WSTrustElementFactorynewInstance(WSTrustVersion wstVer)static WSTrustElementFactorynewInstance(String nsUri)abstract ElementtoElement(BaseSTSRequest request)abstract ElementtoElement(BaseSTSResponse response)abstract ElementtoElement(BinarySecret binarySecret)Marshal an BinarySecret to a DOM Elementabstract ElementtoElement(BinarySecret binarySecret, Document doc)Marshal an BinarySecret to a DOM Element.abstract ElementtoElement(RequestSecurityToken rst)Marshal an RST to a DOM Element.abstract ElementtoElement(RequestSecurityTokenResponse rstr)Marshal an RSTR to DOM Elementabstract ElementtoElement(RequestSecurityTokenResponseCollection rstrCollection)Marshal an RSTR Collection to a DOM Elementabstract ElementtoElement(RequestSecurityTokenResponse rstr, Document doc)abstract ElementtoElement(SecurityTokenReference str, Document doc)Marshal an STR to a DOM Element.ElementtoElement(Object jaxbEle)abstract javax.xml.bind.JAXBElementtoJAXBElement(BaseSTSRequest request)abstract javax.xml.bind.JAXBElementtoJAXBElement(BaseSTSResponse response)abstract javax.xml.bind.JAXBElementtoJAXBElement(RequestSecurityToken rst)convert an RST to a JAXBElementabstract javax.xml.bind.JAXBElementtoJAXBElement(RequestSecurityTokenResponse rstr)convert an RSTR to a JAXBElementabstract javax.xml.bind.JAXBElementtoJAXBElement(RequestSecurityTokenResponseCollection rstrCollection)convert an RSTR Collection to a JAXBElementabstract javax.xml.bind.JAXBElementtoJAXBElement(SecurityTokenReference str)convert an SecurityTokenReference to a JAXBElementabstract SourcetoSource(BaseSTSRequest request)abstract SourcetoSource(BaseSTSResponse response)abstract SourcetoSource(RequestSecurityToken rst)Marshal an RST to a Source.abstract SourcetoSource(RequestSecurityTokenResponse rstr)Marshal an RSTR to a Sourceabstract SourcetoSource(RequestSecurityTokenResponseCollection rstrCollection)Marshal an RSTR Collection to a Source
-
-
-
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(String nsUri)
-
newInstance
public static WSTrustElementFactory newInstance(WSTrustVersion wstVer)
-
newInstance
public static WSTrustElementFactory newInstance(WSSCVersion wsscVer)
-
createRSTForIssue
public abstract RequestSecurityToken createRSTForIssue(URI tokenType, URI requestType, URI context, 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(URI tokenType, URI context, RequestedSecurityToken token, 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(URI tokenType, URI context, RequestedSecurityToken token, 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(EncryptedKey key)
Create an Entropy with an xenc:EncryptedKey
-
createSecondaryParameters
public abstract SecondaryParameters createSecondaryParameters()
Create SecondaryParameters
-
createBinarySecret
public abstract BinarySecret createBinarySecret(byte[] rawValue, String type)
Create a BinarySecret
-
createBinarySecret
public abstract BinarySecret createBinarySecret(Element elem) throws WSTrustException
Create a BinarySecret- Throws:
WSTrustException
-
createOnBehalfOf
public abstract OnBehalfOf createOnBehalfOf(Token oboToken)
-
createValidateTarget
public abstract ValidateTarget createValidateTarget(Token token)
-
createLifetime
public abstract Lifetime createLifetime(AttributedDateTime created, AttributedDateTime expires)
Create a Lifetime.
-
createRequestedProofToken
public abstract RequestedProofToken createRequestedProofToken()
Create a RequestedProofToken.
-
createRequestedSecurityToken
public abstract RequestedSecurityToken createRequestedSecurityToken(Token token)
Create a RequestedSecurityToken.
-
createRequestedSecurityToken
public abstract RequestedSecurityToken createRequestedSecurityToken()
-
createDirectReference
public abstract DirectReference createDirectReference(String valueType, String uri)
-
createKeyIdentifier
public abstract KeyIdentifier createKeyIdentifier(String valueType, String encodingType)
-
createSecurityTokenReference
public abstract SecurityTokenReference createSecurityTokenReference(Reference ref)
-
createSecurityContextToken
public abstract SecurityContextToken createSecurityContextToken(URI identifier, String instance, String wsuId)
-
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(URI tokenType, URI requestType, URI context, RenewTarget target, AllowPostdating apd, Renewing renewingInfo)
Create an RST for a Renewal Request
-
createRSTRForRenew
public abstract RequestSecurityTokenResponse createRSTRForRenew(URI tokenType, 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(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(URI tokenType, URI requestType)
Create an RST for Token ValidationTODO: 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(URI tokenType, RequestedSecurityToken token, Status status)
create an RSTR for validate request.
-
createRSTRC
public abstract RequestSecurityTokenResponseCollection createRSTRC(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(Source src)
create an RST from a Source
-
createRSTFrom
public abstract RequestSecurityToken createRSTFrom(Element elem)
create an RST from DOM Element
-
createRSTRFrom
public abstract RequestSecurityTokenResponse createRSTRFrom(Source src)
create an RSTR from a Source
-
createRSTRFrom
public abstract RequestSecurityTokenResponse createRSTRFrom(Element elem)
create an RSTR from DOM Element
-
createRSTRCollectionFrom
public abstract RequestSecurityTokenResponseCollection createRSTRCollectionFrom(Source src)
Create RSTR Collection from Source
-
createRSTRCollectionFrom
public abstract RequestSecurityTokenResponseCollection createRSTRCollectionFrom(Element elem)
Create RSTR Collection from Element
-
createClaims
public abstract Claims createClaims(Element elem) throws WSTrustException
- Throws:
WSTrustException
-
createClaims
public abstract Claims createClaims(Claims claims) throws WSTrustException
- Throws:
WSTrustException
-
createClaims
public abstract Claims createClaims() throws WSTrustException
- Throws:
WSTrustException
-
createRSTFrom
public abstract RequestSecurityToken createRSTFrom(javax.xml.bind.JAXBElement elem)
create an RST from JAXBElementNOTE: 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 JAXBElementNOTE: 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 JAXBElementNOTE: 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 Source toSource(BaseSTSRequest request)
-
toSource
public abstract Source toSource(BaseSTSResponse response)
-
toSource
public abstract Source toSource(RequestSecurityToken rst)
Marshal an RST to a Source.Note: Useful for Dispatch Client implementations
-
toSource
public abstract Source toSource(RequestSecurityTokenResponse rstr)
Marshal an RSTR to a SourceNote: Useful for STS implementations which are JAXWS Providers
-
toSource
public abstract Source toSource(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a SourceNote: Useful for STS implementations which are JAXWS Providers
-
toElement
public abstract Element toElement(BaseSTSRequest request)
-
toElement
public abstract Element toElement(BaseSTSResponse response)
-
toElement
public abstract Element toElement(RequestSecurityToken rst)
Marshal an RST to a DOM Element.Note: Useful for Dispatch Client implementations
-
toElement
public abstract Element toElement(RequestSecurityTokenResponse rstr)
Marshal an RSTR to DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
public abstract Element toElement(RequestSecurityTokenResponse rstr, Document doc)
-
toElement
public abstract Element toElement(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
public abstract Element toElement(BinarySecret binarySecret)
Marshal an BinarySecret to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
public abstract Element toElement(SecurityTokenReference str, Document doc)
Marshal an STR to a DOM Element.Note: Useful for Dispatch Client implementations
-
toElement
public abstract Element toElement(BinarySecret binarySecret, Document doc)
Marshal an BinarySecret to a DOM Element.Note: Useful for Dispatch Client implementations
-
getMarshaller
public abstract javax.xml.bind.Marshaller getMarshaller()
-
-