Examples of SignedInfo


Examples of javax.xml.crypto.dsig.SignedInfo

         List<Reference> referenceList = Collections.singletonList(ref);

         String signatureMethodString = publicKey.getAlgorithm().equalsIgnoreCase("RSA") ? SignatureMethod.RSA_SHA1 : SignatureMethod.DSA_SHA1;
         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));

Examples of javax.xml.crypto.dsig.SignedInfo

            } else {
                key = userCrypto.getPrivateKey(user, password);
            }
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
                    signedInfo,
                    keyInfo,

Examples of javax.xml.crypto.dsig.SignedInfo

        try {
            java.security.Key key =
                WSSecurityUtil.prepareSecretKey(sigAlgo, derivedKeyBytes);
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
                    signedInfo,
                    keyInfo,

Examples of javax.xml.crypto.dsig.SignedInfo

            } else {
                key = WSSecurityUtil.prepareSecretKey(sigAlgo, secretKey);
            }
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
                    signedInfo,
                    keyInfo,

Examples of javax.xml.crypto.dsig.SignedInfo

    public Document signDocument(Document document) throws Exception {

        XMLSignatureFactory fac;
        Reference ref;
        SignedInfo si;

       
        // Create a DOMSignContext and specify the RSA PrivateKey and
        // location of the resulting XMLSignature's parent element.
        // Create a DOM XMLSignatureFactory that will be used to

Examples of javax.xml.crypto.dsig.SignedInfo

       
        // Validate the XMLSignature.
        boolean coreValidity = signature.validate(valContext);

        SignedInfo si = signature.getSignedInfo();
       
        System.out.println("Canonicalized SignedInfo:");
        InputStreamReader isr =
            new InputStreamReader(si.getCanonicalizedData());
        char[] cbuf = new char[1024];
        while (isr.read(cbuf, 0, 1024) != -1) {
            System.out.print(cbuf);
        }
        System.out.println();

Examples of javax.xml.crypto.dsig.SignedInfo

        (fac.newTransform
         (Transform.ENVELOPED, (TransformParameterSpec) null)),
          null, null);

     // Create the SignedInfo.
     SignedInfo si = fac.newSignedInfo
      (fac.newCanonicalizationMethod
       (CanonicalizationMethod.INCLUSIVE,
        (C14NMethodParameterSpec) null),
         fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),
          Collections.singletonList(ref));

Examples of javax.xml.crypto.dsig.SignedInfo

                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
                            (C14NMethodParameterSpec) null);
            SignatureMethod signMethod = signFactory.newSignatureMethod(
                    SignatureMethod.RSA_SHA1, null);
            SignedInfo si = signFactory.newSignedInfo(canonMethod, signMethod,
                    Collections.singletonList(ref));

            KeyStore.PrivateKeyEntry keyEntry = getKeyEntry(keyStoreInfo);
            if (keyEntry == null) {
                throw new IllegalStateException(

Examples of javax.xml.crypto.dsig.SignedInfo

                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
                            (C14NMethodParameterSpec) null);
            SignatureMethod signMethod = signFactory.newSignatureMethod(
                    SignatureMethod.RSA_SHA1, null);
            SignedInfo si = signFactory.newSignedInfo(canonMethod, signMethod,
                    Collections.singletonList(ref));

            KeyStore.PrivateKeyEntry keyEntry = getKeyEntry(keyStoreInfo);
            if (keyEntry == null) {
                throw new IllegalStateException(

Examples of javax.xml.crypto.dsig.SignedInfo

        try {
            java.security.Key key =
                KeyUtils.prepareSecretKey(sigAlgo, derivedKeyBytes);
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
                    signedInfo,
                    keyInfo,
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.