Class WSTrustElementFactoryImpl
- java.lang.Object
-
- com.sun.xml.ws.security.trust.WSTrustElementFactory
-
- com.sun.xml.ws.security.trust.impl.WSTrustElementFactoryImpl
-
- Direct Known Subclasses:
WSSCElementFactory
public class WSTrustElementFactoryImpl extends WSTrustElementFactory
A Factory for creating the WS-Trust schema elements, and marshalling/un-marshalling them.- Author:
- Manveen Kaur
-
-
Constructor Summary
Constructors Constructor Description WSTrustElementFactoryImpl()
-
Method Summary
-
Methods inherited from class com.sun.xml.ws.security.trust.WSTrustElementFactory
getContext, getContext, newInstance, newInstance, newInstance, newInstance, toElement
-
-
-
-
Method Detail
-
createRSTForIssue
public 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- Specified by:
createRSTForIssuein classWSTrustElementFactory- Throws:
WSTrustException
-
createRSTRForIssue
public RequestSecurityTokenResponse createRSTRForIssue(URI tokenType, URI context, RequestedSecurityToken token, AppliesTo scopes, RequestedAttachedReference attachedReference, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime) throws WSTrustException
Create an RSTR for Issue from the given arguments. TokenType should be Issue. Any of the arguments can be null since they are all optional, but one of RequestedSecurityToken or RequestedProofToken should be returned- Specified by:
createRSTRForIssuein classWSTrustElementFactory- Throws:
WSTrustException
-
createRSTRCollectionForIssue
public RequestSecurityTokenResponseCollection createRSTRCollectionForIssue(URI tokenType, URI context, RequestedSecurityToken token, AppliesTo scopes, RequestedAttachedReference attached, RequestedUnattachedReference unattached, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime) throws WSTrustException
Create a collection of RequestSecurityTokenResponse(s)- Specified by:
createRSTRCollectionForIssuein classWSTrustElementFactory- Throws:
WSTrustException
-
createRSTRForRenew
public RequestSecurityTokenResponse createRSTRForRenew(URI tokenType, URI context, RequestedSecurityToken token, RequestedAttachedReference attachedReference, RequestedUnattachedReference unattachedRef, RequestedProofToken proofToken, Entropy entropy, Lifetime lifetime) throws WSTrustException
Create an RSTR for Renew from the given arguments. TokenType should be Issue. Any of the arguments can be null since they are all optional, but one of RequestedSecurityToken or RequestedProofToken should be returned- Specified by:
createRSTRForRenewin classWSTrustElementFactory- Throws:
WSTrustException
-
createIssuedTokens
public IssuedTokens createIssuedTokens(RequestSecurityTokenResponseCollection issuedTokens)
Create a wst:IssuedTokens object- Specified by:
createIssuedTokensin classWSTrustElementFactory
-
createOnBehalfOf
public OnBehalfOf createOnBehalfOf(Token oboToken)
- Specified by:
createOnBehalfOfin classWSTrustElementFactory
-
createValidateTarget
public ValidateTarget createValidateTarget(Token token)
- Specified by:
createValidateTargetin classWSTrustElementFactory
-
createActAs
public ActAs createActAs(Token token)
- Specified by:
createActAsin classWSTrustElementFactory
-
createEntropy
public Entropy createEntropy(BinarySecret secret)
Create an Entropy with a BinarySecret- Specified by:
createEntropyin classWSTrustElementFactory
-
createEntropy
public Entropy createEntropy(EncryptedKey key)
Create an Entropy with an xenc:EncryptedKey- Specified by:
createEntropyin classWSTrustElementFactory
-
createBinarySecret
public BinarySecret createBinarySecret(byte[] rawValue, String type)
Description copied from class:WSTrustElementFactoryCreate a BinarySecret- Specified by:
createBinarySecretin classWSTrustElementFactory
-
createBinarySecret
public BinarySecret createBinarySecret(Element elem) throws WSTrustException
Description copied from class:WSTrustElementFactoryCreate a BinarySecret- Specified by:
createBinarySecretin classWSTrustElementFactory- Throws:
WSTrustException
-
createLifetime
public Lifetime createLifetime(AttributedDateTime created, AttributedDateTime expires)
Create a Lifetime.- Specified by:
createLifetimein classWSTrustElementFactory
-
createClaims
public Claims createClaims(Element elem) throws WSTrustException
- Specified by:
createClaimsin classWSTrustElementFactory- Throws:
WSTrustException
-
createClaims
public Claims createClaims(Claims claims) throws WSTrustException
- Specified by:
createClaimsin classWSTrustElementFactory- Throws:
WSTrustException
-
createClaims
public Claims createClaims() throws WSTrustException
- Specified by:
createClaimsin classWSTrustElementFactory- Throws:
WSTrustException
-
createStatus
public Status createStatus(String code, String reason)
- Specified by:
createStatusin classWSTrustElementFactory
-
createRequestedSecurityToken
public RequestedSecurityToken createRequestedSecurityToken(Token token)
Create a RequestedSecurityToken.- Specified by:
createRequestedSecurityTokenin classWSTrustElementFactory
-
createRequestedSecurityToken
public RequestedSecurityToken createRequestedSecurityToken()
Create a RequestedSecurityToken.- Specified by:
createRequestedSecurityTokenin classWSTrustElementFactory
-
createDirectReference
public DirectReference createDirectReference(String valueType, String uri)
- Specified by:
createDirectReferencein classWSTrustElementFactory
-
createDirectReference
public DirectReference createDirectReference(String valueType, String uri, String instanceId)
-
createKeyIdentifier
public KeyIdentifier createKeyIdentifier(String valueType, String encodingType)
- Specified by:
createKeyIdentifierin classWSTrustElementFactory
-
createSecurityTokenReference
public SecurityTokenReference createSecurityTokenReference(Reference ref)
- Specified by:
createSecurityTokenReferencein classWSTrustElementFactory
-
createRequestedAttachedReference
public RequestedAttachedReference createRequestedAttachedReference(SecurityTokenReference str)
Create a RequestedAttachedReference.- Specified by:
createRequestedAttachedReferencein classWSTrustElementFactory
-
createRequestedUnattachedReference
public RequestedUnattachedReference createRequestedUnattachedReference(SecurityTokenReference str)
Create a RequestedUnattachedReference.- Specified by:
createRequestedUnattachedReferencein classWSTrustElementFactory
-
createRequestedProofToken
public RequestedProofToken createRequestedProofToken()
Create a RequestedProofToken.- Specified by:
createRequestedProofTokenin classWSTrustElementFactory
-
createSecondaryParameters
public SecondaryParameters createSecondaryParameters()
Create SecondaryParameters- Specified by:
createSecondaryParametersin classWSTrustElementFactory
-
createUseKey
public UseKey createUseKey(Token token, String sig)
- Specified by:
createUseKeyin classWSTrustElementFactory
-
createRSTForRenew
public RequestSecurityToken createRSTForRenew(URI tokenType, URI requestType, URI context, RenewTarget target, AllowPostdating apd, Renewing renewingInfo)
Create an RST for a Renewal Request- Specified by:
createRSTForRenewin classWSTrustElementFactory
-
createRenewTarget
public RenewTarget createRenewTarget(SecurityTokenReference str)
- Specified by:
createRenewTargetin classWSTrustElementFactory
-
createCancelTarget
public CancelTarget createCancelTarget(SecurityTokenReference str)
- Specified by:
createCancelTargetin classWSTrustElementFactory
-
createRSTForCancel
public RequestSecurityToken createRSTForCancel(URI requestType, CancelTarget target)
Create an RST for Token Cancellation- Specified by:
createRSTForCancelin classWSTrustElementFactory
-
createRSTRForCancel
public RequestSecurityTokenResponse createRSTRForCancel()
Create an RSTR for a Successful Token Cancellation- Specified by:
createRSTRForCancelin classWSTrustElementFactory
-
createRSTForValidate
public 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.
- Specified by:
createRSTForValidatein classWSTrustElementFactory
-
createRSTRForValidate
public RequestSecurityTokenResponse createRSTRForValidate(URI tokenType, RequestedSecurityToken token, Status status)
create an RSTR for validate request.- Specified by:
createRSTRForValidatein classWSTrustElementFactory
-
createRST
public RequestSecurityToken createRST()
Create an Empty RST- Specified by:
createRSTin classWSTrustElementFactory
-
createRSTR
public RequestSecurityTokenResponse createRSTR()
Create an Empty RSTR- Specified by:
createRSTRin classWSTrustElementFactory
-
createRSTRC
public RequestSecurityTokenResponseCollection createRSTRC(List<RequestSecurityTokenResponse> rstrs)
- Specified by:
createRSTRCin classWSTrustElementFactory
-
createRSTFrom
public RequestSecurityToken createRSTFrom(Source src)
create an RST from a Source- Specified by:
createRSTFromin classWSTrustElementFactory
-
createRSTFrom
public RequestSecurityToken createRSTFrom(Element elem)
create an RST from DOM Element- Specified by:
createRSTFromin classWSTrustElementFactory
-
createRSTRFrom
public RequestSecurityTokenResponse createRSTRFrom(Source src)
create an RSTR from a Source- Specified by:
createRSTRFromin classWSTrustElementFactory
-
createRSTRFrom
public RequestSecurityTokenResponse createRSTRFrom(Element elem)
create an RSTR from DOM Element- Specified by:
createRSTRFromin classWSTrustElementFactory
-
createRSTRCollectionFrom
public RequestSecurityTokenResponseCollection createRSTRCollectionFrom(Source src)
Create RSTR Collection from Source- Specified by:
createRSTRCollectionFromin classWSTrustElementFactory
-
createRSTRCollectionFrom
public RequestSecurityTokenResponseCollection createRSTRCollectionFrom(Element elem)
Create RSTR Collection from Element- Specified by:
createRSTRCollectionFromin classWSTrustElementFactory
-
createRSTFrom
public 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.- Specified by:
createRSTFromin classWSTrustElementFactory
-
createRSTRFrom
public 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.- Specified by:
createRSTRFromin classWSTrustElementFactory
-
createRSTRCollectionFrom
public 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.- Specified by:
createRSTRCollectionFromin classWSTrustElementFactory
-
createSecurityTokenReference
public SecurityTokenReference createSecurityTokenReference(javax.xml.bind.JAXBElement elem)
- Specified by:
createSecurityTokenReferencein classWSTrustElementFactory
-
createSecurityContextToken
public SecurityContextToken createSecurityContextToken(URI identifier, String instance, String wsuId)
- Specified by:
createSecurityContextTokenin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(BaseSTSRequest request)
- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(BaseSTSResponse response)
- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(SecurityTokenReference str)
convert an SecurityTokenReference to a JAXBElement- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityToken rst)
convert an RST to a JAXBElement- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponse rstr)
convert an RSTR to a JAXBElement- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(Entropy entropy)
convert a Entropy to a JAXBElement
-
toJAXBElement
public javax.xml.bind.JAXBElement toJAXBElement(RequestSecurityTokenResponseCollection rstrCollection)
convert an RSTR Collection to a JAXBElement- Specified by:
toJAXBElementin classWSTrustElementFactory
-
toSource
public Source toSource(BaseSTSRequest request)
- Specified by:
toSourcein classWSTrustElementFactory
-
toSource
public Source toSource(BaseSTSResponse response)
- Specified by:
toSourcein classWSTrustElementFactory
-
toSource
public Source toSource(RequestSecurityToken rst)
Marshal an RST to a Source.Note: Useful for Dispatch Client implementations
- Specified by:
toSourcein classWSTrustElementFactory
-
toSource
public Source toSource(RequestSecurityTokenResponse rstr)
Marshal an RSTR to a SourceNote: Useful for STS implementations which are JAXWS Providers
- Specified by:
toSourcein classWSTrustElementFactory
-
toSource
public Source toSource(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a SourceNote: Useful for STS implementations which are JAXWS Providers
- Specified by:
toSourcein classWSTrustElementFactory
-
toElement
public Element toElement(BaseSTSRequest request)
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(BaseSTSResponse response)
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(RequestSecurityToken rst)
Marshal an RST to a DOM Element.Note: Useful for Dispatch Client implementations
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(RequestSecurityTokenResponse rstr)
Marshal an RSTR to DOM ElementNote: Useful for STS implementations which are JAXWS Providers
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(RequestSecurityTokenResponse rstr, Document doc)
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(RequestSecurityTokenResponseCollection rstrCollection)
Marshal an RSTR Collection to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(BinarySecret secret)
Description copied from class:WSTrustElementFactoryMarshal an BinarySecret to a DOM ElementNote: Useful for STS implementations which are JAXWS Providers
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(SecurityTokenReference str, Document doc)
Marshal an STR to a DOM Element.Note: Useful for Dispatch Client implementations
- Specified by:
toElementin classWSTrustElementFactory
-
toElement
public Element toElement(BinarySecret secret, Document doc)
Marshal an BinarySecret to a DOM Element.Note: Useful for Dispatch Client implementations
- Specified by:
toElementin classWSTrustElementFactory
-
getMarshaller
public javax.xml.bind.Marshaller getMarshaller()
- Specified by:
getMarshallerin classWSTrustElementFactory
-
-