Class KeyInfoReferenceResolver
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolverSpi
-
- org.apache.xml.security.keys.keyresolver.implementations.KeyInfoReferenceResolver
-
public class KeyInfoReferenceResolver extends KeyResolverSpi
KeyResolverSpi implementation which resolves public keys, private keys, secret keys, and X.509 certificates from adsig11:KeyInfoReference
element.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOG
-
Fields inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
globalResolver, properties, secureValidation
-
-
Constructor Summary
Constructors Constructor Description KeyInfoReferenceResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
engineCanResolve(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{This method returns whether the KeyResolverSpi is able to perform the requested action.java.security.PrivateKey
engineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{Method engineLookupAndResolvePrivateKeyjava.security.PublicKey
engineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{Method engineLookupAndResolvePublicKeyjavax.crypto.SecretKey
engineLookupAndResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{Method engineLookupAndResolveSecretKeyjava.security.cert.X509Certificate
engineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{Method engineLookupResolveX509Certificateprivate org.w3c.dom.Element
obtainReferenceElement(XMLSignatureInput resource)
Resolve the Element effectively represented by the XML signature input source.private XMLSignatureInput
resolveInput(org.w3c.dom.Attr uri, java.lang.String baseURI, boolean secureValidation)
Resolve the XML signature input represented by the specified URI.private KeyInfo
resolveReferentKeyInfo(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.private void
validateReference(org.w3c.dom.Element referentElement)
Validate the Element referred to by the KeyInfoReference.-
Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineGetProperty, engineResolvePublicKey, engineResolveSecretKey, engineResolveX509Certificate, engineSetProperty, getDocFromBytes, setGlobalResolver, setSecureValidation, understandsProperty
-
-
-
-
Method Detail
-
engineCanResolve
public boolean engineCanResolve(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)
{This method returns whether the KeyResolverSpi is able to perform the requested action.}.- Overrides:
engineCanResolve
in classKeyResolverSpi
- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineLookupAndResolvePublicKey
public java.security.PublicKey engineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverException
{Method engineLookupAndResolvePublicKey}.- Overrides:
engineLookupAndResolvePublicKey
in classKeyResolverSpi
- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public java.security.cert.X509Certificate engineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverException
{Method engineLookupResolveX509Certificate}.- Overrides:
engineLookupResolveX509Certificate
in classKeyResolverSpi
- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolveSecretKey
public javax.crypto.SecretKey engineLookupAndResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverException
{Method engineLookupAndResolveSecretKey}.- Overrides:
engineLookupAndResolveSecretKey
in classKeyResolverSpi
- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public java.security.PrivateKey engineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverException
{Method engineLookupAndResolvePrivateKey}.- Overrides:
engineLookupAndResolvePrivateKey
in classKeyResolverSpi
- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
resolveReferentKeyInfo
private KeyInfo resolveReferentKeyInfo(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws XMLSecurityException
Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.- Parameters:
element
-baseURI
-storage
-- Returns:
- the KeyInfo which is referred to by this KeyInfoReference, or null if can not be resolved
- Throws:
XMLSecurityException
-
validateReference
private void validateReference(org.w3c.dom.Element referentElement) throws XMLSecurityException
Validate the Element referred to by the KeyInfoReference.- Parameters:
referentElement
-- Throws:
XMLSecurityException
-
resolveInput
private XMLSignatureInput resolveInput(org.w3c.dom.Attr uri, java.lang.String baseURI, boolean secureValidation) throws XMLSecurityException
Resolve the XML signature input represented by the specified URI.- Parameters:
uri
-baseURI
-secureValidation
-- Returns:
- the XML signature input represented by the specified URI.
- Throws:
XMLSecurityException
-
obtainReferenceElement
private org.w3c.dom.Element obtainReferenceElement(XMLSignatureInput resource) throws CanonicalizationException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, KeyResolverException
Resolve the Element effectively represented by the XML signature input source.- Parameters:
resource
-- Returns:
- the Element effectively represented by the XML signature input source.
- Throws:
CanonicalizationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
KeyResolverException
-
-