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

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


   private X509Certificate applyCurrentResolver(String uri, int storageLength, KeyResolverSpi keyResolver) throws KeyResolverException {
     Node currentChild=this._constructionElement.getFirstChild();
     while (currentChild!=null)      {      
       if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
         for (int k = 0; k < storageLength; k++) {
             StorageResolver storage =
                (StorageResolver) this._storageResolvers.get(k);

             X509Certificate cert = keyResolver
                  .engineLookupResolveX509Certificate((Element) currentChild, uri,
                      storage);
View Full Code Here


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

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

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

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

   private X509Certificate applyCurrentResolver(String uri, int storageLength, KeyResolverSpi keyResolver) throws KeyResolverException {
     Node currentChild=this._constructionElement.getFirstChild();
     while (currentChild!=null)      {      
       if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
         for (int k = 0; k < storageLength; k++) {
             StorageResolver storage =
                (StorageResolver) this._storageResolvers.get(k);

             X509Certificate cert = keyResolver
                  .engineLookupResolveX509Certificate((Element) currentChild, uri,
                      storage);
View Full Code Here

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

         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);
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);
   
    // iterate directly on the storage
    int count = 0;
    while (storage.hasNext()) {
      X509Certificate cert = storage.next();
      assertNotNull(cert);
      count++;
    }

    assertEquals(4, count);
   
    try {
      storage.next();
      fail("Expecting NoSuchElementException");
    } catch (NoSuchElementException e) {
    }

    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

            //Get the KeyInfo object, which might contain some clues as to what
            //key was used to create the signature. It might also contain the
            //full cert.
            KeyInfo ki = signature.getKeyInfo();

            ki.addStorageResolver(new StorageResolver(new org.apache.xml
               .security.keys.storage.implementations
               .CertsInFilesystemDirectoryResolver(merlinsDir + "certs")));

            if (ki != null) {
View Full Code Here

TOP

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

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.