Module org.apache.santuario.xmlsec
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
FieldsModifier and TypeFieldDescriptionprivate final KeyStoreprivate static final System.Loggerprivate final char[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanengineCanResolve(Element element, String baseURI, StorageResolver storage) This method returns whether the KeyResolverSpi is able to perform the requested action.engineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePrivateKeyprotected PublicKeyengineResolvePublicKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolvePublicKeyprotected SecretKeyengineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveSecretKeyprotected X509CertificateengineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) Method engineResolveCertificateprivate PrivateKeyresolveX509Certificate(XMLX509Certificate x509Cert) private PrivateKeyresolveX509Data(Element element, String baseURI) private PrivateKeyresolveX509IssuerSerial(XMLX509IssuerSerial x509Serial) private PrivateKeyresolveX509SKI(XMLX509SKI x509SKI) private PrivateKeyresolveX509SubjectName(XMLX509SubjectName x509SubjectName) Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineLookupAndResolvePrivateKey, engineLookupAndResolvePublicKey, engineLookupAndResolveSecretKey, engineLookupResolveX509Certificate, getDocFromBytes
-
Field Details
-
LOG
-
keyStore
-
password
private final char[] password
-
-
Constructor Details
-
PrivateKeyResolver
Constructor.
-
-
Method Details
-
engineCanResolve
This method returns whether the KeyResolverSpi is able to perform the requested action.- Specified by:
engineCanResolvein classKeyResolverSpi- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineResolvePublicKey
protected PublicKey engineResolvePublicKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolvePublicKey- Specified by:
engineResolvePublicKeyin classKeyResolverSpi- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineResolveX509Certificate
protected X509Certificate engineResolveX509Certificate(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolveCertificate- Specified by:
engineResolveX509Certificatein classKeyResolverSpi- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolveSecretKey
protected SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolveSecretKey- Specified by:
engineResolveSecretKeyin classKeyResolverSpi- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolvePrivateKey
public PrivateKey engineResolvePrivateKey(Element element, String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverException Method engineResolvePrivateKey- Specified by:
engineResolvePrivateKeyin classKeyResolverSpi- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
resolveX509Data
-
resolveX509SKI
private PrivateKey resolveX509SKI(XMLX509SKI x509SKI) throws XMLSecurityException, KeyStoreException -
resolveX509IssuerSerial
- Throws:
KeyStoreException
-
resolveX509SubjectName
private PrivateKey resolveX509SubjectName(XMLX509SubjectName x509SubjectName) throws KeyStoreException - Throws:
KeyStoreException
-
resolveX509Certificate
private PrivateKey resolveX509Certificate(XMLX509Certificate x509Cert) throws XMLSecurityException, KeyStoreException
-