Class AbstractSecurityToken
- java.lang.Object
-
- org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
-
- All Implemented Interfaces:
SecurityToken
- Direct Known Subclasses:
AbstractInboundSecurityToken
,GenericOutboundSecurityToken
public abstract class AbstractSecurityToken extends Object implements SecurityToken
- Version:
- $Revision: 1359731 $ $Date: 2012-07-10 16:39:40 +0100 (Tue, 10 Jul 2012) $
- Author:
- $Author: coheigea $
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Key>
keyTable
protected List<SecurityTokenConstants.TokenUsage>
tokenUsages
-
Constructor Summary
Constructors Constructor Description AbstractSecurityToken(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)
String
getId()
Returns the token id aka wsu:IdPublicKey
getPublicKey()
Returns the public key if one exists and already initialized, null otherwiseMap<String,Key>
getSecretKey()
Returns the secret key's if already initialized, null otherwiseString
getSha1Identifier()
Returns a SHA-1 Identifier that refers to this tokenList<SecurityTokenConstants.TokenUsage>
getTokenUsages()
X509Certificate[]
getX509Certificates()
Returns the certificate chain if one exists for this token typeboolean
isAsymmetric()
Returns the token typeprotected void
setAsymmetric(boolean asymmetric)
void
setPublicKey(PublicKey publicKey)
void
setSecretKey(String algorithmURI, Key key)
void
setSha1Identifier(String sha1Identifier)
void
setX509Certificates(X509Certificate[] x509Certificates)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.xml.security.stax.securityToken.SecurityToken
getKeyIdentifier, getKeyWrappingToken, getTokenType, getWrappedTokens
-
-
-
-
Field Detail
-
tokenUsages
protected final List<SecurityTokenConstants.TokenUsage> tokenUsages
-
-
Constructor Detail
-
AbstractSecurityToken
public AbstractSecurityToken(String id)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:SecurityToken
Returns the token id aka wsu:Id- Specified by:
getId
in interfaceSecurityToken
- Returns:
- The id
-
setAsymmetric
protected void setAsymmetric(boolean asymmetric)
-
isAsymmetric
public boolean isAsymmetric() throws XMLSecurityException
Description copied from interface:SecurityToken
Returns the token type- Specified by:
isAsymmetric
in interfaceSecurityToken
- Returns:
- true if asymmetric token, false if symmetric token
- Throws:
XMLSecurityException
-
getSecretKey
public Map<String,Key> getSecretKey() throws XMLSecurityException
Description copied from interface:SecurityToken
Returns the secret key's if already initialized, null otherwise- Specified by:
getSecretKey
in interfaceSecurityToken
- Returns:
- Algorithm-URI key map
- Throws:
XMLSecurityException
-
setPublicKey
public void setPublicKey(PublicKey publicKey)
-
getPublicKey
public PublicKey getPublicKey() throws XMLSecurityException
Description copied from interface:SecurityToken
Returns the public key if one exists and already initialized, null otherwise- Specified by:
getPublicKey
in interfaceSecurityToken
- Returns:
- the public key
- Throws:
XMLSecurityException
-
setX509Certificates
public void setX509Certificates(X509Certificate[] x509Certificates)
-
getX509Certificates
public X509Certificate[] getX509Certificates() throws XMLSecurityException
Description copied from interface:SecurityToken
Returns the certificate chain if one exists for this token type- Specified by:
getX509Certificates
in interfaceSecurityToken
- Returns:
- The certificate chain
- Throws:
XMLSecurityException
- if the certificates can't be retrieved
-
addTokenUsage
public void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException
- Specified by:
addTokenUsage
in interfaceSecurityToken
- Throws:
XMLSecurityException
-
getTokenUsages
public List<SecurityTokenConstants.TokenUsage> getTokenUsages()
- Specified by:
getTokenUsages
in interfaceSecurityToken
-
getSha1Identifier
public String getSha1Identifier()
Description copied from interface:SecurityToken
Returns a SHA-1 Identifier that refers to this token- Specified by:
getSha1Identifier
in interfaceSecurityToken
- Returns:
- a SHA-1 Identifier that refers to this token
-
setSha1Identifier
public void setSha1Identifier(String sha1Identifier)
-
-