Class SingleKeyResolver
java.lang.Object
org.apache.xml.security.keys.keyresolver.KeyResolverSpi
org.apache.xml.security.keys.keyresolver.implementations.SingleKeyResolver
Resolves a single Key based on the KeyName.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate static final org.slf4j.Loggerprivate PrivateKeyprivate PublicKeyprivate SecretKeyFields inherited from class KeyResolverSpi
globalResolver, properties, secureValidation -
Constructor Summary
ConstructorsConstructorDescriptionSingleKeyResolver(String keyName, PrivateKey privateKey) Constructor.SingleKeyResolver(String keyName, PublicKey publicKey) Constructor.SingleKeyResolver(String keyName, SecretKey secretKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanengineCanResolve(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 engineResolveSecretKey
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
keyName
-
publicKey
-
privateKey
-
secretKey
-
-
Constructor Details
-
SingleKeyResolver
-
SingleKeyResolver
Constructor.- Parameters:
keyName-privateKey-
-
SingleKeyResolver
-
-
Method Details
-
engineCanResolve
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 PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineLookupAndResolvePublicKey- Overrides:
engineLookupAndResolvePublicKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- null if no
PublicKeycould be obtained - Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineResolveX509Certificate Method engineLookupResolveX509Certificate- Overrides:
engineLookupResolveX509Certificatein 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:
engineResolveSecretKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved SecretKey key or null if no
SecretKeycould be obtained - Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public PrivateKey engineLookupAndResolvePrivateKey(Element element, String baseURI, StorageResolver storage) throws KeyResolverException Method engineResolvePrivateKey Method engineLookupAndResolvePrivateKey- Overrides:
engineLookupAndResolvePrivateKeyin classKeyResolverSpi- Parameters:
element-baseURI-storage-- Returns:
- resolved PrivateKey key or null if no
PrivateKeycould be obtained - Throws:
KeyResolverException
-