java.lang.Object
org.apache.xml.security.keys.keyresolver.KeyResolverSpi
org.apache.xml.security.keys.keyresolver.implementations.PrivateKeyResolver

public class PrivateKeyResolver extends org.apache.xml.security.keys.keyresolver.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 Summary

    Constructors
    Constructor
    Description
    PrivateKeyResolver(KeyStore keyStore, char[] password)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    engineCanResolve(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage)
    This method returns whether the KeyResolverSpi is able to perform the requested action.
    engineResolvePrivateKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
    Method engineResolvePrivateKey
    protected PublicKey
    engineResolvePublicKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
    Method engineResolvePublicKey
    protected SecretKey
    engineResolveSecretKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
    Method engineResolveSecretKey
    protected X509Certificate
    engineResolveX509Certificate(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
    Method engineResolveCertificate

    Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi

    engineLookupAndResolvePrivateKey, engineLookupAndResolvePublicKey, engineLookupAndResolveSecretKey, engineLookupResolveX509Certificate, getDocFromBytes

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrivateKeyResolver

      public PrivateKeyResolver(KeyStore keyStore, char[] password)
      Constructor.
  • Method Details

    • engineCanResolve

      protected boolean engineCanResolve(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage)
      This method returns whether the KeyResolverSpi is able to perform the requested action.
      Specified by:
      engineCanResolve in class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      Parameters:
      element -
      baseURI -
      storage -
      Returns:
      whether the KeyResolverSpi is able to perform the requested action.
    • engineResolvePublicKey

      protected PublicKey engineResolvePublicKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation) throws org.apache.xml.security.keys.keyresolver.KeyResolverException
      Method engineResolvePublicKey
      Specified by:
      engineResolvePublicKey in class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      Parameters:
      element -
      baseURI -
      storage -
      secureValidation -
      Returns:
      resolved public key from the registered from the element.
      Throws:
      org.apache.xml.security.keys.keyresolver.KeyResolverException
    • engineResolveX509Certificate

      protected X509Certificate engineResolveX509Certificate(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation) throws org.apache.xml.security.keys.keyresolver.KeyResolverException
      Method engineResolveCertificate
      Specified by:
      engineResolveX509Certificate in class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      Parameters:
      element -
      baseURI -
      storage -
      secureValidation -
      Returns:
      resolved X509Certificate key from the registered from the elements
      Throws:
      org.apache.xml.security.keys.keyresolver.KeyResolverException
    • engineResolveSecretKey

      protected SecretKey engineResolveSecretKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation) throws org.apache.xml.security.keys.keyresolver.KeyResolverException
      Method engineResolveSecretKey
      Specified by:
      engineResolveSecretKey in class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      Parameters:
      element -
      baseURI -
      storage -
      secureValidation -
      Returns:
      resolved SecretKey key from the registered from the elements
      Throws:
      org.apache.xml.security.keys.keyresolver.KeyResolverException
    • engineResolvePrivateKey

      public PrivateKey engineResolvePrivateKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation) throws org.apache.xml.security.keys.keyresolver.KeyResolverException
      Method engineResolvePrivateKey
      Specified by:
      engineResolvePrivateKey in class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      Parameters:
      element -
      baseURI -
      storage -
      secureValidation -
      Returns:
      resolved PrivateKey key from the registered from the elements
      Throws:
      org.apache.xml.security.keys.keyresolver.KeyResolverException