Module org.apache.santuario.xmlsec
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
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.protected PrivateKeyengineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePrivateKeyprotected PublicKeyengineResolvePublicKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePublicKeyengineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveSecretKeyprotected X509CertificateengineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveCertificateprivate 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, boolean secureValidation) 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, boolean secureValidation) Retrieves a PublicKey from the given informationMethods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineLookupAndResolvePrivateKey, engineLookupAndResolvePublicKey, engineLookupAndResolveSecretKey, engineLookupResolveX509Certificate, getDocFromBytes
-
Field Details
-
LOG
-
-
Constructor Details
-
RetrievalMethodResolver
public RetrievalMethodResolver()
-
-
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) Method engineResolvePublicKey- Specified by:
engineResolvePublicKeyin classKeyResolverSpi- Returns:
- resolved public key from the registered from the element.
-
engineResolveX509Certificate
protected X509Certificate engineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveCertificate- Specified by:
engineResolveX509Certificatein classKeyResolverSpi- Returns:
- resolved X509Certificate key from the registered from the elements
-
resolveCertificate
private static X509Certificate resolveCertificate(Element e, String baseURI, StorageResolver storage, boolean secureValidation) 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, boolean secureValidation) throws KeyResolverException Retrieves a PublicKey from the given information- Parameters:
e-baseURI-storage-secureValidation-- Returns:
- a PublicKey from the given information
- Throws:
KeyResolverException
-
obtainReferenceElement
private static Element obtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) throws CanonicalizationException, XMLParserException, IOException, 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
-
engineResolveSecretKey
public SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveSecretKey- Specified by:
engineResolveSecretKeyin classKeyResolverSpi- Returns:
- resolved SecretKey key from the registered from the elements
-
engineResolvePrivateKey
protected PrivateKey engineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePrivateKey- Specified by:
engineResolvePrivateKeyin classKeyResolverSpi- Returns:
- resolved PrivateKey key from the registered from the elements
-
getDocumentElement
-