org.jboss.identity.federation.api.wstrust.protocol
Class RequestSecurityToken

java.lang.Object
  extended by org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken
All Implemented Interfaces:
BaseRequestSecurityToken

public class RequestSecurityToken
extends java.lang.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' />
 

Author:
Stefan Guilhen

Constructor Summary
RequestSecurityToken()
           Creates an instance of RequestSecurityToken.
RequestSecurityToken(RequestSecurityTokenType delegate)
           Creates an instance of RequestSecurityToken using the specified delegate.
 
Method Summary
 AllowPostdatingType getAllowPostDating()
           Checks whether a request for a postdated token should be allowed or not.
 java.util.List<java.lang.Object> getAny()
           Gets a reference to the list that holds all request element values.
 AppliesTo getAppliesTo()
           Obtains the AppliesTo value of this request.
 java.net.URI getAuthenticationType()
           Obtains the type of authentication that has been set as part of the request.
 java.net.URI getCanonicalizationAlgorithm()
           Obtains the canonicalization algorithm that has been set in the request.
 ClaimsType getClaims()
           Obtains the set of claims of this request.
 java.lang.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.
 java.net.URI getEncryptionAlgorithm()
           Obtains the encryption algorithm that has been set in the request.
 java.net.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.
 java.util.List<java.lang.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.
 java.net.URI getKeyType()
           Obtains the type of the key that has been set in the request.
 LifetimeType getLifetime()
           Obtains the desired lifetime of the requested token.
 OnBehalfOfType getOnBehalfOf()
           Obtains the identity on whose behalf this request was made.
 java.util.Map<javax.xml.namespace.QName,java.lang.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.
 java.net.URI getRequestType()
           Obtains the request type.
 java.net.URI getSignatureAlgorithm()
           Obtains the signature algorithm that has been set in the request.
 java.net.URI getSignWith()
           Obtains the signature algorithm that should be used with the issued security token.
 java.net.URI getTokenType()
           Obtains the URI that identifies the token type.
 UseKeyType getUseKey()
           Obtains the key that should be used in the returned token.
 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(java.net.URI authenticationType)
           Sets the authentication type in the request.
 void setCanonicalizationAlgorithm(java.net.URI canonicalizationAlgorithm)
           Sets the canonicalization algorithm in the request.
 void setClaims(ClaimsType claims)
           Sets the claims of this request.
 void setContext(java.lang.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(java.net.URI encryptionAlgorithm)
           Sets the encryption algorithm in the request.
 void setEncryptWith(java.net.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(java.net.URI keyType)
           Sets the key type in the request.
 void setLifetime(LifetimeType 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 setRequestType(java.net.URI requestType)
           Sets the request type.
 void setSignatureAlgorithm(java.net.URI signatureAlgorithm)
           Sets the signature algorithm in the request.
 void setSignWith(java.net.URI signWith)
           Sets the signature algorithm that should be used with the issued security token.
 void setTokenType(java.net.URI tokenType)
           Sets the token type.
 void setUseKey(UseKeyType useKey)
           Sets the key that should be used in the returned token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestSecurityToken

public RequestSecurityToken()

Creates an instance of RequestSecurityToken.


RequestSecurityToken

public RequestSecurityToken(RequestSecurityTokenType delegate)

Creates an instance of RequestSecurityToken using the specified delegate.

Parameters:
delegate - the JAXB RequestSecurityTokenType that represents a WS-Trust token request.
Method Detail

getTokenType

public java.net.URI getTokenType()

Obtains the URI that identifies the token type.

Returns:
a URI that represents the token type.

setTokenType

public void setTokenType(java.net.URI tokenType)

Sets the token type.

Parameters:
tokenType - a URI that identifies the token type.

getRequestType

public java.net.URI getRequestType()

Obtains the request type.

Returns:
a URI that identifies the request type.

setRequestType

public void setRequestType(java.net.URI requestType)

Sets the request type. The type must be one of the request types described in the WS-Trust specification.

Parameters:
requestType - a URI that identifies the request type.

getAppliesTo

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.

Returns:
the reference to the AppliesTo object.

setAppliesTo

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.

Parameters:
appliesTo - a reference to the AppliesTo object that identifies the service provider.

getClaims

public ClaimsType getClaims()

Obtains the set of claims of this request.

Returns:
a reference to the ClaimsType object that represents the request's claims.

setClaims

public void setClaims(ClaimsType claims)

Sets the claims of this request.

Parameters:
claims - the ClaimsType object that represents the claims to be set.

getEntropy

public EntropyType getEntropy()

Obtains the entropy that will be used in creating the key.

Returns:
a reference to the EntropyType that represents the entropy.

setEntropy

public void setEntropy(EntropyType entropy)

Sets the entropy that must be used when creating the key.

Parameters:
entropy - the EntropyType representing the entropy to be set.

getLifetime

public LifetimeType getLifetime()

Obtains the desired lifetime of the requested token.

Returns:
a reference to the LifetimeType that represents the lifetime.

setLifetime

public void setLifetime(LifetimeType lifetime)

Sets the desired lifetime of the requested token.

Parameters:
lifetime - the LifetimeType object representing the lifetime to be set.

getAllowPostDating

public AllowPostdatingType getAllowPostDating()

Checks whether a request for a postdated token should be allowed or not.

Returns:
null if the token can't have a future lifetime (e.g. a token to be used the next day); a AllowPostdatingType otherwise.

setAllowPostDating

public void setAllowPostDating(AllowPostdatingType allowPostDating)

Specifies whether a request for a postdated token should be allowed or not.

Parameters:
allowPostDating - null if the token can't have a future lifetime (e.g. a token to be used the next day); a AllowPostdatingType otherwise.

getRenewing

public RenewingType getRenewing()

Obtains the renew semantics for this request.

Returns:
a reference to the RenewingType that represents the renew semantics for this request.

setRenewing

public void setRenewing(RenewingType renewing)

Sets the renew semantics for this request.

Parameters:
renewing - the RenewingType object representing the semantics to be set.

getOnBehalfOf

public OnBehalfOfType getOnBehalfOf()

Obtains the identity on whose behalf this request was made.

Returns:
a reference to the OnBehalfOfType that represents the identity on whose behalf this request was made.

setOnBehalfOf

public void setOnBehalfOf(OnBehalfOfType onBehalfOf)

Specifies the identity on whose behalf this request is being made.

Parameters:
onBehalfOf - the OnBehalfOfType object representing the identity to be set.

getIssuer

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.

Returns:
a reference to the EndpointReferenceType that represents the issuer.

setIssuer

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.

Parameters:
issuer - the EndpointReferenceType object representing the issuer to be set.

getAuthenticationType

public java.net.URI getAuthenticationType()

Obtains the type of authentication that has been set as part of the request.

Returns:
a URI that identifies the desired authentication type.

setAuthenticationType

public void setAuthenticationType(java.net.URI authenticationType)

Sets the authentication type in the request.

Parameters:
authenticationType - a URI that identifies the authentication type to be set.

getKeyType

public java.net.URI getKeyType()

Obtains the type of the key that has been set in the request.

Returns:
a URI that identifies the key type.

setKeyType

public void setKeyType(java.net.URI keyType)

Sets the key type in the request.

Parameters:
keyType - a URI that specifies the key type.

getKeySize

public long getKeySize()

Obtains the size of they key that has been set in the request.

Returns:
a long representing the key size in bytes.

setKeySize

public void setKeySize(long keySize)

Sets the size of the key in the request.

Parameters:
keySize - a long representing the key size in bytes.

getSignatureAlgorithm

public java.net.URI getSignatureAlgorithm()

Obtains the signature algorithm that has been set in the request.

Returns:
a URI that represents the signature algorithm.

setSignatureAlgorithm

public void setSignatureAlgorithm(java.net.URI signatureAlgorithm)

Sets the signature algorithm in the request.

Parameters:
signatureAlgorithm - a URI that represents the algorithm to be set.

getEncryption

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.

Returns:
a reference to the EncryptionType object.

setEncryption

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.

Parameters:
encryption - the EncryptionType to be set.

getEncryptionAlgorithm

public java.net.URI getEncryptionAlgorithm()

Obtains the encryption algorithm that has been set in the request.

Returns:
a URI that represents the encryption algorithm.

setEncryptionAlgorithm

public void setEncryptionAlgorithm(java.net.URI encryptionAlgorithm)

Sets the encryption algorithm in the request.

Parameters:
encryptionAlgorithm - a URI that represents the encryption algorithm to be set.

getCanonicalizationAlgorithm

public java.net.URI getCanonicalizationAlgorithm()

Obtains the canonicalization algorithm that has been set in the request.

Returns:
a URI that represents the canonicalization algorithm.

setCanonicalizationAlgorithm

public void setCanonicalizationAlgorithm(java.net.URI canonicalizationAlgorithm)

Sets the canonicalization algorithm in the request.

Parameters:
canonicalizationAlgorithm - a URI that represents the algorithm to be set.

getProofEncryption

public ProofEncryptionType getProofEncryption()

Obtains the ProofEncryption section of the request. The ProofEncryption indicates that the requestor desires any returned secrets in issued security tokens to be encrypted.

Returns:
a reference to the ProofEncryptionType object.

setProofEncryption

public void setProofEncryption(ProofEncryptionType proofEncryption)

Sets the ProofEncryption section of the request. The ProofEncryption indicates that the requestor desires any returned secrets in issued security tokens to be encrypted.

Parameters:
proofEncryption - the ProofEncryptionType to be set.

getUseKey

public UseKeyType getUseKey()

Obtains the key that should be used in the returned token.

Returns:
a reference to the UseKeyType instance that represents the key to be used.

setUseKey

public void setUseKey(UseKeyType useKey)

Sets the key that should be used in the returned token.

Parameters:
useKey - the UseKeyType instance to be set.

getSignWith

public java.net.URI getSignWith()

Obtains the signature algorithm that should be used with the issued security token.

Returns:
a URI representing the algorithm that should be used.

setSignWith

public void setSignWith(java.net.URI signWith)

Sets the signature algorithm that should be used with the issued security token.

Parameters:
signWith - a URI representing the algorithm to be used.

getEncryptWith

public java.net.URI getEncryptWith()

Obtains the encryption algorithm that should be used with the issued security token.

Returns:
a URI representing the encryption algorithm that should be used.

setEncryptWith

public void setEncryptWith(java.net.URI encryptWith)

Sets the encryption algorithm that should be used with the issued security token.

Parameters:
encryptWith - a URI representing the algorithm to be used.

getDelegateTo

public DelegateToType getDelegateTo()

Obtains the identity to which the requested token should be delegated.

Returns:
a reference to the DelegateToType instance that represents the identity.

setDelegateTo

public void setDelegateTo(DelegateToType delegateTo)

Sets the identity to which the requested token should be delegated.

Parameters:
delegateTo - the DelegateToType object representing the identity to be set.

isForwardable

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.

Returns:
true if the requested token should be marked as "forwardable"; false otherwise.

setForwardable

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.

Parameters:
forwardable - true if the requested token should be marked as "forwardable"; false otherwise.

isDelegatable

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.

Returns:
true if the requested token should be marked as "delegatable"; false otherwise.

setDelegatable

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.

Parameters:
delegatable - true if the requested token should be marked as "delegatable"; false otherwise.

getPolicy

public Policy getPolicy()

Obtains the Policy associated with the request. The policy specifies defaults that can be overridden by the previous properties.

Returns:
a reference to the Policy that has been set in the request.

setPolicy

public void setPolicy(Policy policy)

Sets the Policy in the request. The policy specifies defaults that can be overridden by the previous properties.

Parameters:
policy - the Policy instance to be set.

getPolicyReference

public PolicyReference getPolicyReference()

Obtains the reference to the Policy that should be used.

Returns:
a PolicyReference that specifies where the Policy can be found.

setPolicyReference

public void setPolicyReference(PolicyReference policyReference)

Sets the reference to the Policy that should be used.

Parameters:
policyReference - the PolicyReference object to be set.

getExtensionElements

public java.util.List<java.lang.Object> getExtensionElements()

Obtains the list of request elements that are not part of the standard content model.

Returns:
a List<Object> containing the extension elements.

getContext

public java.lang.String getContext()

Obtains the request context.

Returns:
a String that identifies the request.

setContext

public void setContext(java.lang.String context)

Sets the request context.

Parameters:
context - a String that identifies the request.

getOtherAttributes

public java.util.Map<javax.xml.namespace.QName,java.lang.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.

Returns:
a Map<QName, String> that contains the attributes.

getAny

public java.util.List<java.lang.Object> getAny()

Gets a reference to the list that holds all request element values.

Returns:
a List<Object> containing all values specified in the request.

getDelegate

public RequestSecurityTokenType getDelegate()

Obtains a reference to the RequestSecurityTokenType delegate.

Returns:
a reference to the delegate instance.


Copyright © 2009 JBoss Inc.. All Rights Reserved.