Class SecurityToken
- java.lang.Object
-
- org.apache.cxf.ws.security.tokenstore.SecurityToken
-
- All Implemented Interfaces:
Serializable
public class SecurityToken extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBOOTSTRAP_TOKEN_IDThis tag holds an ID of a Bootstrap SecurityToken stored in the TokenStore
-
Constructor Summary
Constructors Constructor Description SecurityToken()SecurityToken(String id)SecurityToken(String id, Instant created, Instant expires)SecurityToken(String id, Element tokenElem, Instant created, Instant expires)SecurityToken(String id, Element tokenElem, Element lifetimeElem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementgetAttachedReference()InstantgetCreated()org.apache.wss4j.common.crypto.CryptogetCrypto()InstantgetExpires()StringgetId()static StringgetIdFromSTR(Element str)StringgetIssuerAddress()KeygetKey()PrincipalgetPrincipal()Get the principal associated with this SecurityTokenMap<String,Object>getProperties()byte[]getSecret()org.apache.cxf.security.SecurityContextgetSecurityContext()Get the SecurityContext associated with this SecurityTokenStringgetSHA1()ElementgetToken()intgetTokenHash()Get a hash code associated with this token.StringgetTokenType()StringgetTransformedTokenIdentifier()Get the identifier corresponding to a transformed version of this tokenElementgetUnattachedReference()StringgetWsuId()X509CertificategetX509Certificate()booleanisAboutToExpire(long secondsToExpiry)Return whether this SecurityToken is about to expire or notbooleanisExpired()Return whether this SecurityToken is expired or notvoidsetAttachedReference(Element attachedReference)voidsetExpires(Instant expires)voidsetId(String id)Set the idvoidsetIssuerAddress(String issuerAddress)voidsetKey(Key key)voidsetPrincipal(Principal principal)Set the principal associated with this SecurityTokenvoidsetProperties(Map<String,Object> properties)voidsetSecret(byte[] secret)voidsetSecurityContext(org.apache.cxf.security.SecurityContext securityContext)Set the SecurityContext associated with this SecurityTokenvoidsetSHA1(String sha)voidsetToken(Element token)voidsetTokenHash(int hash)Set a hash code associated with this token.voidsetTokenType(String s)voidsetTransformedTokenIdentifier(String transformedTokenIdentifier)Set the identifier corresponding to a transformed version of this tokenvoidsetUnattachedReference(Element unattachedReference)voidsetWsuId(String wsuId)voidsetX509Certificate(X509Certificate cert, org.apache.wss4j.common.crypto.Crypto cpt)
-
-
-
Field Detail
-
BOOTSTRAP_TOKEN_ID
public static final String BOOTSTRAP_TOKEN_ID
This tag holds an ID of a Bootstrap SecurityToken stored in the TokenStore- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SecurityToken
public SecurityToken()
-
SecurityToken
public SecurityToken(String id)
-
-
Method Detail
-
setProperties
public void setProperties(Map<String,Object> properties)
- Parameters:
properties- The properties to set.
-
getToken
public Element getToken()
- Returns:
- Returns the token.
-
setToken
public void setToken(Element token)
- Parameters:
token- The token to set.
-
getTransformedTokenIdentifier
public String getTransformedTokenIdentifier()
Get the identifier corresponding to a transformed version of this token
-
setTransformedTokenIdentifier
public void setTransformedTokenIdentifier(String transformedTokenIdentifier)
Set the identifier corresponding to a transformed version of this token
-
setId
public void setId(String id)
Set the id
-
getId
public String getId()
- Returns:
- Returns the id.
-
getSecret
public byte[] getSecret()
- Returns:
- Returns the secret.
-
setSecret
public void setSecret(byte[] secret)
- Parameters:
secret- The secret to set.
-
getAttachedReference
public Element getAttachedReference()
- Returns:
- Returns the attachedReference.
-
setAttachedReference
public void setAttachedReference(Element attachedReference)
- Parameters:
attachedReference- The attachedReference to set.
-
getUnattachedReference
public Element getUnattachedReference()
- Returns:
- Returns the unattachedReference.
-
setUnattachedReference
public void setUnattachedReference(Element unattachedReference)
- Parameters:
unattachedReference- The unattachedReference to set.
-
getCreated
public Instant getCreated()
- Returns:
- Returns the created.
-
getExpires
public Instant getExpires()
- Returns:
- Returns the expires.
-
isExpired
public boolean isExpired()
Return whether this SecurityToken is expired or not
-
isAboutToExpire
public boolean isAboutToExpire(long secondsToExpiry)
Return whether this SecurityToken is about to expire or not
-
setExpires
public void setExpires(Instant expires)
- Parameters:
expires- The expires to set.
-
getIssuerAddress
public String getIssuerAddress()
-
setIssuerAddress
public void setIssuerAddress(String issuerAddress)
-
setSHA1
public void setSHA1(String sha)
- Parameters:
sha- SHA1 of the encrypted key
-
getSHA1
public String getSHA1()
- Returns:
- SHA1 value of the encrypted key
-
getTokenType
public String getTokenType()
-
setTokenType
public void setTokenType(String s)
-
setWsuId
public void setWsuId(String wsuId)
-
getWsuId
public String getWsuId()
-
setX509Certificate
public void setX509Certificate(X509Certificate cert, org.apache.wss4j.common.crypto.Crypto cpt)
-
getX509Certificate
public X509Certificate getX509Certificate()
-
getCrypto
public org.apache.wss4j.common.crypto.Crypto getCrypto()
-
setTokenHash
public void setTokenHash(int hash)
Set a hash code associated with this token.- Parameters:
hash- a hash code associated with this token
-
getTokenHash
public int getTokenHash()
Get a hash code associated with this token.- Returns:
- a hash code associated with this token.
-
setPrincipal
public void setPrincipal(Principal principal)
Set the principal associated with this SecurityToken- Parameters:
principal- the principal associated with this SecurityToken
-
getPrincipal
public Principal getPrincipal()
Get the principal associated with this SecurityToken- Returns:
- the principal associated with this SecurityToken
-
setSecurityContext
public void setSecurityContext(org.apache.cxf.security.SecurityContext securityContext)
Set the SecurityContext associated with this SecurityToken- Parameters:
securityContext- the SecurityContext associated with this SecurityToken
-
getSecurityContext
public org.apache.cxf.security.SecurityContext getSecurityContext()
Get the SecurityContext associated with this SecurityToken- Returns:
- the SecurityContext associated with this SecurityToken
-
getKey
public Key getKey()
-
setKey
public void setKey(Key key)
-
-