Class RetrievalMethodResolver


  • public class RetrievalMethodResolver
    extends KeyResolverSpi
    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 Detail

      • LOG

        private static final java.lang.System.Logger LOG
    • Constructor Detail

      • RetrievalMethodResolver

        public RetrievalMethodResolver()
    • Method Detail

      • engineCanResolve

        protected boolean engineCanResolve​(org.w3c.dom.Element element,
                                           java.lang.String baseURI,
                                           StorageResolver storage)
        This method returns whether the KeyResolverSpi is able to perform the requested action.
        Specified by:
        engineCanResolve in class KeyResolverSpi
        Returns:
        whether the KeyResolverSpi is able to perform the requested action.
      • engineResolvePublicKey

        protected java.security.PublicKey engineResolvePublicKey​(org.w3c.dom.Element element,
                                                                 java.lang.String baseURI,
                                                                 StorageResolver storage,
                                                                 boolean secureValidation)
        Method engineResolvePublicKey
        Specified by:
        engineResolvePublicKey in class KeyResolverSpi
        Returns:
        resolved public key from the registered from the element.
      • engineResolveX509Certificate

        protected java.security.cert.X509Certificate engineResolveX509Certificate​(org.w3c.dom.Element element,
                                                                                  java.lang.String baseURI,
                                                                                  StorageResolver storage,
                                                                                  boolean secureValidation)
        Method engineResolveCertificate
        Specified by:
        engineResolveX509Certificate in class KeyResolverSpi
        Returns:
        resolved X509Certificate key from the registered from the elements
      • resolveCertificate

        private static java.security.cert.X509Certificate resolveCertificate​(org.w3c.dom.Element e,
                                                                             java.lang.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 java.security.PublicKey resolveKey​(org.w3c.dom.Element e,
                                                          java.lang.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
      • engineResolveSecretKey

        public javax.crypto.SecretKey engineResolveSecretKey​(org.w3c.dom.Element element,
                                                             java.lang.String baseURI,
                                                             StorageResolver storage,
                                                             boolean secureValidation)
        Method engineResolveSecretKey
        Specified by:
        engineResolveSecretKey in class KeyResolverSpi
        Returns:
        resolved SecretKey key from the registered from the elements
      • engineResolvePrivateKey

        protected java.security.PrivateKey engineResolvePrivateKey​(org.w3c.dom.Element element,
                                                                   java.lang.String baseURI,
                                                                   StorageResolver storage,
                                                                   boolean secureValidation)
        Method engineResolvePrivateKey
        Specified by:
        engineResolvePrivateKey in class KeyResolverSpi
        Returns:
        resolved PrivateKey key from the registered from the elements
      • getDocumentElement

        private static org.w3c.dom.Element getDocumentElement​(java.util.Set<org.w3c.dom.Node> set)