Class WSTrustElementFactory
- Direct Known Subclasses:
WSTrustElementFactoryImpl,WSTrustElementFactoryImpl
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();
- Author:
- Kumar Jayanti
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ActAscreateActAs(Token token) abstract BinarySecretcreateBinarySecret(byte[] rawValue, String type) Create a BinarySecretabstract BinarySecretcreateBinarySecret(Element elem) Create a BinarySecretabstract CancelTargetabstract Claimsabstract ClaimscreateClaims(Claims claims) abstract ClaimscreateClaims(Element elem) abstract DirectReferencecreateDirectReference(String valueType, String uri) abstract EntropyCreate 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 RenewTargetabstract RequestedAttachedReferenceCreate a RequestedAttachedReference.abstract RequestedProofTokenCreate a RequestedProofToken.abstract RequestedSecurityTokenabstract RequestedSecurityTokenCreate a RequestedSecurityToken.abstract RequestedUnattachedReferenceCreate a RequestedUnattachedReference.abstract RequestSecurityTokenCreate 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(jakarta.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 RequestSecurityTokenResponseCreate an Empty RSTRcreateRSTRCollectionForIssue(URI tokenType, URI context, RequestedSecurityToken token, AppliesTo scopes, RequestedAttachedReference attachedRef, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime) Create a collection of RequestSecurityTokenResponse(s)createRSTRCollectionFrom(jakarta.xml.bind.JAXBElement elem) create an RSTR Collection from JAXBElementCreate RSTR Collection from SourceCreate RSTR Collection from Elementabstract RequestSecurityTokenResponseCreate 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(jakarta.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 SecondaryParametersCreate SecondaryParametersabstract SecurityContextTokencreateSecurityContextToken(URI identifier, String instance, String wsuId) abstract SecurityTokenReferenceabstract SecurityTokenReferencecreateSecurityTokenReference(jakarta.xml.bind.JAXBElement elem) abstract StatuscreateStatus(String code, String reason) abstract UseKeycreateUseKey(Token token, String sig) abstract ValidateTargetcreateValidateTarget(Token token) static jakarta.xml.bind.JAXBContextstatic jakarta.xml.bind.JAXBContextgetContext(WSTrustVersion wstVer) abstract jakarta.xml.bind.Marshallerstatic WSTrustElementFactorystatic 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 ElementMarshal an RST to a DOM Element.abstract ElementMarshal 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.abstract jakarta.xml.bind.JAXBElementtoJAXBElement(BaseSTSRequest request) abstract jakarta.xml.bind.JAXBElementtoJAXBElement(BaseSTSResponse response) abstract jakarta.xml.bind.JAXBElementconvert an RST to a JAXBElementabstract jakarta.xml.bind.JAXBElementconvert an RSTR to a JAXBElementabstract jakarta.xml.bind.JAXBElementtoJAXBElement(RequestSecurityTokenResponseCollection rstrCollection) convert an RSTR Collection to a JAXBElementabstract jakarta.xml.bind.JAXBElementconvert an SecurityTokenReference to a JAXBElementabstract SourcetoSource(BaseSTSRequest request) abstract SourcetoSource(BaseSTSResponse response) abstract SourceMarshal an RST to a Source.abstract SourceMarshal an RSTR to a Sourceabstract SourcetoSource(RequestSecurityTokenResponseCollection rstrCollection) Marshal an RSTR Collection to a Source
-
Constructor Details
-
WSTrustElementFactory
protected WSTrustElementFactory()
-
-
Method Details
-
getContext
public static jakarta.xml.bind.JAXBContext getContext() -
getContext
-
newInstance
-
newInstance
-
newInstance
-
newInstance
-
createRSTForIssue
public abstract RequestSecurityToken createRSTForIssue(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 present -
createRSTRForIssue
public abstract RequestSecurityTokenResponse createRSTRForIssue(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 returned -
createRSTRCollectionForIssue
public abstract RequestSecurityTokenResponseCollection createRSTRCollectionForIssue(URI tokenType, URI context, RequestedSecurityToken token, AppliesTo scopes, RequestedAttachedReference attachedRef, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime) Create a collection of RequestSecurityTokenResponse(s) -
createIssuedTokens
public abstract IssuedTokens createIssuedTokens(RequestSecurityTokenResponseCollection issuedTokens) Create a wst:IssuedTokens object -
createEntropy
Create an Entropy with a BinarySecret -
createEntropy
Create an Entropy with an xenc:EncryptedKey -
createSecondaryParameters
Create SecondaryParameters -
createBinarySecret
Create a BinarySecret -
createBinarySecret
Create a BinarySecret- Throws:
WSTrustException
-
createUseKey
-
createOnBehalfOf
-
createActAs
-
createValidateTarget
-
createStatus
-
createLifetime
Create a Lifetime. -
createRequestedProofToken
Create a RequestedProofToken. -
createRequestedSecurityToken
Create a RequestedSecurityToken. -
createRequestedSecurityToken
-
createDirectReference
-
createKeyIdentifier
-
createSecurityTokenReference
-
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) Create an RSTR for a Renewal Response -
createRenewTarget
-
createCancelTarget
-
createRSTForCancel
Create an RST for Token Cancellation -
createRSTRForCancel
Create an RSTR for a Successful Token Cancellation -
createRSTForValidate
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
Create an Empty RST -
createRSTR
Create an Empty RSTR -
createRSTFrom
create an RST from a Source -
createRSTFrom
create an RST from DOM Element -
createRSTRFrom
create an RSTR from a Source -
createRSTRFrom
create an RSTR from DOM Element -
createRSTRCollectionFrom
Create RSTR Collection from Source -
createRSTRCollectionFrom
Create RSTR Collection from Element -
createClaims
- Throws:
WSTrustException
-
createClaims
-
createClaims
-
createRSTFrom
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
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(jakarta.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(jakarta.xml.bind.JAXBElement elem) -
toJAXBElement
-
toJAXBElement
-
toJAXBElement
convert an SecurityTokenReference to a JAXBElement -
toJAXBElement
convert an RST to a JAXBElement -
toJAXBElement
convert an RSTR to a JAXBElement -
toJAXBElement
public abstract jakarta.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponseCollection rstrCollection) convert an RSTR Collection to a JAXBElement -
toSource
-
toSource
-
toSource
Marshal an RST to a Source.Note: Useful for Dispatch Client implementations
-
toSource
Marshal an RSTR to a SourceNote: Useful for STS implementations which are JAXWS Providers
-
toSource
Marshal an RSTR Collection to a SourceNote: Useful for STS implementations which are JAXWS Providers
-
toElement
-
toElement
-
toElement
Marshal an RST to a DOM Element.Note: Useful for Dispatch Client implementations
-
toElement
Marshal an RSTR to DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
-
toElement
Marshal an RSTR Collection to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
Marshal an BinarySecret to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
-
toElement
Marshal an STR to a DOM Element.Note: Useful for Dispatch Client implementations
-
toElement
Marshal an BinarySecret to a DOM Element.Note: Useful for Dispatch Client implementations
-
toElement
-
getMarshaller
public abstract jakarta.xml.bind.Marshaller getMarshaller()
-