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

java.lang.Object
  extended by org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
      extended by org.apache.xml.security.stax.impl.securityToken.AbstractInboundSecurityToken
All Implemented Interfaces:
InboundSecurityToken, SecurityToken
Direct Known Subclasses:
DsaKeyValueSecurityToken, ECKeyValueSecurityToken, KeyNameSecurityToken, RsaKeyValueSecurityToken, X509SecurityToken

public abstract class AbstractInboundSecurityToken
extends AbstractSecurityToken
implements InboundSecurityToken

Version:
$Revision: 1359731 $ $Date: 2012-07-10 16:39:40 +0100 (Tue, 10 Jul 2012) $
Author:
$Author: coheigea $

Field Summary
 
Fields inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
keyTable, tokenUsages
 
Constructor Summary
AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage)
           
 
Method Summary
 void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)
           
 void addWrappedToken(InboundSecurityToken inboundSecurityToken)
           
 List<QName> getElementPath()
          Returns the absolute path to the XMLElement
protected  Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
           
 SecurityTokenConstants.KeyIdentifier getKeyIdentifier()
          Returns the KeyIdentifier
 InboundSecurityToken getKeyWrappingToken()
          Returns the key wrapping token
protected  PublicKey getPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
           
 PublicKey getPublicKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
          Returns the public key if one exist for this token type
 Key getSecretKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
          Returns the secret key
 List<InboundSecurityToken> getWrappedTokens()
           
 XMLSecEvent getXMLSecEvent()
          Returns the first XMLEvent for this token
 boolean isIncludedInMessage()
          Returns if the token is included in the message or not
 void setElementPath(List<QName> elementPath)
           
 void setKeyWrappingToken(InboundSecurityToken keyWrappingToken)
           
 void setXMLSecEvent(XMLSecEvent xmlSecEvent)
           
 void verify()
          Verifies the key if applicable
 
Methods inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
getId, getPublicKey, getSecretKey, getSha1Identifier, getTokenUsages, getX509Certificates, isAsymmetric, setAsymmetric, setPublicKey, setSecretKey, setSha1Identifier, setX509Certificates
 
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
getId, getPublicKey, getSecretKey, getSha1Identifier, getTokenType, getTokenUsages, getX509Certificates, isAsymmetric
 

Constructor Detail

AbstractInboundSecurityToken

public AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext,
                                    String id,
                                    SecurityTokenConstants.KeyIdentifier keyIdentifier,
                                    boolean includedInMessage)
Method Detail

getKeyIdentifier

public SecurityTokenConstants.KeyIdentifier getKeyIdentifier()
Description copied from interface: SecurityToken
Returns the KeyIdentifier

Specified by:
getKeyIdentifier in interface SecurityToken
Returns:
the KeyIdentifier

getElementPath

public List<QName> getElementPath()
Description copied from interface: InboundSecurityToken
Returns the absolute path to the XMLElement

Specified by:
getElementPath in interface InboundSecurityToken
Returns:
A list containing full qualified element names

setElementPath

public void setElementPath(List<QName> elementPath)

getXMLSecEvent

public XMLSecEvent getXMLSecEvent()
Description copied from interface: InboundSecurityToken
Returns the first XMLEvent for this token

Specified by:
getXMLSecEvent in interface InboundSecurityToken
Returns:
the first XMLEvent for this token

setXMLSecEvent

public void setXMLSecEvent(XMLSecEvent xmlSecEvent)

getKey

protected Key getKey(String algorithmURI,
                     XMLSecurityConstants.AlgorithmUsage algorithmUsage,
                     String correlationID)
              throws XMLSecurityException
Throws:
XMLSecurityException

getSecretKey

public final Key getSecretKey(String algorithmURI,
                              XMLSecurityConstants.AlgorithmUsage algorithmUsage,
                              String correlationID)
                       throws XMLSecurityException
Description copied from interface: InboundSecurityToken
Returns the secret key

Specified by:
getSecretKey in interface InboundSecurityToken
Parameters:
algorithmURI - for the requested key
Returns:
The requested key for the specified algorithmURI, or null if no matching key is found
Throws:
XMLSecurityException - if the key can't be loaded

getPubKey

protected PublicKey getPubKey(String algorithmURI,
                              XMLSecurityConstants.AlgorithmUsage algorithmUsage,
                              String correlationID)
                       throws XMLSecurityException
Throws:
XMLSecurityException

getPublicKey

public final PublicKey getPublicKey(String algorithmURI,
                                    XMLSecurityConstants.AlgorithmUsage algorithmUsage,
                                    String correlationID)
                             throws XMLSecurityException
Description copied from interface: InboundSecurityToken
Returns the public key if one exist for this token type

Specified by:
getPublicKey in interface InboundSecurityToken
Returns:
The Public-Key for asymmetric algorithms
Throws:
XMLSecurityException - if the key can't be loaded

verify

public void verify()
            throws XMLSecurityException
Description copied from interface: InboundSecurityToken
Verifies the key if applicable

Specified by:
verify in interface InboundSecurityToken
Throws:
XMLSecurityException - if the key couldn't be verified or the key isn't valid

getWrappedTokens

public List<InboundSecurityToken> getWrappedTokens()
Specified by:
getWrappedTokens in interface SecurityToken

addWrappedToken

public void addWrappedToken(InboundSecurityToken inboundSecurityToken)
Specified by:
addWrappedToken in interface InboundSecurityToken

addTokenUsage

public void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)
                   throws XMLSecurityException
Specified by:
addTokenUsage in interface SecurityToken
Overrides:
addTokenUsage in class AbstractSecurityToken
Throws:
XMLSecurityException

getKeyWrappingToken

public InboundSecurityToken getKeyWrappingToken()
                                         throws XMLSecurityException
Description copied from interface: SecurityToken
Returns the key wrapping token

Specified by:
getKeyWrappingToken in interface SecurityToken
Returns:
The wrapping SecurityToken
Throws:
XMLSecurityException

setKeyWrappingToken

public void setKeyWrappingToken(InboundSecurityToken keyWrappingToken)

isIncludedInMessage

public boolean isIncludedInMessage()
Description copied from interface: InboundSecurityToken
Returns if the token is included in the message or not

Specified by:
isIncludedInMessage in interface InboundSecurityToken
Returns:
true if the token is included false otherwise


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