Package org.apache.xml.security.keys.keyresolver

Examples of org.apache.xml.security.keys.keyresolver.KeyResolver


    * @throws KeyResolverException
    */
   PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException {

      for (int i = 0; i < KeyResolver.length(); i++) {
         KeyResolver keyResolver = KeyResolver.item(i);
         Node currentChild=this._constructionElement.getFirstChild();
         while (currentChild!=null)      {      
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
               if (this._storageResolvers.size() == 0) {

                  // if we do not have storage resolvers, we verify with null
                  StorageResolver storage = null;

                  if (keyResolver.canResolve((Element) currentChild,
                                             this.getBaseURI(), storage)) {
                     PublicKey pk =
                        keyResolver.resolvePublicKey((Element) currentChild,
                                                     this.getBaseURI(),
                                                     storage);

                     if (pk != null) {
                        return pk;
                     }
                  }
               } else {
                  for (int k = 0; k < this._storageResolvers.size(); k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     if (keyResolver.canResolve((Element) currentChild,
                                                this.getBaseURI(), storage)) {
                        PublicKey pk =
                           keyResolver.resolvePublicKey((Element) currentChild,
                                                        this.getBaseURI(),
                                                        storage);

                        if (pk != null) {
                           return pk;
View Full Code Here


      if (log.isDebugEnabled())
        log.debug("Start getX509CertificateFromStaticResolvers() with "
                + KeyResolver.length() + " resolvers");

      for (int i = 0; i < KeyResolver.length(); i++) {
         KeyResolver keyResolver = KeyResolver.item(i);
         Node currentChild=this._constructionElement.getFirstChild();
         while (currentChild!=null)      {      
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
               if (this._storageResolvers.size() == 0) {

                  // if we do not have storage resolvers, we verify with null
                  StorageResolver storage = null;

                  if (keyResolver.canResolve((Element) currentChild,
                                             this.getBaseURI(), storage)) {
                     X509Certificate cert =
                        keyResolver
                           .resolveX509Certificate((Element) currentChild, this
                              .getBaseURI(), storage);

                     if (cert != null) {
                        return cert;
                     }
                  }
               } else {
                  for (int k = 0; k < this._storageResolvers.size(); k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     if (keyResolver.canResolve((Element) currentChild,
                                                this.getBaseURI(), storage)) {
                        X509Certificate cert = keyResolver
                           .resolveX509Certificate((Element) currentChild, this
                              .getBaseURI(), storage);

                        if (cert != null) {
                           return cert;
View Full Code Here

    */

   SecretKey getSecretKeyFromStaticResolvers() throws KeyResolverException {

      for (int i = 0; i < KeyResolver.length(); i++) {
         KeyResolver keyResolver = KeyResolver.item(i);

         Node currentChild=this._constructionElement.getFirstChild();
         while (currentChild!=null)      {   
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
               if (this._storageResolvers.size() == 0) {

                  // if we do not have storage resolvers, we verify with null
                  StorageResolver storage = null;

                  if (keyResolver.canResolve((Element) currentChild,
                                             this.getBaseURI(), storage)) {
                     SecretKey sk  =
                        keyResolver.resolveSecretKey((Element) currentChild,
                                                     this.getBaseURI(),
                                                     storage);

                     if (sk != null) {
                        return sk;
                     }
                  }
               } else {
                  for (int k = 0; k < this._storageResolvers.size(); k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     if (keyResolver.canResolve((Element) currentChild,
                                                this.getBaseURI(), storage)) {
                        SecretKey sk =
                           keyResolver.resolveSecretKey((Element) currentChild,
                                                        this.getBaseURI(),
                                                        storage);

                        if (sk != null) {
                           return sk;
View Full Code Here

TOP

Related Classes of org.apache.xml.security.keys.keyresolver.KeyResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.