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

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


            Element kiElement = (Element) XPathAPI.selectSingleNode(doc,
                                   "//ds:KeyInfo[1]", nscontext);
            KeyInfo ki = new KeyInfo(kiElement,
                                     (new File(filename)).toURL().toString());
            StorageResolver storageResolver = new StorageResolver(
               new CertsInFilesystemDirectoryResolver(merlinsDir + "certs"));

            ki.addStorageResolver(storageResolver);

            PublicKey pk = ki.getPublicKey();
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);

        DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
        Document doc = db.newDocument();
View Full Code Here

    public X509DigestResolverTest() throws Exception {
        documentBuilder = XMLUtils.createDocumentBuilder(false);

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

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

        if (!Init.isInitialized()) {
            Init.init();
        }
    }
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);

        DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
        Document doc = db.newDocument();
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

            String uri = this.getBaseURI();
            while (currentChild != null)      {   
                if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                    // not using StorageResolvers at the moment
                    // since they cannot return private keys
                    StorageResolver storage = null;
                    PrivateKey pk =
                        keyResolver.engineLookupAndResolvePrivateKey(
                            (Element) currentChild, uri, storage
                        );
View Full Code Here

            String uri = this.getBaseURI();
            while (currentChild != null) {   
                if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                    // not using StorageResolvers at the moment
                    // since they cannot return private keys
                    StorageResolver storage = null;
                    PrivateKey pk =
                        keyResolver.engineLookupAndResolvePrivateKey(
                            (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);

        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

            Element kiElement = (Element) XPathAPI.selectSingleNode(doc,
                                   "//ds:KeyInfo[1]", nscontext);
            KeyInfo ki = new KeyInfo(kiElement,
                                     (new File(filename)).toURL().toString());
            StorageResolver storageResolver = new StorageResolver(
               new CertsInFilesystemDirectoryResolver(merlinsDir + "certs"));

            ki.addStorageResolver(storageResolver);

            PublicKey pk = ki.getPublicKey();
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

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.