Package com.sun.xml.ws.security.impl
Class IssuedTokenContextImpl
java.lang.Object
com.sun.xml.ws.security.impl.IssuedTokenContextImpl
- All Implemented Interfaces:
IssuedTokenContext
- Author:
- Abhijit Das
-
Field Summary
Fields inherited from interface com.sun.xml.ws.security.IssuedTokenContext
AUTHN_CONTEXT, CLAIMED_ATTRUBUTES, CONFIRMATION_KEY_INFO, CONFIRMATION_METHOD, KEY_WRAP_ALGORITHM, STATUS, STS_CERTIFICATE, STS_PRIVATE_KEY, TARGET_SERVICE_CERTIFICATE, WS_TRUST_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy the IssuedTokenContext.get the Proof Token (if any) associated with the SecurityToken, null otherwiseIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example.Return the <wst:ComputedKey> URI if any inside the RSTR, null otherwise.getDecipheredOtherPartyEntropy(Key privKey) Get the Entropy if any provided by the other party, null otherwise If the Entropy was specified as an <xenc:EncryptedKey> then this method would return the decrypted secretget the endpoint addressget the Expiration Time for this Token if anyGet the Entropy if any provided by the Other Party, null otherwisebyte[]get the SecureConversation ProofToken as a byte[] arrayRequestor Certificate(s)Requestor username if anyGet the SecurityContextTokenInfo for this Token if any.get the SecurityPolicy to be applied for the request or response to which this SecurityContext corresponds to This allows the Client and/or the Service (WSP/STS) to dynamically inject policy to be applied.Depending on the <sp:IncludeToken> policy get the Token to be used in Securing requests and/or responses.Get self Entropy if set, null otherwiseIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedUnAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example.voidsetAppliesTo(String appliesTo) voidsetAssociatedProofToken(Token associatedProofToken) Set the Proof Token Associated with the SecurityTokenvoidsetAttachedSecurityTokenReference(Token secTokenReference) If the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedAttachedReference> which needs to be inserted into a <ds:KeyInfo> for examplevoidsetAuthnContextClass(String authType) voidsetCanonicalizationAlgorithm(String canonAlg) voidsetComputedKeyAlgorithmFromProofToken(URI computedKeyAlgorithm) voidsetCreationTime(Date date) set the creation Time of the IssuedTokenvoidsetEncryptionAlgorithm(String encAlg) voidsetEncryptWith(String encryptWithAlgo) voidsetEndpointAddress(String endPointAddress) set the endpointaddressvoidsetExpirationTime(Date date) set the Expiration Time for this Token if any.voidsetKeyType(String keyType) voidsetOtherPartyEntropy(Object otherPartyEntropy) Set the Entropy information provided by the other Part (if any)voidsetProofKey(byte[] key) set the SecureConversation ProofToken as a byte[] arrayvoidsetProofKeyPair(KeyPair keys) voidAppend the Requestor Certificate that was used in an incoming message.voidsetRequestorSubject(Subject subject) voidsetRequestorUsername(String username) set requestor usernamevoidset the SecurityContextTokenInfo for this Token if any.voidsetSecurityToken(Token securityToken) Depending on the <sp:IncludeToken> server policy, set the Token to be used in Securing requests and/or responsesvoidsetSelfEntropy(Object selfEntropy) Set self EntropyvoidsetSignatureAlgorithm(String sigAlg) voidsetSignWith(String signWithAlgo) voidvoidsetTokenIssuer(String issuer) voidsetTokenType(String tokenType) voidsetUnAttachedSecurityTokenReference(Token secTokenReference) If the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedUnAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example
-
Constructor Details
-
IssuedTokenContextImpl
public IssuedTokenContextImpl()
-
-
Method Details
-
getRequestorCertificate
Description copied from interface:IssuedTokenContextRequestor Certificate(s)- Specified by:
getRequestorCertificatein interfaceIssuedTokenContext- Returns:
- the sender certificate, null otherwise
-
setRequestorCertificate
Description copied from interface:IssuedTokenContextAppend the Requestor Certificate that was used in an incoming message.- Specified by:
setRequestorCertificatein interfaceIssuedTokenContext
-
getRequestorSubject
- Specified by:
getRequestorSubjectin interfaceIssuedTokenContext
-
setRequestorSubject
- Specified by:
setRequestorSubjectin interfaceIssuedTokenContext
-
getRequestorUsername
Description copied from interface:IssuedTokenContextRequestor username if any- Specified by:
getRequestorUsernamein interfaceIssuedTokenContext- Returns:
- the requestor username if provided
-
setRequestorUsername
Description copied from interface:IssuedTokenContextset requestor username- Specified by:
setRequestorUsernamein interfaceIssuedTokenContext
-
setSecurityToken
Description copied from interface:IssuedTokenContextDepending on the <sp:IncludeToken> server policy, set the Token to be used in Securing requests and/or responses- Specified by:
setSecurityTokenin interfaceIssuedTokenContext
-
getSecurityToken
Description copied from interface:IssuedTokenContextDepending on the <sp:IncludeToken> policy get the Token to be used in Securing requests and/or responses. The token returned is to be used only for inserting into the SecurityHeader, if the getAssociatedProofToken is not null, and it should also be used for securing the message if there is no Proof Token associated.- Specified by:
getSecurityTokenin interfaceIssuedTokenContext
-
setAssociatedProofToken
Description copied from interface:IssuedTokenContextSet the Proof Token Associated with the SecurityTokenwhen the SecurityToken is a SecurityContext token (as defined in WS-SecureConversation) and Derived Keys are being used then the Proof Token is the
<wsc:DerivedKeyToken>- Specified by:
setAssociatedProofTokenin interfaceIssuedTokenContext
-
getAssociatedProofToken
Description copied from interface:IssuedTokenContextget the Proof Token (if any) associated with the SecurityToken, null otherwise- Specified by:
getAssociatedProofTokenin interfaceIssuedTokenContext
-
getAttachedSecurityTokenReference
Description copied from interface:IssuedTokenContextIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example.- Specified by:
getAttachedSecurityTokenReferencein interfaceIssuedTokenContext- Returns:
- STR if set, null otherwise
-
setAttachedSecurityTokenReference
Description copied from interface:IssuedTokenContextIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example- Specified by:
setAttachedSecurityTokenReferencein interfaceIssuedTokenContext
-
getUnAttachedSecurityTokenReference
Description copied from interface:IssuedTokenContextIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedUnAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example.- Specified by:
getUnAttachedSecurityTokenReferencein interfaceIssuedTokenContext- Returns:
- STR if set, null otherwise
-
setUnAttachedSecurityTokenReference
Description copied from interface:IssuedTokenContextIf the token returned doesnt allow use of wsu:id attribute then a STR is returned as <wst:RequestedUnAttachedReference> which needs to be inserted into a <ds:KeyInfo> for example- Specified by:
setUnAttachedSecurityTokenReferencein interfaceIssuedTokenContext
-
getSecurityPolicy
Description copied from interface:IssuedTokenContextget the SecurityPolicy to be applied for the request or response to which this SecurityContext corresponds to This allows the Client and/or the Service (WSP/STS) to dynamically inject policy to be applied. For example in the case of SignChallenge when the Initiator (client) has to sign a specific challenge.Note: Inserting an un-solicited RSTR into a SOAP Header can also be expressed as a policy and the subsequent requirement to sign the RSTR will also be expressed as a policy
TODO: There is no policy today to insert a specific element to a SOAP Header, we need to extend the policy definitions in XWS-Security.- Specified by:
getSecurityPolicyin interfaceIssuedTokenContext
-
setOtherPartyEntropy
Description copied from interface:IssuedTokenContextSet the Entropy information provided by the other Part (if any)WS-Trust allows requestor to provide input to key material in the request. The requestor might do this to satisfy itself as to the degree of entropy(cyrptographic randomness) of atleast some of the material used to generate the actual Key.
For composite Keys Entropy can be set by both parties, the concrete entropy element can be a<wst:Entropy>instance but the argument here is generic to avoid a dependence of the SPI on WS-Trust packages- Specified by:
setOtherPartyEntropyin interfaceIssuedTokenContext
-
getOtherPartyEntropy
Description copied from interface:IssuedTokenContextGet the Entropy if any provided by the Other Party, null otherwise- Specified by:
getOtherPartyEntropyin interfaceIssuedTokenContext
-
getDecipheredOtherPartyEntropy
Description copied from interface:IssuedTokenContextGet the Entropy if any provided by the other party, null otherwise If the Entropy was specified as an <xenc:EncryptedKey> then this method would return the decrypted secret- Specified by:
getDecipheredOtherPartyEntropyin interfaceIssuedTokenContext- Throws:
XWSSecurityException
-
setSelfEntropy
Description copied from interface:IssuedTokenContextSet self Entropy- Specified by:
setSelfEntropyin interfaceIssuedTokenContext
-
getSelfEntropy
Description copied from interface:IssuedTokenContextGet self Entropy if set, null otherwise- Specified by:
getSelfEntropyin interfaceIssuedTokenContext
-
getComputedKeyAlgorithmFromProofToken
Description copied from interface:IssuedTokenContextReturn the <wst:ComputedKey> URI if any inside the RSTR, null otherwise. The Security Enforcement Layer would compute the Key as P_SHA1(Ent(req), Ent(res))- Specified by:
getComputedKeyAlgorithmFromProofTokenin interfaceIssuedTokenContext
-
setComputedKeyAlgorithmFromProofToken
-
setProofKey
public void setProofKey(byte[] key) Description copied from interface:IssuedTokenContextset the SecureConversation ProofToken as a byte[] array- Specified by:
setProofKeyin interfaceIssuedTokenContext
-
getProofKey
public byte[] getProofKey()Description copied from interface:IssuedTokenContextget the SecureConversation ProofToken as a byte[] array- Specified by:
getProofKeyin interfaceIssuedTokenContext
-
setProofKeyPair
- Specified by:
setProofKeyPairin interfaceIssuedTokenContext
-
getProofKeyPair
- Specified by:
getProofKeyPairin interfaceIssuedTokenContext
-
setAuthnContextClass
- Specified by:
setAuthnContextClassin interfaceIssuedTokenContext
-
getAuthnContextClass
- Specified by:
getAuthnContextClassin interfaceIssuedTokenContext
-
getCreationTime
- Specified by:
getCreationTimein interfaceIssuedTokenContext- Returns:
- the creation Time of the IssuedToken
-
getExpirationTime
Description copied from interface:IssuedTokenContextget the Expiration Time for this Token if any- Specified by:
getExpirationTimein interfaceIssuedTokenContext
-
setCreationTime
Description copied from interface:IssuedTokenContextset the creation Time of the IssuedToken- Specified by:
setCreationTimein interfaceIssuedTokenContext
-
setExpirationTime
Description copied from interface:IssuedTokenContextset the Expiration Time for this Token if any.- Specified by:
setExpirationTimein interfaceIssuedTokenContext
-
setEndpointAddress
set the endpointaddress- Specified by:
setEndpointAddressin interfaceIssuedTokenContext
-
getEndpointAddress
get the endpoint address- Specified by:
getEndpointAddressin interfaceIssuedTokenContext
-
destroy
public void destroy()Description copied from interface:IssuedTokenContextDestroy the IssuedTokenContext.- Specified by:
destroyin interfaceIssuedTokenContext
-
getSecurityContextTokenInfo
Description copied from interface:IssuedTokenContextGet the SecurityContextTokenInfo for this Token if any.- Specified by:
getSecurityContextTokenInfoin interfaceIssuedTokenContext
-
setSecurityContextTokenInfo
Description copied from interface:IssuedTokenContextset the SecurityContextTokenInfo for this Token if any.- Specified by:
setSecurityContextTokenInfoin interfaceIssuedTokenContext
-
getOtherProperties
- Specified by:
getOtherPropertiesin interfaceIssuedTokenContext
-
setTokenType
- Specified by:
setTokenTypein interfaceIssuedTokenContext
-
getTokenType
- Specified by:
getTokenTypein interfaceIssuedTokenContext
-
setKeyType
- Specified by:
setKeyTypein interfaceIssuedTokenContext
-
getKeyType
- Specified by:
getKeyTypein interfaceIssuedTokenContext
-
setAppliesTo
- Specified by:
setAppliesToin interfaceIssuedTokenContext
-
getAppliesTo
- Specified by:
getAppliesToin interfaceIssuedTokenContext
-
setTokenIssuer
- Specified by:
setTokenIssuerin interfaceIssuedTokenContext
-
getTokenIssuer
- Specified by:
getTokenIssuerin interfaceIssuedTokenContext
-
setSignatureAlgorithm
- Specified by:
setSignatureAlgorithmin interfaceIssuedTokenContext- Parameters:
sigAlg- : signature algorithm to use to sign IssuedToken
-
getSignatureAlgorithm
- Specified by:
getSignatureAlgorithmin interfaceIssuedTokenContext- Returns:
- The signature algorithm to use to sign IssuedToken
-
setEncryptionAlgorithm
- Specified by:
setEncryptionAlgorithmin interfaceIssuedTokenContext- Parameters:
encAlg- : The encryption algorithm to use to encrypt IssuedToken
-
getEncryptionAlgorithm
- Specified by:
getEncryptionAlgorithmin interfaceIssuedTokenContext- Returns:
- The encryption algorithm to use to encrypt IssuedToken
-
setCanonicalizationAlgorithm
- Specified by:
setCanonicalizationAlgorithmin interfaceIssuedTokenContext- Parameters:
canonAlg- : The canonicalization algorithm to use when signing IssuedToken
-
getCanonicalizationAlgorithm
- Specified by:
getCanonicalizationAlgorithmin interfaceIssuedTokenContext- Returns:
- The canonicalization algorithm to use when signing IssuedToken
-
setSignWith
- Specified by:
setSignWithin interfaceIssuedTokenContext- Parameters:
signWithAlgo- : The signature algorithm the client intends to use when using ProofKey to sign the application message
-
getSignWith
- Specified by:
getSignWithin interfaceIssuedTokenContext- Returns:
- The signature algorithm the client intends to use when using ProofKey to sign the application message
-
setEncryptWith
- Specified by:
setEncryptWithin interfaceIssuedTokenContext- Parameters:
encryptWithAlgo- The encryption algorithm the client intends to use when using ProofKey to encrypt the application message
-
getEncryptWith
- Specified by:
getEncryptWithin interfaceIssuedTokenContext- Returns:
- The encryption algorithm the client intends to use when using ProofKey to encrypt the application message
-
setTarget
- Specified by:
setTargetin interfaceIssuedTokenContext
-
getTarget
- Specified by:
getTargetin interfaceIssuedTokenContext
-