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
FieldsFields inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
globalResolver, properties, secureValidation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
engineCanResolve
(Element element, String baseURI, StorageResolver storage) {This method returns whether the KeyResolverSpi is able to perform the requested action.engineLookupAndResolvePrivateKey
(Element element, String baseURI, StorageResolver storage) {Method engineLookupAndResolvePrivateKeyengineLookupAndResolvePublicKey
(Element element, String baseURI, StorageResolver storage) {Method engineLookupAndResolvePublicKeyengineLookupAndResolveSecretKey
(Element element, String baseURI, StorageResolver storage) {Method engineLookupAndResolveSecretKeyengineLookupResolveX509Certificate
(Element element, String baseURI, StorageResolver storage) {Method engineLookupResolveX509Certificateprivate Element
obtainReferenceElement
(XMLSignatureInput resource) Resolve the Element effectively represented by the XML signature input source.private XMLSignatureInput
resolveInput
(Attr uri, String baseURI, boolean secureValidation) Resolve the XML signature input represented by the specified URI.private KeyInfo
resolveReferentKeyInfo
(Element element, String baseURI, StorageResolver storage) Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.private void
validateReference
(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
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
KeyInfoReferenceResolver
public KeyInfoReferenceResolver()
-
-
Method Details
-
engineCanResolve
{This method returns whether the KeyResolverSpi is able to perform the requested action.}.- Overrides:
engineCanResolve
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineLookupAndResolvePublicKey
public PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException {Method engineLookupAndResolvePublicKey}.- Overrides:
engineLookupAndResolvePublicKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage) throws KeyResolverException {Method engineLookupResolveX509Certificate}.- Overrides:
engineLookupResolveX509Certificate
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolveSecretKey
public SecretKey engineLookupAndResolveSecretKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException {Method engineLookupAndResolveSecretKey}.- Overrides:
engineLookupAndResolveSecretKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public PrivateKey engineLookupAndResolvePrivateKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException {Method engineLookupAndResolvePrivateKey}.- Overrides:
engineLookupAndResolvePrivateKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
resolveReferentKeyInfo
private KeyInfo resolveReferentKeyInfo(Element element, 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
Validate the Element referred to by the KeyInfoReference.- Parameters:
referentElement
-- 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) throws CanonicalizationException, ParserConfigurationException, IOException, 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
ParserConfigurationException
IOException
SAXException
KeyResolverException
-