Class KeyResolverSpi
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolverSpi
-
- Direct Known Subclasses:
DEREncodedKeyValueResolver,DSAKeyValueResolver,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 for a child 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;
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanglobalResolverprotected java.util.Map<java.lang.String,java.lang.String>propertiesField propertiesprotected booleansecureValidation
-
Constructor Summary
Constructors Constructor Description KeyResolverSpi()
-
Method Summary
All Methods Static 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.lang.StringengineGetProperty(java.lang.String key)Method engineGetPropertyjava.security.PrivateKeyengineLookupAndResolvePrivateKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineLookupAndResolvePrivateKeyjava.security.PublicKeyengineLookupAndResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineLookupAndResolvePublicKeyjavax.crypto.SecretKeyengineLookupAndResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineLookupAndResolveSecretKeyjava.security.cert.X509CertificateengineLookupResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineLookupResolveX509Certificatejava.security.PublicKeyengineResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolvePublicKeyjavax.crypto.SecretKeyengineResolveSecretKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolveSecretKeyjava.security.cert.X509CertificateengineResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage)Method engineResolveCertificatevoidengineSetProperty(java.lang.String key, java.lang.String value)Method engineSetPropertyprotected static org.w3c.dom.ElementgetDocFromBytes(byte[] bytes, boolean secureValidation)Parses a byte array and returns the parsed Element.voidsetGlobalResolver(boolean globalResolver)voidsetSecureValidation(boolean secureValidation)Set whether secure validation is enabled or not.booleanunderstandsProperty(java.lang.String propertyToTest)Method understandsProperty
-
-
-
Method Detail
-
setSecureValidation
public void setSecureValidation(boolean secureValidation)
Set whether secure validation is enabled or not. The default is false.
-
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.- Parameters:
element-baseURI-storage-- Returns:
- whether the KeyResolverSpi is able to perform the requested action.
-
engineResolvePublicKey
public java.security.PublicKey engineResolvePublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineResolvePublicKey- Parameters:
element-baseURI-storage-- 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) throws KeyResolverExceptionMethod engineLookupAndResolvePublicKey- Parameters:
element-baseURI-storage-- Returns:
- resolved public key from the registered from the element.
- Throws:
KeyResolverException
-
engineResolveX509Certificate
public java.security.cert.X509Certificate engineResolveX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage) throws KeyResolverExceptionMethod engineResolveCertificate- Parameters:
element-baseURI-storage-- 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) throws KeyResolverExceptionMethod engineLookupResolveX509Certificate- 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- Parameters:
element-baseURI-storage-- 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) throws KeyResolverExceptionMethod engineLookupAndResolveSecretKey- Parameters:
element-baseURI-storage-- Returns:
- resolved SecretKey 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) throws KeyResolverExceptionMethod engineLookupAndResolvePrivateKey- Parameters:
element-baseURI-storage-- Returns:
- resolved PrivateKey key from the registered from the elements
- Throws:
KeyResolverException
-
engineSetProperty
public void engineSetProperty(java.lang.String key, java.lang.String value)Method engineSetProperty- Parameters:
key-value-
-
engineGetProperty
public java.lang.String engineGetProperty(java.lang.String key)
Method engineGetProperty- Parameters:
key-- Returns:
- obtain the property appointed by key
-
understandsProperty
public boolean understandsProperty(java.lang.String propertyToTest)
Method understandsProperty- Parameters:
propertyToTest-- Returns:
- true if understood the property
-
setGlobalResolver
public void setGlobalResolver(boolean globalResolver)
-
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
-
-