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

public class EncryptedKeyResolver extends org.apache.xml.security.keys.keyresolver.KeyResolverSpi
The EncryptedKeyResolver is not a generic resolver. It can only be for specific instantiations, as the key being unwrapped will always be of a particular type and will always have been wrapped by another key which needs to be recursively resolved. The EncryptedKeyResolver can therefore only be instantiated with an algorithm. It can also be instantiated with a key (the KEK) or will search the static KeyResolvers to find the appropriate key.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EncryptedKeyResolver(String algorithm, Key kek, List<org.apache.xml.security.keys.keyresolver.KeyResolverSpi> internalKeyResolvers)
    Constructor used for when a KEK has been set
    EncryptedKeyResolver(String algorithm, List<org.apache.xml.security.keys.keyresolver.KeyResolverSpi> internalKeyResolvers)
    Constructor for use when a KEK needs to be derived from a KeyInfo list
  • 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.
    protected PrivateKey
    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

    • EncryptedKeyResolver

      public EncryptedKeyResolver(String algorithm, List<org.apache.xml.security.keys.keyresolver.KeyResolverSpi> internalKeyResolvers)
      Constructor for use when a KEK needs to be derived from a KeyInfo list
      Parameters:
      algorithm -
      internalKeyResolvers -
    • EncryptedKeyResolver

      public EncryptedKeyResolver(String algorithm, Key kek, List<org.apache.xml.security.keys.keyresolver.KeyResolverSpi> internalKeyResolvers)
      Constructor used for when a KEK has been set
      Parameters:
      algorithm -
      kek -
      internalKeyResolvers -
  • 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)
      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.
    • engineResolveX509Certificate

      protected X509Certificate engineResolveX509Certificate(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
      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
    • engineResolveSecretKey

      protected SecretKey engineResolveSecretKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
      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
    • engineResolvePrivateKey

      protected PrivateKey engineResolvePrivateKey(Element element, String baseURI, org.apache.xml.security.keys.storage.StorageResolver storage, boolean secureValidation)
      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