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.
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • keyStore

        private java.security.KeyStore keyStore
      • password

        private char[] password
    • 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
      • resolveX509Data

        private java.security.PrivateKey resolveX509Data​(org.w3c.dom.Element element,
                                                         java.lang.String baseURI)
      • resolveX509IssuerSerial

        private java.security.PrivateKey resolveX509IssuerSerial​(XMLX509IssuerSerial x509Serial)
                                                          throws java.security.KeyStoreException
        Throws:
        java.security.KeyStoreException
      • resolveX509SubjectName

        private java.security.PrivateKey resolveX509SubjectName​(XMLX509SubjectName x509SubjectName)
                                                         throws java.security.KeyStoreException
        Throws:
        java.security.KeyStoreException