Package org.apache.xml.security.keys.storage

Examples of org.apache.xml.security.keys.storage.StorageResolver


            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.elementAt(k);

                     if (keyResolver.engineCanResolve((Element) currentChild,
                                                      this.getBaseURI(),
                                                      storage)) {
View Full Code Here


            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.elementAt(k);

                     if (keyResolver.canResolve((Element) currentChild,
                                                this.getBaseURI(), storage)) {
                        SecretKey sk =
View Full Code Here

            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.elementAt(k);

                     if (keyResolver.engineCanResolve((Element) currentChild,
                                                      this.getBaseURI(),
                                                      storage)) {
View Full Code Here

        X509Certificate cert = (X509Certificate)ks.getCertificate("rsakey");
        PublicKey publicKey = cert.getPublicKey();
        PrivateKey privateKey = (PrivateKey) ks.getKey("rsakey", pwd);
        SecretKey secretKey = (SecretKey) ks.getKey("des3key", pwd);

        StorageResolver storage = new StorageResolver(new KeyStoreResolver(ks));
        KeyResolverSpi privateKeyResolver = new PrivateKeyResolver(ks, pwd);
        KeyResolverSpi secretKeyResolver = new SecretKeyResolver(ks, pwd);

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
View Full Code Here

      dbf.setNamespaceAware(true);
      documentBuilder = dbf.newDocumentBuilder();
     
      certControl = loadCertificate("cert-X509Digest.crt");
     
      storageResolver = new StorageResolver(new SingleCertificateResolver(certControl));
     
      if (!Init.isInitialized()) {
        Init.init();
      }
    }
View Full Code Here

        FileInputStream inStream2 = new FileInputStream(inputDir + SEP + "keystore2.jks");
        KeyStore ks2 = KeyStore.getInstance("JCEKS");
        ks2.load(inStream2, "xmlsecurity".toCharArray());

        StorageResolver storage = new StorageResolver(ks);
        storage.add(ks2);

        Iterator<?> iter = storage.getIterator();
        checkIterator(iter);

        // check new iterator starts from the beginning
        Iterator<?> iter2 = storage.getIterator();
        checkIterator(iter2);

        // check the iterators are independent
        // check calling next() without calling hasNext()
        iter = storage.getIterator();
        iter2 = storage.getIterator();

        while (iter.hasNext()) {
            X509Certificate cert = (X509Certificate) iter.next();
            X509Certificate cert2 = (X509Certificate) iter2.next();
            if (!cert.equals(cert2)) {
View Full Code Here

        dbf.setNamespaceAware(true);
        documentBuilder = dbf.newDocumentBuilder();

        certControl = loadCertificate("cert-X509Digest.crt");

        storageResolver = new StorageResolver(new SingleCertificateResolver(certControl));

        if (!Init.isInitialized()) {
            Init.init();
        }
    }
View Full Code Here

         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 =
View Full Code Here

         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)) {
View Full Code Here

         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
View Full Code Here

TOP

Related Classes of org.apache.xml.security.keys.storage.StorageResolver

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.