Module org.apache.santuario.xmlsec
Class KeyInfoReferenceResolver
java.lang.Object
org.apache.xml.security.keys.keyresolver.KeyResolverSpi
org.apache.xml.security.keys.keyresolver.implementations.KeyInfoReferenceResolver
KeyResolverSpi implementation which resolves public keys, private keys, secret keys, and X.509 certificates from a
dsig11:KeyInfoReference element.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanengineCanResolve(Element element, String baseURI, StorageResolver storage) This method returns whether the KeyResolverSpi is able to perform the requested action.engineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePrivateKeyprotected PublicKeyengineResolvePublicKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePublicKeyprotected SecretKeyengineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveSecretKeyprotected X509CertificateengineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveCertificateprivate ElementobtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) Resolve the Element effectively represented by the XML signature input source.private XMLSignatureInputresolveInput(Attr uri, String baseURI, boolean secureValidation) Resolve the XML signature input represented by the specified URI.private KeyInforesolveReferentKeyInfo(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.private voidvalidateReference(Element referentElement, boolean secureValidation) Validate the Element referred to by the KeyInfoReference.Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineLookupAndResolvePrivateKey, engineLookupAndResolvePublicKey, engineLookupAndResolveSecretKey, engineLookupResolveX509Certificate, getDocFromBytes
-
Field Details
-
LOG
-
-
Constructor Details
-
KeyInfoReferenceResolver
public KeyInfoReferenceResolver()
-
-
Method Details
-
engineCanResolve
This method returns whether the KeyResolverSpi is able to perform the requested action.- Specified by:
engineCanResolvein classKeyResolverSpi- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineResolvePublicKey
protected PublicKey engineResolvePublicKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolvePublicKey- Specified by:
engineResolvePublicKeyin classKeyResolverSpi- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineResolveX509Certificate
protected X509Certificate engineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolveCertificate- Specified by:
engineResolveX509Certificatein classKeyResolverSpi- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolveSecretKey
protected SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolveSecretKey- Specified by:
engineResolveSecretKeyin classKeyResolverSpi- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolvePrivateKey
public PrivateKey engineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolvePrivateKey- Specified by:
engineResolvePrivateKeyin classKeyResolverSpi- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
resolveReferentKeyInfo
private KeyInfo resolveReferentKeyInfo(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws XMLSecurityException Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- the KeyInfo which is referred to by this KeyInfoReference, or null if can not be resolved
- Throws:
XMLSecurityException
-
validateReference
private void validateReference(Element referentElement, boolean secureValidation) throws XMLSecurityException Validate the Element referred to by the KeyInfoReference.- Parameters:
referentElement-secureValidation-- Throws:
XMLSecurityException
-
resolveInput
private XMLSignatureInput resolveInput(Attr uri, 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 Element obtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException, KeyResolverException Resolve the Element effectively represented by the XML signature input source.- Parameters:
resource-secureValidation-- Returns:
- the Element effectively represented by the XML signature input source.
- Throws:
CanonicalizationExceptionParserConfigurationExceptionIOExceptionSAXExceptionKeyResolverException
-