Class AbstractInboundSecurityToken
java.lang.Object
org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
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
-
Field Summary
Fields inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
keyTable, tokenUsages
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractInboundSecurityToken
(InboundSecurityContext inboundSecurityContext, String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTokenUsage
(SecurityTokenConstants.TokenUsage tokenUsage) void
addWrappedToken
(InboundSecurityToken inboundSecurityToken) Returns the absolute path to the XMLElementprotected Key
getKey
(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the KeyIdentifierReturns the key wrapping tokenprotected PublicKey
getPubKey
(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) final PublicKey
getPublicKey
(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the public key if one exist for this token typefinal Key
getSecretKey
(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the secret keyReturns the first XMLEvent for this tokenboolean
Returns if the token is included in the message or notvoid
setElementPath
(List<QName> elementPath) void
setKeyWrappingToken
(InboundSecurityToken keyWrappingToken) void
setXMLSecEvent
(XMLSecEvent xmlSecEvent) void
verify()
Verifies the key if applicableMethods 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 Details
-
AbstractInboundSecurityToken
public AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage)
-
-
Method Details
-
getKeyIdentifier
Description copied from interface:SecurityToken
Returns the KeyIdentifier- Specified by:
getKeyIdentifier
in interfaceSecurityToken
- Returns:
- the KeyIdentifier
-
getElementPath
Description copied from interface:InboundSecurityToken
Returns the absolute path to the XMLElement- Specified by:
getElementPath
in interfaceInboundSecurityToken
- Returns:
- A list containing full qualified element names
-
setElementPath
-
getXMLSecEvent
Description copied from interface:InboundSecurityToken
Returns the first XMLEvent for this token- Specified by:
getXMLSecEvent
in interfaceInboundSecurityToken
- Returns:
- the first XMLEvent for this token
-
setXMLSecEvent
-
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 interfaceInboundSecurityToken
- 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 interfaceInboundSecurityToken
- Returns:
- The Public-Key for asymmetric algorithms
- Throws:
XMLSecurityException
- if the key can't be loaded
-
verify
Description copied from interface:InboundSecurityToken
Verifies the key if applicable- Specified by:
verify
in interfaceInboundSecurityToken
- Throws:
XMLSecurityException
- if the key couldn't be verified or the key isn't valid
-
getWrappedTokens
- Specified by:
getWrappedTokens
in interfaceSecurityToken
-
addWrappedToken
- Specified by:
addWrappedToken
in interfaceInboundSecurityToken
-
addTokenUsage
- Specified by:
addTokenUsage
in interfaceSecurityToken
- Overrides:
addTokenUsage
in classAbstractSecurityToken
- Throws:
XMLSecurityException
-
getKeyWrappingToken
Description copied from interface:SecurityToken
Returns the key wrapping token- Specified by:
getKeyWrappingToken
in interfaceSecurityToken
- Returns:
- The wrapping SecurityToken
- Throws:
XMLSecurityException
-
setKeyWrappingToken
-
isIncludedInMessage
public boolean isIncludedInMessage()Description copied from interface:InboundSecurityToken
Returns if the token is included in the message or not- Specified by:
isIncludedInMessage
in interfaceInboundSecurityToken
- Returns:
- true if the token is included false otherwise
-