Class PrivateKeyResolver


  • public class PrivateKeyResolver
    extends KeyResolverSpi
    Resolves a PrivateKey within a KeyStore based on the KeyInfo hints. For X509Data hints, the certificate associated with the private key entry must match. For a KeyName hint, the KeyName must match the alias of a PrivateKey entry within the KeyStore.
    • Constructor Detail

      • PrivateKeyResolver

        public PrivateKeyResolver​(java.security.KeyStore keyStore,
                                  char[] password)
        Constructor.
    • Method Detail

      • engineCanResolve

        public 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.
        Overrides:
        engineCanResolve in class KeyResolverSpi
        Parameters:
        element -
        baseURI -
        storage -
        Returns:
        whether the KeyResolverSpi is able to perform the requested action.
      • engineLookupResolveX509Certificate

        public java.security.cert.X509Certificate engineLookupResolveX509Certificate​(org.w3c.dom.Element element,
                                                                                     java.lang.String baseURI,
                                                                                     StorageResolver storage)
                                                                              throws KeyResolverException
        Method engineResolveX509Certificate Method engineLookupResolveX509Certificate
        Overrides:
        engineLookupResolveX509Certificate in class KeyResolverSpi
        Parameters:
        element -
        baseURI -
        storage -
        Returns:
        resolved X509Certificate key from the registered from the elements
        Throws:
        KeyResolverException