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

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


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

      for (int i = 0; i < this.lengthInternalKeyResolver(); i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());

         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.engineCanResolve((Element) currentChild,
                                                   this.getBaseURI(),
                                                   storage)) {
                     PublicKey pk =
                        keyResolver
                           .engineResolvePublicKey((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.engineCanResolve((Element) currentChild,
                                                      this.getBaseURI(),
                                                      storage)) {
                        PublicKey pk = keyResolver
                           .engineResolvePublicKey((Element) currentChild, this
                              .getBaseURI(), storage);

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


      if (log.isDebugEnabled())
        log.debug("Start getX509CertificateFromInternalResolvers() with "
                + this.lengthInternalKeyResolver() + " resolvers");

      for (int i = 0; i < this.lengthInternalKeyResolver(); i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());

         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.engineCanResolve((Element) currentChild,
                                                   this.getBaseURI(),
                                                   storage)) {
                     X509Certificate cert =
                        keyResolver.engineResolveX509Certificate(
                           (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.engineCanResolve((Element) currentChild,
                                                      this.getBaseURI(),
                                                      storage)) {
                        X509Certificate cert =
                           keyResolver.engineResolveX509Certificate(
                              (Element) currentChild, this.getBaseURI(),
                              storage);

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

    */

   SecretKey getSecretKeyFromInternalResolvers() throws KeyResolverException {

      for (int i = 0; i < this.lengthInternalKeyResolver(); i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());

         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.engineCanResolve((Element) currentChild,
                                                   this.getBaseURI(),
                                                   storage)) {
                     SecretKey sk =
                        keyResolver
                           .engineResolveSecretKey((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.engineCanResolve((Element) currentChild,
                                                      this.getBaseURI(),
                                                      storage)) {
                        SecretKey sk = keyResolver
                           .engineResolveSecretKey((Element) currentChild, this
                              .getBaseURI(), storage);

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

   PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException {
    int length=KeyResolver.length();
    int storageLength=this._storageResolvers.size();
    Iterator it= KeyResolver.iterator();
      for (int i = 0; i < length; i++) {
         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();
         Node currentChild=this._constructionElement.getFirstChild();
         String uri= this.getBaseURI();
         while (currentChild!=null)      {      
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {             
                  for (int k = 0; k < storageLength; k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     PublicKey pk =
                           keyResolver.engineLookupAndResolvePublicKey((Element) currentChild,
                                                       uri,
                                                        storage);

                     if (pk != null) {
                       KeyResolver.hit(it);
View Full Code Here

    */
   PublicKey getPublicKeyFromInternalResolvers() throws KeyResolverException {
    int length=lengthInternalKeyResolver();
    int storageLength=this._storageResolvers.size();
      for (int i = 0; i < length; i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());

         Node currentChild=this._constructionElement.getFirstChild();
         String uri=this.getBaseURI();
         while (currentChild!=null)      {   
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {              
               for (int k = 0; k < storageLength; k++) {
                   StorageResolver storage =
                      (StorageResolver) this._storageResolvers.get(k);
                   PublicKey pk = keyResolver
                           .engineLookupAndResolvePublicKey((Element) currentChild, uri, storage);

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

      String uri=this.getBaseURI();
      int length= KeyResolver.length();
      int storageLength=this._storageResolvers.size();  
      Iterator it = KeyResolver.iterator();
      for (int i = 0; i <length; i++) {
         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();
         X509Certificate cert= applyCurrentResolver(uri, storageLength, keyResolver);
         if (cert!=null) {
           KeyResolver.hit(it);
           return cert;
         }
View Full Code Here

        log.debug("Start getX509CertificateFromInternalResolvers() with "
                + this.lengthInternalKeyResolver() + " resolvers");
      String uri=this.getBaseURI();
      int storageLength=this._storageResolvers.size();
      for (int i = 0; i < this.lengthInternalKeyResolver(); i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());
         X509Certificate cert= applyCurrentResolver(uri, storageLength, keyResolver);
         if (cert!=null) {         
           return cert;
         }     
      }
View Full Code Here

   SecretKey getSecretKeyFromStaticResolvers() throws KeyResolverException {
    final int length=KeyResolver.length();
    int storageLength=this._storageResolvers.size();
    Iterator it = KeyResolver.iterator();
      for (int i = 0; i < length; i++) {
         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();

         Node currentChild=this._constructionElement.getFirstChild();
         String uri=this.getBaseURI();
         while (currentChild!=null)      {   
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {  
                  for (int k = 0; k < storageLength; k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     SecretKey sk =
                           keyResolver.engineLookupAndResolveSecretKey((Element) currentChild,
                                                        uri,
                                                        storage);

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

    */

   SecretKey getSecretKeyFromInternalResolvers() throws KeyResolverException {
     int storageLength=this._storageResolvers.size();
      for (int i = 0; i < this.lengthInternalKeyResolver(); i++) {
         KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i);
         if (log.isDebugEnabled())
           log.debug("Try " + keyResolver.getClass().getName());

         Node currentChild=this._constructionElement.getFirstChild();
         String uri=this.getBaseURI();
         while (currentChild!=null)      {   
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
               for (int k = 0; k < storageLength; k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     SecretKey sk = keyResolver
                           .engineLookupAndResolveSecretKey((Element) currentChild, uri, storage);

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

    */
   PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException {
    int length=KeyResolver.length();
    int storageLength=this._storageResolvers.size();
      for (int i = 0; i < length; i++) {
         KeyResolverSpi keyResolver = KeyResolver.item(i);
         Node currentChild=this._constructionElement.getFirstChild();
         String uri= this.getBaseURI();
         while (currentChild!=null)      {      
            if (currentChild.getNodeType() == Node.ELEMENT_NODE) {              
                  for (int k = 0; k < storageLength; k++) {
                     StorageResolver storage =
                        (StorageResolver) this._storageResolvers.get(k);

                     PublicKey pk =
                           keyResolver.engineLookupAndResolvePublicKey((Element) currentChild,
                                                       uri,
                                                        storage);

                     if (pk != null) {
                       KeyResolver.hit(i);
View Full Code Here

TOP

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

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.