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
FieldsModifier and TypeFieldDescriptionprivate InboundSecurityContextprivate booleanprivate booleanprivate InboundSecurityTokenprivate final List<InboundSecurityToken> private XMLSecEventFields inherited from class AbstractSecurityToken
keyTable, tokenUsages -
Constructor Summary
ConstructorsConstructorDescriptionAbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage) voidaddWrappedToken(InboundSecurityToken inboundSecurityToken) Returns the absolute path to the XMLElementprotected KeygetKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the KeyIdentifierReturns the key wrapping tokenprotected PublicKeygetPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) final PublicKeygetPublicKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the public key if one exist for this token typefinal KeygetSecretKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the secret keyReturns the first XMLEvent for this tokenbooleanReturns if the token is included in the message or notvoidsetElementPath(List<QName> elementPath) voidsetKeyWrappingToken(InboundSecurityToken keyWrappingToken) voidsetXMLSecEvent(XMLSecEvent xmlSecEvent) private voidprivate voidvoidverify()Verifies the key if applicableMethods inherited from class AbstractSecurityToken
getId, getPublicKey, getSecretKey, getSha1Identifier, getTokenUsages, getX509Certificates, isAsymmetric, setAsymmetric, setPublicKey, setSecretKey, setSha1Identifier, setX509CertificatesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SecurityToken
getId, getPublicKey, getSecretKey, getSha1Identifier, getTokenType, getTokenUsages, getX509Certificates, isAsymmetric
-
Field Details
-
invoked
private boolean invoked -
inboundSecurityContext
-
elementPath
-
xmlSecEvent
-
keyIdentifier
-
wrappedTokens
-
keyWrappingToken
-
includedInMessage
private boolean includedInMessage
-
-
Constructor Details
-
AbstractInboundSecurityToken
public AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage)
-
-
Method Details
-
testAndSetInvocation
- Throws:
XMLSecurityException
-
unsetInvocation
private void unsetInvocation() -
getKeyIdentifier
Description copied from interface:SecurityTokenReturns the KeyIdentifier- Specified by:
getKeyIdentifierin interfaceSecurityToken- Returns:
- the KeyIdentifier
-
getElementPath
Description copied from interface:InboundSecurityTokenReturns the absolute path to the XMLElement- Specified by:
getElementPathin interfaceInboundSecurityToken- Returns:
- A list containing full qualified element names
-
setElementPath
-
getXMLSecEvent
Description copied from interface:InboundSecurityTokenReturns the first XMLEvent for this token- Specified by:
getXMLSecEventin 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:InboundSecurityTokenReturns the secret key- Specified by:
getSecretKeyin interfaceInboundSecurityToken- Parameters:
algorithmURI- for the requested keyalgorithmUsage-- 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:InboundSecurityTokenReturns the public key if one exist for this token type- Specified by:
getPublicKeyin interfaceInboundSecurityToken- Parameters:
algorithmURI-algorithmUsage-- Returns:
- The Public-Key for asymmetric algorithms
- Throws:
XMLSecurityException- if the key can't be loaded
-
verify
Description copied from interface:InboundSecurityTokenVerifies the key if applicable- Specified by:
verifyin interfaceInboundSecurityToken- Throws:
XMLSecurityException- if the key couldn't be verified or the key isn't valid
-
getWrappedTokens
- Specified by:
getWrappedTokensin interfaceSecurityToken
-
addWrappedToken
- Specified by:
addWrappedTokenin interfaceInboundSecurityToken
-
addTokenUsage
- Specified by:
addTokenUsagein interfaceSecurityToken- Overrides:
addTokenUsagein classAbstractSecurityToken- Throws:
XMLSecurityException
-
getKeyWrappingToken
Description copied from interface:SecurityTokenReturns the key wrapping token- Specified by:
getKeyWrappingTokenin interfaceSecurityToken- Returns:
- The wrapping SecurityToken
- Throws:
XMLSecurityException
-
setKeyWrappingToken
-
isIncludedInMessage
public boolean isIncludedInMessage()Description copied from interface:InboundSecurityTokenReturns if the token is included in the message or not- Specified by:
isIncludedInMessagein interfaceInboundSecurityToken- Returns:
- true if the token is included false otherwise
-