org.apache.xml.security.stax.impl.securityToken
Class AbstractSecurityToken

java.lang.Object
  extended by 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
protected  Map<String,Key> keyTable
           
protected  List<SecurityTokenConstants.TokenUsage> tokenUsages
           
 
Constructor Summary
AbstractSecurityToken(String id)
           
 
Method Summary
 void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)
           
 String getId()
          Returns the token id aka wsu:Id
 PublicKey getPublicKey()
          Returns the public key if one exists and already initialized, null otherwise
 Map<String,Key> getSecretKey()
          Returns the secret key's if already initialized, null otherwise
 String getSha1Identifier()
          Returns a SHA-1 Identifier that refers to this token
 List<SecurityTokenConstants.TokenUsage> getTokenUsages()
           
 X509Certificate[] getX509Certificates()
          Returns the certificate chain if one exists for this token type
 boolean isAsymmetric()
          Returns the token type
protected  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

keyTable

protected final Map<String,Key> keyTable

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 interface SecurityToken
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 interface SecurityToken
Returns:
true if asymmetric token, false if symmetric token
Throws:
XMLSecurityException

setSecretKey

public void setSecretKey(String algorithmURI,
                         Key key)

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 interface SecurityToken
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 interface SecurityToken
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 interface SecurityToken
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 interface SecurityToken
Throws:
XMLSecurityException

getTokenUsages

public List<SecurityTokenConstants.TokenUsage> getTokenUsages()
Specified by:
getTokenUsages in interface SecurityToken

getSha1Identifier

public String getSha1Identifier()
Description copied from interface: SecurityToken
Returns a SHA-1 Identifier that refers to this token

Specified by:
getSha1Identifier in interface SecurityToken
Returns:
a SHA-1 Identifier that refers to this token

setSha1Identifier

public void setSha1Identifier(String sha1Identifier)


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.