org.apache.xml.security.keys.keyresolver
Class KeyResolverSpi

java.lang.Object
  extended by 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 Object

This 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
protected  boolean globalResolver
           
protected  Map<String,String> properties
          Field properties
protected  boolean secureValidation
           
 
Constructor Summary
KeyResolverSpi()
           
 
Method Summary
 boolean engineCanResolve(Element element, String baseURI, StorageResolver storage)
          This method returns whether the KeyResolverSpi is able to perform the requested action.
 String engineGetProperty(String key)
          Method engineGetProperty
 PrivateKey engineLookupAndResolvePrivateKey(Element element, String baseURI, StorageResolver storage)
          Method engineLookupAndResolvePrivateKey
 PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage)
          Method engineLookupAndResolvePublicKey
 SecretKey engineLookupAndResolveSecretKey(Element element, String baseURI, StorageResolver storage)
          Method engineLookupAndResolveSecretKey
 X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage)
          Method engineLookupResolveX509Certificate
 PublicKey engineResolvePublicKey(Element element, String baseURI, StorageResolver storage)
          Method engineResolvePublicKey
 SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage)
          Method engineResolveSecretKey
 X509Certificate engineResolveX509Certificate(Element element, String baseURI, StorageResolver storage)
          Method engineResolveCertificate
 void engineSetProperty(String key, String value)
          Method engineSetProperty
 void setGlobalResolver(boolean globalResolver)
           
 void setSecureValidation(boolean secureValidation)
          Set whether secure validation is enabled or not.
 boolean understandsProperty(String propertyToTest)
          Method understandsProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected Map<String,String> properties
Field properties


globalResolver

protected boolean globalResolver

secureValidation

protected boolean secureValidation
Constructor Detail

KeyResolverSpi

public KeyResolverSpi()
Method Detail

setSecureValidation

public void setSecureValidation(boolean secureValidation)
Set whether secure validation is enabled or not. The default is false.


engineCanResolve

public boolean engineCanResolve(Element element,
                                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 PublicKey engineResolvePublicKey(Element element,
                                        String baseURI,
                                        StorageResolver storage)
                                 throws KeyResolverException
Method engineResolvePublicKey

Parameters:
element -
baseURI -
storage -
Returns:
resolved public key from the registered from the element.
Throws:
KeyResolverException

engineLookupAndResolvePublicKey

public PublicKey engineLookupAndResolvePublicKey(Element element,
                                                 String baseURI,
                                                 StorageResolver storage)
                                          throws KeyResolverException
Method engineLookupAndResolvePublicKey

Parameters:
element -
baseURI -
storage -
Returns:
resolved public key from the registered from the element.
Throws:
KeyResolverException

engineResolveX509Certificate

public X509Certificate engineResolveX509Certificate(Element element,
                                                    String baseURI,
                                                    StorageResolver storage)
                                             throws KeyResolverException
Method engineResolveCertificate

Parameters:
element -
baseURI -
storage -
Returns:
resolved X509Certificate key from the registered from the elements
Throws:
KeyResolverException

engineLookupResolveX509Certificate

public X509Certificate engineLookupResolveX509Certificate(Element element,
                                                          String baseURI,
                                                          StorageResolver storage)
                                                   throws KeyResolverException
Method engineLookupResolveX509Certificate

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

Parameters:
element -
baseURI -
storage -
Returns:
resolved SecretKey key from the registered from the elements
Throws:
KeyResolverException

engineLookupAndResolveSecretKey

public SecretKey engineLookupAndResolveSecretKey(Element element,
                                                 String baseURI,
                                                 StorageResolver storage)
                                          throws KeyResolverException
Method engineLookupAndResolveSecretKey

Parameters:
element -
baseURI -
storage -
Returns:
resolved SecretKey key from the registered from the elements
Throws:
KeyResolverException

engineLookupAndResolvePrivateKey

public PrivateKey engineLookupAndResolvePrivateKey(Element element,
                                                   String baseURI,
                                                   StorageResolver storage)
                                            throws KeyResolverException
Method engineLookupAndResolvePrivateKey

Parameters:
element -
baseURI -
storage -
Returns:
resolved PrivateKey key from the registered from the elements
Throws:
KeyResolverException

engineSetProperty

public void engineSetProperty(String key,
                              String value)
Method engineSetProperty

Parameters:
key -
value -

engineGetProperty

public String engineGetProperty(String key)
Method engineGetProperty

Parameters:
key -
Returns:
obtain the property appointed by key

understandsProperty

public boolean understandsProperty(String propertyToTest)
Method understandsProperty

Parameters:
propertyToTest -
Returns:
true if understood the property

setGlobalResolver

public void setGlobalResolver(boolean globalResolver)


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.