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

RSAKeyValueResolver

public class RSAKeyValueResolver extends KeyResolverSpi
author
$Author: raul $

Fields Summary
static Logger
log
{@link java.util.logging} logging facility
private Element
_rsaKeyElement
Field _rsaKeyElement
Constructors Summary
Methods Summary
public booleanengineCanResolve(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)

inheritDoc


     
        
                                     
   	  if (true)
   	  	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Can I resolve " + element.getTagName());

      if (element == null) {
         return false;
      }

      boolean isKeyValue = XMLUtils.elementIsInSignatureSpace(element,
                              Constants._TAG_KEYVALUE);
      boolean isRSAKeyValue = XMLUtils.elementIsInSignatureSpace(element,
                                 Constants._TAG_RSAKEYVALUE);

      if (isKeyValue) {                  
            this._rsaKeyElement = XMLUtils.selectDsNode(element.getFirstChild(),
                    Constants._TAG_RSAKEYVALUE, 0);

            if (this._rsaKeyElement != null) {
               return true;
            }         
      } else if (isRSAKeyValue) {

         // this trick is needed to allow the RetrievalMethodResolver to eat a
         // ds:RSAKeyValue directly (without KeyValue)
         this._rsaKeyElement = element;

         return true;
      }

      return false;
   
public java.security.PublicKeyengineResolvePublicKey(org.w3c.dom.Element element, java.lang.String BaseURI, com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver storage)

inheritDoc


      if (this._rsaKeyElement == null) {
         boolean weCanResolve = this.engineCanResolve(element, BaseURI,
                                   storage);

         if (!weCanResolve || (this._rsaKeyElement == null)) {
            return null;
         }
      }

      try {
         RSAKeyValue rsaKeyValue = new RSAKeyValue(this._rsaKeyElement,
                                                   BaseURI);

         return rsaKeyValue.getPublicKey();
      } catch (XMLSecurityException ex) {
         if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "XMLSecurityException", ex);
      }

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

inheritDoc

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

inheritDoc

      return null;