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 Modifier and Type Field Description private java.util.List<javax.xml.namespace.QName>elementPathprivate InboundSecurityContextinboundSecurityContextprivate booleanincludedInMessageprivate booleaninvokedprivate SecurityTokenConstants.KeyIdentifierkeyIdentifierprivate InboundSecurityTokenkeyWrappingTokenprivate java.util.List<InboundSecurityToken>wrappedTokensprivate XMLSecEventxmlSecEvent-
Fields inherited from class org.apache.xml.security.stax.impl.securityToken.AbstractSecurityToken
keyTable, tokenUsages
-
-
Constructor Summary
Constructors Constructor Description AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, java.lang.String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage)voidaddWrappedToken(InboundSecurityToken inboundSecurityToken)java.util.List<javax.xml.namespace.QName>getElementPath()Returns the absolute path to the XMLElementprotected java.security.KeygetKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)SecurityTokenConstants.KeyIdentifiergetKeyIdentifier()Returns the KeyIdentifierInboundSecurityTokengetKeyWrappingToken()Returns the key wrapping tokenprotected java.security.PublicKeygetPubKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)java.security.PublicKeygetPublicKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)Returns the public key if one exist for this token typejava.security.KeygetSecretKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)Returns the secret keyjava.util.List<InboundSecurityToken>getWrappedTokens()XMLSecEventgetXMLSecEvent()Returns the first XMLEvent for this tokenbooleanisIncludedInMessage()Returns if the token is included in the message or notvoidsetElementPath(java.util.List<javax.xml.namespace.QName> elementPath)voidsetKeyWrappingToken(InboundSecurityToken keyWrappingToken)voidsetXMLSecEvent(XMLSecEvent xmlSecEvent)private voidtestAndSetInvocation()private voidunsetInvocation()voidverify()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
-
-
-
-
Field Detail
-
invoked
private boolean invoked
-
inboundSecurityContext
private InboundSecurityContext inboundSecurityContext
-
elementPath
private java.util.List<javax.xml.namespace.QName> elementPath
-
xmlSecEvent
private XMLSecEvent xmlSecEvent
-
keyIdentifier
private SecurityTokenConstants.KeyIdentifier keyIdentifier
-
wrappedTokens
private final java.util.List<InboundSecurityToken> wrappedTokens
-
keyWrappingToken
private InboundSecurityToken keyWrappingToken
-
includedInMessage
private boolean includedInMessage
-
-
Constructor Detail
-
AbstractInboundSecurityToken
public AbstractInboundSecurityToken(InboundSecurityContext inboundSecurityContext, java.lang.String id, SecurityTokenConstants.KeyIdentifier keyIdentifier, boolean includedInMessage)
-
-
Method Detail
-
testAndSetInvocation
private void testAndSetInvocation() throws XMLSecurityException- Throws:
XMLSecurityException
-
unsetInvocation
private void unsetInvocation()
-
getKeyIdentifier
public SecurityTokenConstants.KeyIdentifier getKeyIdentifier()
Description copied from interface:SecurityTokenReturns the KeyIdentifier- Specified by:
getKeyIdentifierin interfaceSecurityToken- Returns:
- the KeyIdentifier
-
getElementPath
public java.util.List<javax.xml.namespace.QName> 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
public void setElementPath(java.util.List<javax.xml.namespace.QName> elementPath)
-
getXMLSecEvent
public XMLSecEvent getXMLSecEvent()
Description copied from interface:InboundSecurityTokenReturns the first XMLEvent for this token- Specified by:
getXMLSecEventin interfaceInboundSecurityToken- Returns:
- the first XMLEvent for this token
-
setXMLSecEvent
public void setXMLSecEvent(XMLSecEvent xmlSecEvent)
-
getKey
protected java.security.Key getKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityException- Throws:
XMLSecurityException
-
getSecretKey
public final java.security.Key getSecretKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityExceptionDescription copied from interface:InboundSecurityTokenReturns the secret key- Specified by:
getSecretKeyin 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 java.security.PublicKey getPubKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityException- Throws:
XMLSecurityException
-
getPublicKey
public final java.security.PublicKey getPublicKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityExceptionDescription copied from interface:InboundSecurityTokenReturns the public key if one exist for this token type- Specified by:
getPublicKeyin interfaceInboundSecurityToken- Returns:
- The Public-Key for asymmetric algorithms
- Throws:
XMLSecurityException- if the key can't be loaded
-
verify
public void verify() throws XMLSecurityExceptionDescription 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
public java.util.List<InboundSecurityToken> getWrappedTokens()
- Specified by:
getWrappedTokensin interfaceSecurityToken
-
addWrappedToken
public void addWrappedToken(InboundSecurityToken inboundSecurityToken)
- Specified by:
addWrappedTokenin interfaceInboundSecurityToken
-
addTokenUsage
public void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException
- Specified by:
addTokenUsagein interfaceSecurityToken- Overrides:
addTokenUsagein classAbstractSecurityToken- Throws:
XMLSecurityException
-
getKeyWrappingToken
public InboundSecurityToken getKeyWrappingToken() throws XMLSecurityException
Description copied from interface:SecurityTokenReturns the key wrapping token- Specified by:
getKeyWrappingTokenin interfaceSecurityToken- Returns:
- The wrapping SecurityToken
- Throws:
XMLSecurityException
-
setKeyWrappingToken
public void setKeyWrappingToken(InboundSecurityToken keyWrappingToken)
-
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
-
-