Examples of newKeyInfo()


Examples of com.sun.xml.ws.security.opt.crypto.jaxb.JAXBSignatureFactory.newKeyInfo()

            }else{
                throw new WSTrustException("Unsupported PublicKey");
            }
           
            // Create a KeyInfo and add the KeyValue to it
            final javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo = signatureFactory.newKeyInfo(Collections.singletonList(keyValue));
            final JAXBSignContext signContext = new JAXBSignContext(signingKey);
           
            final SSEData data = null;
            signContext.setURIDereferencer(new DSigResolver(data));
            final com.sun.xml.ws.security.opt.crypto.dsig.Signature signature = (Signature) signatureFactory.newXMLSignature(signedInfo,keyInfo);
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

       
        rsaKeyPair = KeyPairGenerator.getInstance("RSA").genKeyPair();
        ecKeyPair = KeyPairGenerator.getInstance("EC").genKeyPair();
       
        KeyInfoFactory kifac = fac.getKeyInfoFactory();
        rsaki = kifac.newKeyInfo(Collections.singletonList
                                 (kifac.newKeyValue(rsaKeyPair.getPublic())));
        ecki = kifac.newKeyInfo(Collections.singletonList
                                (kifac.newKeyValue(ecKeyPair.getPublic())));
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        ecKeyPair = KeyPairGenerator.getInstance("EC").genKeyPair();
       
        KeyInfoFactory kifac = fac.getKeyInfoFactory();
        rsaki = kifac.newKeyInfo(Collections.singletonList
                                 (kifac.newKeyValue(rsaKeyPair.getPublic())));
        ecki = kifac.newKeyInfo(Collections.singletonList
                                (kifac.newKeyValue(ecKeyPair.getPublic())));
    }

    @org.junit.Test
    public void testRSA_SHA1() throws Exception {
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        sha3_512 = fac.newDigestMethod("http://www.w3.org/2007/05/xmldsig-more#sha3-512", null);
       
        rsaSha1 = fac.newSignatureMethod
            ("http://www.w3.org/2000/09/xmldsig#rsa-sha1", null);
       
        rsaki = kifac.newKeyInfo(Collections.singletonList
                                 (kifac.newKeyValue(
                                  TestUtils.getPublicKey("RSA"))));
       
        kvks = new KeySelectors.KeyValueKeySelector();
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

            SignatureMethod signatureMethod = fac.newSignatureMethod(signatureMethodString, null);
            SignedInfo si = fac.newSignedInfo(canonicalizationMethod, signatureMethod, referenceList);

            KeyInfoFactory kif = fac.getKeyInfoFactory();
            KeyValue kv = kif.newKeyValue(publicKey);
            KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));

            XMLSignature signature = fac.newXMLSignature(si, ki);

            signature.sign(dsc);
        } catch (XMLSignatureException e) {
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

       
        rsaKeyPair = KeyPairGenerator.getInstance("RSA").genKeyPair();
        ecKeyPair = KeyPairGenerator.getInstance("EC").genKeyPair();
       
        KeyInfoFactory kifac = fac.getKeyInfoFactory();
        rsaki = kifac.newKeyInfo(Collections.singletonList
                                 (kifac.newKeyValue(rsaKeyPair.getPublic())));
    }

    @org.junit.Test
    public void testRSA_SHA1() throws Exception {
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        ripemd160 = fac.newDigestMethod(DigestMethod.RIPEMD160, null);
       
        rsaSha1 = fac.newSignatureMethod
            ("http://www.w3.org/2000/09/xmldsig#rsa-sha1", null);
       
        rsaki = kifac.newKeyInfo(Collections.singletonList
                                 (kifac.newKeyValue(
                                  TestUtils.getPublicKey("RSA"))));
       
        kvks = new KeySelectors.KeyValueKeySelector();
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

         SignatureMethod signatureMethod = fac.newSignatureMethod(signatureMethodString, null);
         SignedInfo si = fac.newSignedInfo(canonicalizationMethod, signatureMethod, referenceList);

         KeyInfoFactory kif = fac.getKeyInfoFactory();
         KeyValue kv = kif.newKeyValue(publicKey);
         KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));

         XMLSignature signature = fac.newXMLSignature(si, ki);

         signature.sign(dsc);
      }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        KeyInfoFactory kif = fac.getKeyInfoFactory();
        List<Object> x509Content = new ArrayList();
        x509Content.add(cert.getSubjectX500Principal().getName());
        x509Content.add(cert);
        X509Data xd = kif.newX509Data(x509Content);
        ki = kif.newKeyInfo(Collections.singletonList(xd));    

       
       
        DOMSignContext dsc = new DOMSignContext
            (keyEntry.getPrivateKey(), document.getDocumentElement());
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

     KeyInfoFactory kif = fac.getKeyInfoFactory();
     List<Object> x509Content = new ArrayList();
     x509Content.add(cert.getSubjectX500Principal().getName());
     x509Content.add(cert);
     X509Data xd = kif.newX509Data(x509Content);
     KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));    
    
  // Instantiate the document to be signed.
     DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
     dbf.setNamespaceAware(true);
     Document doc = dbf.newDocumentBuilder().parse
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.