Class PrivateKeyResolver
java.lang.Object
org.apache.xml.security.keys.keyresolver.KeyResolverSpi
org.apache.xml.security.keys.keyresolver.implementations.PrivateKeyResolver
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 Summary
Fields inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
globalResolver, properties, secureValidation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
engineCanResolve
(Element element, String baseURI, StorageResolver storage) This method returns whether the KeyResolverSpi is able to perform the requested action.engineLookupAndResolvePrivateKey
(Element element, String baseURI, StorageResolver storage) Method engineResolvePrivateKey Method engineLookupAndResolvePrivateKeyengineLookupAndResolvePublicKey
(Element element, String baseURI, StorageResolver storage) Method engineLookupAndResolvePublicKeyengineLookupResolveX509Certificate
(Element element, String baseURI, StorageResolver storage) Method engineResolveX509Certificate Method engineLookupResolveX509CertificateengineResolveSecretKey
(Element element, String baseURI, StorageResolver storage) Method engineResolveSecretKeyMethods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineGetProperty, engineLookupAndResolveSecretKey, engineResolvePublicKey, engineResolveX509Certificate, engineSetProperty, getDocFromBytes, setGlobalResolver, setSecureValidation, understandsProperty
-
Constructor Details
-
PrivateKeyResolver
Constructor.
-
-
Method Details
-
engineCanResolve
This method returns whether the KeyResolverSpi is able to perform the requested action.- Overrides:
engineCanResolve
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineLookupAndResolvePublicKey
public PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineLookupAndResolvePublicKey- Overrides:
engineLookupAndResolvePublicKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- null if no
PublicKey
could be obtained - Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineResolveX509Certificate Method engineLookupResolveX509Certificate- Overrides:
engineLookupResolveX509Certificate
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolveSecretKey
public SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineResolveSecretKey- Overrides:
engineResolveSecretKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved SecretKey key or null if no
SecretKey
could be obtained - Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public PrivateKey engineLookupAndResolvePrivateKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineResolvePrivateKey Method engineLookupAndResolvePrivateKey- Overrides:
engineLookupAndResolvePrivateKey
in classKeyResolverSpi
- Parameters:
element
-baseURI
-storage
-- Returns:
- resolved PrivateKey key or null if no
PrivateKey
could be obtained - Throws:
KeyResolverException
-