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 java.lang.Object implements SecurityToken
-
-
Field Summary
Fields Modifier and Type Field Description private booleanasymmetricprivate java.lang.Stringidprotected java.util.Map<java.lang.String,java.security.Key>keyTableprivate java.security.PublicKeypublicKeyprivate java.lang.Stringsha1Identifierprotected java.util.List<SecurityTokenConstants.TokenUsage>tokenUsagesprivate java.security.cert.X509Certificate[]x509Certificates
-
Constructor Summary
Constructors Constructor Description AbstractSecurityToken(java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)java.lang.StringgetId()Returns the token id aka wsu:Idjava.security.PublicKeygetPublicKey()Returns the public key if one exists and already initialized, null otherwisejava.util.Map<java.lang.String,java.security.Key>getSecretKey()Returns the secret key's if already initialized, null otherwisejava.lang.StringgetSha1Identifier()Returns a SHA-1 Identifier that refers to this tokenjava.util.List<SecurityTokenConstants.TokenUsage>getTokenUsages()java.security.cert.X509Certificate[]getX509Certificates()Returns the certificate chain if one exists for this token typebooleanisAsymmetric()Returns the token typeprotected voidsetAsymmetric(boolean asymmetric)voidsetPublicKey(java.security.PublicKey publicKey)voidsetSecretKey(java.lang.String algorithmURI, java.security.Key key)voidsetSha1Identifier(java.lang.String sha1Identifier)voidsetX509Certificates(java.security.cert.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
-
id
private final java.lang.String id
-
publicKey
private java.security.PublicKey publicKey
-
x509Certificates
private java.security.cert.X509Certificate[] x509Certificates
-
asymmetric
private boolean asymmetric
-
sha1Identifier
private java.lang.String sha1Identifier
-
keyTable
protected final java.util.Map<java.lang.String,java.security.Key> keyTable
-
tokenUsages
protected final java.util.List<SecurityTokenConstants.TokenUsage> tokenUsages
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:SecurityTokenReturns the token id aka wsu:Id- Specified by:
getIdin interfaceSecurityToken- Returns:
- The id
-
setAsymmetric
protected void setAsymmetric(boolean asymmetric)
-
isAsymmetric
public boolean isAsymmetric() throws XMLSecurityExceptionDescription copied from interface:SecurityTokenReturns the token type- Specified by:
isAsymmetricin interfaceSecurityToken- Returns:
- true if asymmetric token, false if symmetric token
- Throws:
XMLSecurityException
-
setSecretKey
public void setSecretKey(java.lang.String algorithmURI, java.security.Key key)
-
getSecretKey
public java.util.Map<java.lang.String,java.security.Key> getSecretKey() throws XMLSecurityExceptionDescription copied from interface:SecurityTokenReturns the secret key's if already initialized, null otherwise- Specified by:
getSecretKeyin interfaceSecurityToken- Returns:
- Algorithm-URI key map
- Throws:
XMLSecurityException
-
setPublicKey
public void setPublicKey(java.security.PublicKey publicKey)
-
getPublicKey
public java.security.PublicKey getPublicKey() throws XMLSecurityExceptionDescription copied from interface:SecurityTokenReturns the public key if one exists and already initialized, null otherwise- Specified by:
getPublicKeyin interfaceSecurityToken- Returns:
- the public key
- Throws:
XMLSecurityException
-
setX509Certificates
public void setX509Certificates(java.security.cert.X509Certificate[] x509Certificates)
-
getX509Certificates
public java.security.cert.X509Certificate[] getX509Certificates() throws XMLSecurityExceptionDescription copied from interface:SecurityTokenReturns the certificate chain if one exists for this token type- Specified by:
getX509Certificatesin 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:
addTokenUsagein interfaceSecurityToken- Throws:
XMLSecurityException
-
getTokenUsages
public java.util.List<SecurityTokenConstants.TokenUsage> getTokenUsages()
- Specified by:
getTokenUsagesin interfaceSecurityToken
-
getSha1Identifier
public java.lang.String getSha1Identifier()
Description copied from interface:SecurityTokenReturns a SHA-1 Identifier that refers to this token- Specified by:
getSha1Identifierin interfaceSecurityToken- Returns:
- a SHA-1 Identifier that refers to this token
-
setSha1Identifier
public void setSha1Identifier(java.lang.String sha1Identifier)
-
-