public class RequestSecurityToken extends Object implements BaseRequestSecurityToken
This class represents a WS-Trust RequestSecurityToken
. It wraps the JAXB representation of the security
token
request
and offers a series of getter/setter methods that make it easy to work with elements that are represented by the
Any
XML type.
The following shows the intended content model of a RequestSecurityToken
:
<xs:element ref='wst:TokenType' minOccurs='0' /> <xs:element ref='wst:RequestType' /> <xs:element ref='wsp:AppliesTo' minOccurs='0' /> <xs:element ref='wst:Claims' minOccurs='0' /> <xs:element ref='wst:Entropy' minOccurs='0' /> <xs:element ref='wst:Lifetime' minOccurs='0' /> <xs:element ref='wst:AllowPostdating' minOccurs='0' /> <xs:element ref='wst:Renewing' minOccurs='0' /> <xs:element ref='wst:OnBehalfOf' minOccurs='0' /> <xs:element ref='wst:Issuer' minOccurs='0' /> <xs:element ref='wst:AuthenticationType' minOccurs='0' /> <xs:element ref='wst:KeyType' minOccurs='0' /> <xs:element ref='wst:KeySize' minOccurs='0' /> <xs:element ref='wst:SignatureAlgorithm' minOccurs='0' /> <xs:element ref='wst:Encryption' minOccurs='0' /> <xs:element ref='wst:EncryptionAlgorithm' minOccurs='0' /> <xs:element ref='wst:CanonicalizationAlgorithm' minOccurs='0' /> <xs:element ref='wst:ProofEncryption' minOccurs='0' /> <xs:element ref='wst:UseKey' minOccurs='0' /> <xs:element ref='wst:SignWith' minOccurs='0' /> <xs:element ref='wst:EncryptWith' minOccurs='0' /> <xs:element ref='wst:DelegateTo' minOccurs='0' /> <xs:element ref='wst:Forwardable' minOccurs='0' /> <xs:element ref='wst:Delegatable' minOccurs='0' /> <xs:element ref='wsp:Policy' minOccurs='0' /> <xs:element ref='wsp:PolicyReference' minOccurs='0' /> <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' />
Constructor and Description |
---|
RequestSecurityToken()
Creates an instance of
RequestSecurityToken . |
RequestSecurityToken(RequestSecurityTokenType delegate)
Creates an instance of
RequestSecurityToken using the specified delegate. |
RequestSecurityToken(RequestSecurityTokenType delegate,
Document rstDocument)
Creates an instance of
RequestSecurityTokenType and Document |
Modifier and Type | Method and Description |
---|---|
void |
addExtensionElement(Object element) |
AllowPostdatingType |
getAllowPostDating()
Checks whether a request for a postdated token should be allowed or not.
|
List<Object> |
getAny()
Gets a reference to the list that holds all request element values.
|
AppliesTo |
getAppliesTo()
Obtains the
AppliesTo value of this request. |
URI |
getAuthenticationType()
Obtains the type of authentication that has been set as part of the request.
|
Node |
getBinaryToken()
Get the Binary Token from the SOAP Header
|
URI |
getBinaryValueType()
Get the Binary Value Type
|
CancelTargetType |
getCancelTarget()
Obtains the
CancelTarget section of the request. |
Element |
getCancelTargetElement()
Returns the element in the document that represents the cancel target type.
|
URI |
getCanonicalizationAlgorithm()
Obtains the canonicalization algorithm that has been set in the request.
|
ClaimsType |
getClaims()
Obtains the set of claims of this request.
|
URI |
getComputedKeyAlgorithm()
Get the ComputedKeyAlgorithm
|
String |
getContext()
Obtains the request context.
|
RequestSecurityTokenType |
getDelegate()
Obtains a reference to the
RequestSecurityTokenType delegate. |
DelegateToType |
getDelegateTo()
Obtains the identity to which the requested token should be delegated.
|
EncryptionType |
getEncryption()
Obtains the
Encryption section of the request. |
URI |
getEncryptionAlgorithm()
Obtains the encryption algorithm that has been set in the request.
|
URI |
getEncryptWith()
Obtains the encryption algorithm that should be used with the issued security token.
|
EntropyType |
getEntropy()
Obtains the entropy that will be used in creating the key.
|
List<Object> |
getExtensionElements()
Obtains the list of request elements that are not part of the standard content model.
|
EndpointReferenceType |
getIssuer()
Obtains the issuer of the token included in the request in the scenarios where the requestor is obtaining a token on
behalf of another party.
|
long |
getKeySize()
Obtains the size of they key that has been set in the request.
|
URI |
getKeyType()
Obtains the type of the key that has been set in the request.
|
URI |
getKeyWrapAlgorithm()
Obtains the key wrap algorithm that has been set in the request.
|
Lifetime |
getLifetime()
Obtains the desired lifetime of the requested token.
|
OnBehalfOfType |
getOnBehalfOf()
Obtains the identity on whose behalf this request was made.
|
Map<QName,String> |
getOtherAttributes()
Obtains a map that contains attributes that aren't bound to any typed property on the request.
|
Policy |
getPolicy()
Obtains the
Policy associated with the request. |
PolicyReference |
getPolicyReference()
Obtains the reference to the
Policy that should be used. |
ProofEncryptionType |
getProofEncryption()
Obtains the
ProofEncryption section of the request. |
RenewingType |
getRenewing()
Obtains the renew semantics for this request.
|
RenewTargetType |
getRenewTarget()
Obtains the
RenewTarget section of the request. |
Element |
getRenewTargetElement()
Returns the element in the document that represents the renew target type.
|
URI |
getRequestType()
Obtains the request type.
|
Document |
getRSTDocument()
Get the
Document document representing the request |
URI |
getSignatureAlgorithm()
Obtains the signature algorithm that has been set in the request.
|
URI |
getSignWith()
Obtains the signature algorithm that should be used with the issued security token.
|
URI |
getTokenType()
Obtains the
URI that identifies the token type. |
UseKeyType |
getUseKey()
Obtains the key that should be used in the returned token.
|
ValidateTargetType |
getValidateTarget()
Obtains the
ValidateTarget section of the request. |
Element |
getValidateTargetElement()
Return the element in the document that represents the validate type
|
boolean |
isDelegatable()
Indicates whether the requested token should be marked as "delegatable" or not.
|
boolean |
isForwardable()
Indicates whether the requested token should be marked as "forwardable" or not.
|
void |
setAllowPostDating(AllowPostdatingType allowPostDating)
Specifies whether a request for a postdated token should be allowed or not.
|
void |
setAppliesTo(AppliesTo appliesTo)
Sets the
AppliesTo value of this request. |
void |
setAuthenticationType(URI authenticationType)
Sets the authentication type in the request.
|
void |
setBinaryToken(Node binaryToken) |
void |
setBinaryValueType(URI binaryValueType) |
void |
setCancelTarget(CancelTargetType cancelTarget)
Sets the
CancelTarget section of the request. |
void |
setCanonicalizationAlgorithm(URI canonicalizationAlgorithm)
Sets the canonicalization algorithm in the request.
|
void |
setClaims(ClaimsType claims)
Sets the claims of this request.
|
void |
setComputedKeyAlgorithm(URI computedKeyAlgorithm)
Set the Computed Key Algorithm
|
void |
setContext(String context)
Sets the request context.
|
void |
setDelegatable(boolean delegatable)
Specifies whether the requested token should be marked as "delegatable" or not.
|
void |
setDelegateTo(DelegateToType delegateTo)
Sets the identity to which the requested token should be delegated.
|
void |
setEncryption(EncryptionType encryption)
Sets the
Encryption section of the request. |
void |
setEncryptionAlgorithm(URI encryptionAlgorithm)
Sets the encryption algorithm in the request.
|
void |
setEncryptWith(URI encryptWith)
Sets the encryption algorithm that should be used with the issued security token.
|
void |
setEntropy(EntropyType entropy)
Sets the entropy that must be used when creating the key.
|
void |
setForwardable(boolean forwardable)
Specifies whether the requested token should be marked as "forwardable" or not.
|
void |
setIssuer(EndpointReferenceType issuer)
Sets the issuer of the token included in the request in scenarios where the requestor is obtaining a token on behalf of
another party.
|
void |
setKeySize(long keySize)
Sets the size of the key in the request.
|
void |
setKeyType(URI keyType)
Sets the key type in the request.
|
void |
setKeyWrapAlgorithm(URI keyWrapAlgorithm)
Sets the key wrap algorithm in the request.
|
void |
setLifetime(Lifetime lifetime)
Sets the desired lifetime of the requested token.
|
void |
setOnBehalfOf(OnBehalfOfType onBehalfOf)
Specifies the identity on whose behalf this request is being made.
|
void |
setPolicy(Policy policy)
Sets the
Policy in the request. |
void |
setPolicyReference(PolicyReference policyReference)
Sets the reference to the
Policy that should be used. |
void |
setProofEncryption(ProofEncryptionType proofEncryption)
Sets the
ProofEncryption section of the request. |
void |
setRenewing(RenewingType renewing)
Sets the renew semantics for this request.
|
void |
setRenewTarget(RenewTargetType renewTarget)
Sets the
RenewTarget section of the request. |
void |
setRequestType(URI requestType)
Sets the request type.
|
void |
setRSTDocument(Document rstDocument) |
void |
setSignatureAlgorithm(URI signatureAlgorithm)
Sets the signature algorithm in the request.
|
void |
setSignWith(URI signWith)
Sets the signature algorithm that should be used with the issued security token.
|
void |
setTokenType(URI tokenType)
Sets the token type.
|
void |
setUseKey(UseKeyType useKey)
Sets the key that should be used in the returned token.
|
void |
setValidateTarget(ValidateTargetType validateTarget)
Sets the
ValidateTarget section of the request. |
String |
toString() |
public RequestSecurityToken()
Creates an instance of RequestSecurityToken
.
public RequestSecurityToken(RequestSecurityTokenType delegate)
Creates an instance of RequestSecurityToken
using the specified delegate.
delegate
- the JAXB RequestSecurityTokenType
that represents a WS-Trust token request.public RequestSecurityToken(RequestSecurityTokenType delegate, Document rstDocument)
RequestSecurityTokenType
and Document
delegate
- rstDocument
- public URI getBinaryValueType()
public void setBinaryValueType(URI binaryValueType)
public Node getBinaryToken()
public void setBinaryToken(Node binaryToken)
public URI getTokenType()
Obtains the URI
that identifies the token type.
URI
that represents the token type.public void setTokenType(URI tokenType)
Sets the token type.
tokenType
- a URI
that identifies the token type.public URI getRequestType()
Obtains the request type.
URI
that identifies the request type.public void setRequestType(URI requestType)
Sets the request type. The type must be one of the request types described in the WS-Trust specification.
requestType
- a URI
that identifies the request type.public AppliesTo getAppliesTo()
Obtains the AppliesTo
value of this request. The AppliesTo
object identifies the service provider (web
service) that requires a token to be presented by clients. A STS uses this object to find the type of the token that is
accepted by the service provider so that it can issue appropriate tokens to clients.
AppliesTo
object.public void setAppliesTo(AppliesTo appliesTo)
Sets the AppliesTo
value of this request. The AppliesTo
object identifies the service provider (web
service) that requires a token to be presented by clients. A STS uses this object to find the type of the token that is
accepted by the service provider so that it can issue appropriate tokens to clients.
appliesTo
- a reference to the AppliesTo
object that identifies the service provider.public ClaimsType getClaims()
Obtains the set of claims of this request.
ClaimsType
object that represents the request's claims.public void setClaims(ClaimsType claims)
Sets the claims of this request.
claims
- the ClaimsType
object that represents the claims to be set.public EntropyType getEntropy()
Obtains the entropy that will be used in creating the key.
EntropyType
that represents the entropy.public void setEntropy(EntropyType entropy)
Sets the entropy that must be used when creating the key.
entropy
- the EntropyType
representing the entropy to be set.public Lifetime getLifetime()
Obtains the desired lifetime of the requested token.
Lifetime
that represents the lifetime.public void setLifetime(Lifetime lifetime)
Sets the desired lifetime of the requested token.
lifetime
- the Lifetime
object representing the lifetime to be set.public AllowPostdatingType getAllowPostDating()
Checks whether a request for a postdated token should be allowed or not.
null
if the token can't have a future lifetime (e.g. a token to be used the next day); a
AllowPostdatingType
otherwise.public void setAllowPostDating(AllowPostdatingType allowPostDating)
Specifies whether a request for a postdated token should be allowed or not.
allowPostDating
- null
if the token can't have a future lifetime (e.g. a token to be used the next day); a
AllowPostdatingType
otherwise.public RenewingType getRenewing()
Obtains the renew semantics for this request.
RenewingType
that represents the renew semantics for this request.public void setRenewing(RenewingType renewing)
Sets the renew semantics for this request.
renewing
- the RenewingType
object representing the semantics to be set.public OnBehalfOfType getOnBehalfOf()
Obtains the identity on whose behalf this request was made.
OnBehalfOfType
that represents the identity on whose behalf this request was made.public void setOnBehalfOf(OnBehalfOfType onBehalfOf)
Specifies the identity on whose behalf this request is being made.
onBehalfOf
- the OnBehalfOfType
object representing the identity to be set.public EndpointReferenceType getIssuer()
Obtains the issuer of the token included in the request in the scenarios where the requestor is obtaining a token on behalf of another party.
EndpointReferenceType
that represents the issuer.public void setIssuer(EndpointReferenceType issuer)
Sets the issuer of the token included in the request in scenarios where the requestor is obtaining a token on behalf of another party.
issuer
- the EndpointReferenceType
object representing the issuer to be set.public URI getAuthenticationType()
Obtains the type of authentication that has been set as part of the request.
URI
that identifies the desired authentication type.public void setAuthenticationType(URI authenticationType)
Sets the authentication type in the request.
authenticationType
- a URI
that identifies the authentication type to be set.public URI getKeyType()
Obtains the type of the key that has been set in the request.
URI
that identifies the key type.public void setKeyType(URI keyType)
Sets the key type in the request.
keyType
- a URI
that specifies the key type.public long getKeySize()
Obtains the size of they key that has been set in the request.
long
representing the key size.public void setKeySize(long keySize)
Sets the size of the key in the request.
keySize
- a long
representing the key size.public URI getSignatureAlgorithm()
Obtains the signature algorithm that has been set in the request.
URI
that represents the signature algorithm.public void setSignatureAlgorithm(URI signatureAlgorithm)
Sets the signature algorithm in the request.
signatureAlgorithm
- a URI
that represents the algorithm to be set.public EncryptionType getEncryption()
Obtains the Encryption
section of the request. The Encryption
element indicates that the requestor
desires any returned secrets in issued security tokens to be encrypted.
EncryptionType
object.public void setEncryption(EncryptionType encryption)
Sets the Encryption
section of the request. The Encryption
element indicates that the requestor desires
any returned secrets in issued security tokens to be encrypted.
encryption
- the EncryptionType
to be set.public URI getEncryptionAlgorithm()
Obtains the encryption algorithm that has been set in the request.
URI
that represents the encryption algorithm.public void setEncryptionAlgorithm(URI encryptionAlgorithm)
Sets the encryption algorithm in the request.
encryptionAlgorithm
- a URI
that represents the encryption algorithm to be set.public URI getCanonicalizationAlgorithm()
Obtains the canonicalization algorithm that has been set in the request.
URI
that represents the canonicalization algorithm.public void setCanonicalizationAlgorithm(URI canonicalizationAlgorithm)
Sets the canonicalization algorithm in the request.
canonicalizationAlgorithm
- a URI
that represents the algorithm to be set.public URI getKeyWrapAlgorithm()
Obtains the key wrap algorithm that has been set in the request.
URI
that represents the key wrap algorithm.public void setKeyWrapAlgorithm(URI keyWrapAlgorithm)
Sets the key wrap algorithm in the request.
keyWrapAlgorithm
- a URI
that represents the algorithm to be set.public ProofEncryptionType getProofEncryption()
Obtains the ProofEncryption
section of the request. The ProofEncryption
indicates that the requester
desires any returned secrets in issued security tokens to be encrypted.
ProofEncryptionType
object.public void setProofEncryption(ProofEncryptionType proofEncryption)
Sets the ProofEncryption
section of the request. The ProofEncryption
indicates that the requester desires
any returned secrets in issued security tokens to be encrypted.
proofEncryption
- the ProofEncryptionType
to be set.public UseKeyType getUseKey()
Obtains the key that should be used in the returned token.
UseKeyType
instance that represents the key to be used.public void setUseKey(UseKeyType useKey)
Sets the key that should be used in the returned token.
useKey
- the UseKeyType
instance to be set.public URI getSignWith()
Obtains the signature algorithm that should be used with the issued security token.
URI
representing the algorithm that should be used.public void setSignWith(URI signWith)
Sets the signature algorithm that should be used with the issued security token.
signWith
- a URI
representing the algorithm to be used.public URI getComputedKeyAlgorithm()
public void setComputedKeyAlgorithm(URI computedKeyAlgorithm)
computedKeyAlgorithm
- public URI getEncryptWith()
Obtains the encryption algorithm that should be used with the issued security token.
URI
representing the encryption algorithm that should be used.public void setEncryptWith(URI encryptWith)
Sets the encryption algorithm that should be used with the issued security token.
encryptWith
- a URI
representing the algorithm to be used.public DelegateToType getDelegateTo()
Obtains the identity to which the requested token should be delegated.
DelegateToType
instance that represents the identity.public void setDelegateTo(DelegateToType delegateTo)
Sets the identity to which the requested token should be delegated.
delegateTo
- the DelegateToType
object representing the identity to be set.public boolean isForwardable()
Indicates whether the requested token should be marked as "forwardable" or not. In general, this flag is used when a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used from any source machine so long as the key is correctly proven.
true
if the requested token should be marked as "forwardable"; false
otherwise.public void setForwardable(boolean forwardable)
Specifies whether the requested token should be marked as "forwardable" or not. In general, this flag is used when a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used from any source machine so long as the key is correctly proven.
forwardable
- true
if the requested token should be marked as "forwardable"; false
otherwise.public boolean isDelegatable()
Indicates whether the requested token should be marked as "delegatable" or not. Using this flag, the returned token MAY be delegated to another party.
true
if the requested token should be marked as "delegatable"; false
otherwise.public void setDelegatable(boolean delegatable)
Specifies whether the requested token should be marked as "delegatable" or not. Using this flag, the returned token MAY be delegated to another party.
delegatable
- true
if the requested token should be marked as "delegatable"; false
otherwise.public Policy getPolicy()
Obtains the Policy
associated with the request. The policy specifies defaults that can be overridden by the
previous properties.
Policy
that has been set in the request.public void setPolicy(Policy policy)
Sets the Policy
in the request. The policy specifies defaults that can be overridden by the previous properties.
policy
- the Policy
instance to be set.public PolicyReference getPolicyReference()
Obtains the reference to the Policy
that should be used.
PolicyReference
that specifies where the Policy
can be found.public void setPolicyReference(PolicyReference policyReference)
Sets the reference to the Policy
that should be used.
policyReference
- the PolicyReference
object to be set.public List<Object> getExtensionElements()
Obtains the list of request elements that are not part of the standard content model.
List<Object>
containing the extension elements.public String getContext()
Obtains the request context.
String
that identifies the request.public void setContext(String context)
Sets the request context.
context
- a String
that identifies the request.public CancelTargetType getCancelTarget()
Obtains the CancelTarget
section of the request. This element identifies the token that is to be canceled.
CancelTargetType
that represents the CancelTarget
section of the WS-Trust
cancel request.public void setCancelTarget(CancelTargetType cancelTarget)
Sets the CancelTarget
section of the request. This element identifies the token that is to be canceled.
cancelTarget
- a reference to the CancelTargetType
that identifies the token that must be canceled.public RenewTargetType getRenewTarget()
Obtains the RenewTarget
section of the request. This element identifies the token that is to be renewed.
RenewTargetType
that represents the RenewTarget
section of the WS-Trust renew
request.public void setRenewTarget(RenewTargetType renewTarget)
Sets the RenewTarget
section of the request. This element identifies the token that is to be renewed.
renewTarget
- a reference to the RenewTargetType
that identifies the token that must be renewed.public ValidateTargetType getValidateTarget()
Obtains the ValidateTarget
section of the request. This element identifies the token that is to be validated.
ValidateTargetType
that represents the ValidateTarget
section of the WS-Trust
validate request.public Element getValidateTargetElement()
public Element getRenewTargetElement()
Returns the element in the document that represents the renew target type.
Element
that represents the renew target type, or null
if no renew target is found in the
document.public Element getCancelTargetElement()
Returns the element in the document that represents the cancel target type.
Element
that represents the renew target type, or null
if no renew target is found in the
document.public void setValidateTarget(ValidateTargetType validateTarget)
Sets the ValidateTarget
section of the request. This elements identifies the token that is to be validated.
validateTarget
- a reference to the ValidateTargetType
that identifies the token that must be validated.public Map<QName,String> getOtherAttributes()
Obtains a map that contains attributes that aren't bound to any typed property on the request. This is a live reference, so attributes can be added/changed/removed directly. For this reason, there is no setter method.
Map<QName, String>
that contains the attributes.public List<Object> getAny()
Gets a reference to the list that holds all request element values.
List<Object>
containing all values specified in the request.public RequestSecurityTokenType getDelegate()
Obtains a reference to the RequestSecurityTokenType
delegate.
public Document getRSTDocument()
Document
document representing the requestpublic void setRSTDocument(Document rstDocument)
public void addExtensionElement(Object element)
Copyright © 2018 JBoss by Red Hat. All rights reserved.