Interface InboundSecurityToken
- All Superinterfaces:
SecurityToken
- All Known Implementing Classes:
AbstractInboundSecurityToken
,DsaKeyValueSecurityToken
,ECKeyValueSecurityToken
,KeyNameSecurityToken
,RsaKeyValueSecurityToken
,X509IssuerSerialSecurityToken
,X509SecurityToken
,X509SKISecurityToken
,X509SubjectNameSecurityToken
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
Modifier and TypeMethodDescriptionvoid
addWrappedToken
(InboundSecurityToken securityToken) Returns the absolute path to the XMLElementgetPublicKey
(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) Returns the public key if one exist for this token typegetSecretKey
(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
verify()
Verifies the key if applicableMethods inherited from interface org.apache.xml.security.stax.securityToken.SecurityToken
addTokenUsage, getId, getKeyIdentifier, getKeyWrappingToken, getPublicKey, getSecretKey, getSha1Identifier, getTokenType, getTokenUsages, getWrappedTokens, getX509Certificates, isAsymmetric
-
Method Details
-
getSecretKey
Key getSecretKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, 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
PublicKey getPublicKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, 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
-
verify
Verifies the key if applicable- Throws:
XMLSecurityException
- if the key couldn't be verified or the key isn't valid
-
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
-