Module org.apache.santuario.xmlsec
Class KeyResolverSpi
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolverSpi
-
- Direct Known Subclasses:
DEREncodedKeyValueResolver,DSAKeyValueResolver,ECKeyValueResolver,EncryptedKeyResolver,KeyInfoReferenceResolver,PrivateKeyResolver,RetrievalMethodResolver,RSAKeyValueResolver,SecretKeyResolver,SingleKeyResolver,X509CertificateResolver,X509DigestResolver,X509IssuerSerialResolver,X509SKIResolver,X509SubjectNameResolver
public abstract class KeyResolverSpi extends java.lang.ObjectThis class is an abstract class to resolve a Key of some kind given a KeyInfo element. If you want the your KeyResolver, at firstly you must extend this class, and register as following in config.xml<KeyResolver URI="http://www.w3.org/2000/09/xmldsig#KeyValue" JAVACLASS="MyPackage.MyKeyValueImpl"//gt;
Extensions of this class must be thread-safe.
-
-
Constructor Summary
Constructors Constructor Description KeyResolverSpi()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract 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, boolean secureValidation)Method engineLookupAndResolvePrivateKeyjava.security.PublicKeyengineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineLookupAndResolvePublicKeyjavax.crypto.SecretKeyengineLookupAndResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineLookupAndResolveSecretKeyjava.security.cert.X509CertificateengineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineLookupResolveX509Certificateprotected abstract java.security.PrivateKeyengineResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineResolvePrivateKeyprotected abstract java.security.PublicKeyengineResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineResolvePublicKeyprotected abstract javax.crypto.SecretKeyengineResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineResolveSecretKeyprotected abstract java.security.cert.X509CertificateengineResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method engineResolveCertificateprotected static org.w3c.dom.ElementgetDocFromBytes(byte[] bytes, boolean secureValidation)Parses a byte array and returns the parsed Element.
-
-
-
Method Detail
-
engineCanResolve
protected abstract 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.- Parameters:
element-baseURI-storage-- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineResolvePublicKey
protected abstract java.security.PublicKey engineResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineResolvePublicKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineLookupAndResolvePublicKey
public java.security.PublicKey engineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineLookupAndResolvePublicKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineResolveX509Certificate
protected abstract java.security.cert.X509Certificate engineResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineResolveCertificate- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupResolveX509Certificate
public java.security.cert.X509Certificate engineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineLookupResolveX509Certificate- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved X509Certificate key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolveSecretKey
protected abstract javax.crypto.SecretKey engineResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineResolveSecretKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolveSecretKey
public javax.crypto.SecretKey engineLookupAndResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineLookupAndResolveSecretKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineResolvePrivateKey
protected abstract java.security.PrivateKey engineResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineResolvePrivateKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineLookupAndResolvePrivateKey
public java.security.PrivateKey engineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod engineLookupAndResolvePrivateKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
getDocFromBytes
protected static org.w3c.dom.Element getDocFromBytes(byte[] bytes, boolean secureValidation) throws KeyResolverExceptionParses a byte array and returns the parsed Element.- Parameters:
bytes-- Returns:
- the Document Element after parsing bytes
- Throws:
KeyResolverException- if something goes wrong
-
-