Interface InboundSecurityToken
-
- All Superinterfaces:
SecurityToken
- All Known Implementing Classes:
AbstractInboundSecurityToken
,DsaKeyValueSecurityToken
,ECKeyValueSecurityToken
,KeyNameSecurityToken
,RsaKeyValueSecurityToken
,X509IssuerSerialSecurityToken
,X509SecurityToken
,X509SKISecurityToken
,X509SubjectNameSecurityToken
public interface InboundSecurityToken extends SecurityToken
This class represents the different token types which can occur in WS-Security Sometimes it isn't known (@see EncryptedKeyInputProcessor) which kind of Token(Asymmetric, Symmetric) we have at creation time. So we use a generic interface for both types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addWrappedToken(InboundSecurityToken securityToken)
java.util.List<javax.xml.namespace.QName>
getElementPath()
Returns the absolute path to the XMLElementjava.security.PublicKey
getPublicKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)
Returns the public key if one exist for this token typejava.security.Key
getSecretKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID)
Returns the secret keyXMLSecEvent
getXMLSecEvent()
Returns the first XMLEvent for this tokenboolean
isIncludedInMessage()
Returns if the token is included in the message or notvoid
verify()
Verifies the key if applicable-
Methods inherited from interface org.apache.xml.security.stax.securityToken.SecurityToken
addTokenUsage, getId, getKeyIdentifier, getKeyWrappingToken, getPublicKey, getSecretKey, getSha1Identifier, getTokenType, getTokenUsages, getWrappedTokens, getX509Certificates, isAsymmetric
-
-
-
-
Method Detail
-
getSecretKey
java.security.Key getSecretKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityException
Returns the secret key- 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
-
getPublicKey
java.security.PublicKey getPublicKey(java.lang.String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, java.lang.String correlationID) throws XMLSecurityException
Returns the public key if one exist for this token type- Parameters:
algorithmURI
-algorithmUsage
-- Returns:
- The Public-Key for asymmetric algorithms
- Throws:
XMLSecurityException
- if the key can't be loaded
-
addWrappedToken
void addWrappedToken(InboundSecurityToken securityToken)
-
verify
void verify() throws XMLSecurityException
Verifies the key if applicable- Throws:
XMLSecurityException
- if the key couldn't be verified or the key isn't valid
-
getElementPath
java.util.List<javax.xml.namespace.QName> getElementPath()
Returns the absolute path to the XMLElement- Returns:
- A list containing full qualified element names
-
getXMLSecEvent
XMLSecEvent getXMLSecEvent()
Returns the first XMLEvent for this token- Returns:
- the first XMLEvent for this token
-
isIncludedInMessage
boolean isIncludedInMessage()
Returns if the token is included in the message or not- Returns:
- true if the token is included false otherwise
-
-