Class RetrievalMethodResolver
java.lang.Object
org.apache.xml.security.keys.keyresolver.KeyResolverSpi
org.apache.xml.security.keys.keyresolver.implementations.RetrievalMethodResolver
The RetrievalMethodResolver can retrieve public keys and certificates from
other locations. The location is specified using the ds:RetrievalMethod
element which points to the location. This includes the handling of raw
(binary) X.509 certificate which are not encapsulated in an XML structure.
If the retrieval process encounters an element which the
RetrievalMethodResolver cannot handle itself, resolving of the extracted
element is delegated back to the KeyResolver mechanism.
-
Field Summary
FieldsFields inherited from class KeyResolverSpi
globalResolver, properties, secureValidation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionengineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage) Method engineResolvePublicKey Method engineLookupAndResolvePublicKeyengineLookupAndResolveSecretKey(Element element, String baseURI, StorageResolver storage) Method engineResolveSecretKey Method engineLookupAndResolveSecretKeyengineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage) Method engineResolveX509Certificate Method engineLookupResolveX509Certificateprivate static ElementgetDocumentElement(Set<Node> set) private static X509CertificategetRawCertificate(XMLSignatureInput resource) private static ElementobtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) private static X509CertificateresolveCertificate(Element e, String baseURI, StorageResolver storage) Retrieves a x509Certificate from the given informationprivate static XMLSignatureInputresolveInput(RetrievalMethod rm, String baseURI, boolean secureValidation) Resolves the input from the given retrieval methodprivate static PublicKeyresolveKey(Element e, String baseURI, StorageResolver storage) Retrieves a PublicKey from the given information
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
RetrievalMethodResolver
public RetrievalMethodResolver()
-
-
Method Details
-
engineLookupAndResolvePublicKey
public PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage) Method engineResolvePublicKey Method engineLookupAndResolvePublicKey- Overrides:
engineLookupAndResolvePublicKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved public key from the registered from the element.
-
engineLookupResolveX509Certificate
public X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage) Method engineResolveX509Certificate Method engineLookupResolveX509Certificate- Overrides:
engineLookupResolveX509Certificatein classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved X509Certificate key from the registered from the elements
-
resolveCertificate
private static X509Certificate resolveCertificate(Element e, String baseURI, StorageResolver storage) throws KeyResolverException Retrieves a x509Certificate from the given information- Parameters:
e-baseURI-storage-- Returns:
- a x509Certificate from the given information
- Throws:
KeyResolverException
-
resolveKey
private static PublicKey resolveKey(Element e, String baseURI, StorageResolver storage) throws KeyResolverException Retrieves a PublicKey from the given information- Parameters:
e-baseURI-storage-- Returns:
- a PublicKey from the given information
- Throws:
KeyResolverException
-
obtainReferenceElement
private static Element obtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException, KeyResolverException -
getRawCertificate
private static X509Certificate getRawCertificate(XMLSignatureInput resource) throws CanonicalizationException, IOException, CertificateException -
resolveInput
private static XMLSignatureInput resolveInput(RetrievalMethod rm, String baseURI, boolean secureValidation) throws XMLSecurityException Resolves the input from the given retrieval method- Returns:
- the input from the given retrieval method
- Throws:
XMLSecurityException
-
engineLookupAndResolveSecretKey
public SecretKey engineLookupAndResolveSecretKey(Element element, String baseURI, StorageResolver storage) Method engineResolveSecretKey Method engineLookupAndResolveSecretKey- Overrides:
engineLookupAndResolveSecretKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved SecretKey key from the registered from the elements
-
getDocumentElement
-