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 KeyResolverSpi
globalResolver, properties, secureValidation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanengineCanResolve(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 ElementobtainReferenceElement(XMLSignatureInput resource) 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) Resolve the KeyInfoReference Element's URI attribute into a KeyInfo instance.private voidvalidateReference(Element referentElement) Validate the Element referred to by the KeyInfoReference.
-
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:
engineCanResolvein 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:
engineLookupAndResolvePublicKeyin 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:
engineLookupResolveX509Certificatein 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:
engineLookupAndResolveSecretKeyin 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:
engineLookupAndResolvePrivateKeyin 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:
CanonicalizationExceptionParserConfigurationExceptionIOExceptionSAXExceptionKeyResolverException
-