Class SecretKeyResolver
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolverSpi
-
- org.apache.xml.security.keys.keyresolver.implementations.SecretKeyResolver
-
public class SecretKeyResolver extends KeyResolverSpi
Resolves a SecretKey within a KeyStore based on the KeyName. The KeyName is the key entry alias within the KeyStore.
-
-
Field Summary
Fields Modifier and Type Field Description private java.security.KeyStorekeyStoreprivate static org.slf4j.LoggerLOGprivate char[]password-
Fields inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
globalResolver, properties, secureValidation
-
-
Constructor Summary
Constructors Constructor Description SecretKeyResolver(java.security.KeyStore keyStore, char[] password)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanengineCanResolve(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)This method returns whether the KeyResolverSpi is able to perform the requested action.java.security.PrivateKeyengineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolvePrivateKey Method engineLookupAndResolvePrivateKeyjava.security.PublicKeyengineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineLookupAndResolvePublicKeyjava.security.cert.X509CertificateengineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolveX509Certificate Method engineLookupResolveX509Certificatejavax.crypto.SecretKeyengineResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolveSecretKey-
Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineGetProperty, engineLookupAndResolveSecretKey, engineResolvePublicKey, engineResolveX509Certificate, engineSetProperty, getDocFromBytes, setGlobalResolver, setSecureValidation, understandsProperty
-
-
-
-
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:
engineCanResolvein classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineLookupAndResolvePublicKey
public java.security.PublicKey engineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineLookupAndResolvePublicKey- Overrides:
engineLookupAndResolvePublicKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- null if no
PublicKeycould be obtained - Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public java.security.cert.X509Certificate engineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineResolveX509Certificate Method engineLookupResolveX509Certificate- Overrides:
engineLookupResolveX509Certificatein classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolveSecretKey
public javax.crypto.SecretKey engineResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineResolveSecretKey- Overrides:
engineResolveSecretKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved SecretKey key or null if no
SecretKeycould be obtained - Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public java.security.PrivateKey engineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineResolvePrivateKey Method engineLookupAndResolvePrivateKey- Overrides:
engineLookupAndResolvePrivateKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved PrivateKey key or null if no
PrivateKeycould be obtained - Throws:
KeyResolverException
-
-