FileDocCategorySizeDatePackage
KeyResolverSpi.javaAPI DocJava SE 6 API4903Tue Jun 10 00:23:02 BST 2008com.sun.org.apache.xml.internal.security.keys.keyresolver

KeyResolverSpi

public abstract class KeyResolverSpi extends Object
This class is abstract class for a child KeyInfo Elemnet. If you want the your KeyResolver, at firstly you must extand this class, and register as following in config.xml
<KeyResolver URI="http://www.w3.org/2000/09/xmldsig#KeyValue"
JAVACLASS="MyPackage.MyKeyValueImpl"//gt;
author
$Author: raul $
version
$Revision: 1.11 $

Fields Summary
static Logger
log
{@link java.util.logging} logging facility
protected Map
_properties
Field _properties
Constructors Summary
Methods Summary
public abstract booleanengineCanResolve(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)
This method helps the {@link com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver} to decide whether a {@link com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi} is able to perform the requested action.

param
element
param
BaseURI
param
storage
return
true if can resolve the key in the element

public java.lang.StringengineGetProperty(java.lang.String key)
Method engineGetProperty

param
key
return
obtain the property appointed by key


      java.util.Iterator i = this._properties.keySet().iterator();

      while (i.hasNext()) {
         String c = (String) i.next();

         if (c.equals(key)) {
            key = c;

            break;
         }
      }

      return (String) this._properties.get(key);
   
public java.lang.String[]engineGetPropertyKeys()
Method engineGetPropertyKeys

return
the keys of properties known by this resolver

      return new String[0];
   
public abstract java.security.PublicKeyengineResolvePublicKey(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)
Method engineResolvePublicKey

param
element
param
BaseURI
param
storage
return
resolved public key from the registered from the element.
throws
KeyResolverException

public abstract javax.crypto.SecretKeyengineResolveSecretKey(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)
Method engineResolveSecretKey

param
element
param
BaseURI
param
storage
return
resolved SecretKey key from the registered from the elements
throws
KeyResolverException

public abstract java.security.cert.X509CertificateengineResolveX509Certificate(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)
Method engineResolveCertificate

param
element
param
BaseURI
param
storage
return
resolved X509Certificate key from the registered from the elements
throws
KeyResolverException

public voidengineSetProperty(java.lang.String key, java.lang.String value)
Method engineSetProperty

param
key
param
value


             
         

      java.util.Iterator i = this._properties.keySet().iterator();

      while (i.hasNext()) {
         String c = (String) i.next();

         if (c.equals(key)) {
            key = c;

            break;
         }
      }

      this._properties.put(key, value);
   
public booleanunderstandsProperty(java.lang.String propertyToTest)
Method understandsProperty

param
propertyToTest
return
true if understood the property


      String[] understood = this.engineGetPropertyKeys();

      if (understood != null) {
         for (int i = 0; i < understood.length; i++) {
            if (understood[i].equals(propertyToTest)) {
               return true;
            }
         }
      }

      return false;