Package org.apache.xml.security.algorithms

Examples of org.apache.xml.security.algorithms.SignatureAlgorithm.update()


      SignatureAlgorithm verifyer =
         new SignatureAlgorithm(doc.getDocumentElement(), "file:");

      verifyer.initVerify(publicKey);
      verifyer.update("sdjhfkjashkjf".getBytes());

      boolean result = verifyer.verify(signatureValue);

      if (result) {
         System.out.println("It verified");
View Full Code Here


      // SecretKeyFactory skf = SecretKeyFactory.getInstance(sa.getJCEAlgorithmString(), sa.getJCEProviderName());
      byte keybytes[] = "01234567890123456789".getBytes();
      SecretKey sk = new SecretKeySpec(keybytes, sa.getJCEAlgorithmString());

      sa.initSign(sk);
      sa.update("sdjhfkjashkjf".getBytes());

      byte signatureValue[] = sa.sign();

      System.out.println(Base64.encode(signatureValue));
      doc.appendChild(sa.getElement());
View Full Code Here

        SignatureAlgorithm sa =
            new SignatureAlgorithm(doc, "http://www.w3.org/2000/09/xmldsig#dsa-sha1");

        sa.initSign(privateKey);
        sa.update("sdjhfkjashkjf".getBytes());

        byte signatureValue[] = sa.sign();

        System.out.println(Base64.encode(signatureValue));
        doc.appendChild(sa.getElement());
View Full Code Here

        SignatureAlgorithm verifier =
            new SignatureAlgorithm(doc.getDocumentElement(), "file:");

        verifier.initVerify(publicKey);
        verifier.update("sdjhfkjashkjf".getBytes());

        boolean result = verifier.verify(signatureValue);

        if (result) {
            System.out.println("It verified");
View Full Code Here

        byte keybytes[] = "01234567890123456789".getBytes();
        SecretKey sk = new SecretKeySpec(keybytes, sa.getJCEAlgorithmString());

        sa.initSign(sk);
        sa.update("sdjhfkjashkjf".getBytes());

        byte signatureValue[] = sa.sign();

        System.out.println(Base64.encode(signatureValue));
        doc.appendChild(sa.getElement());
View Full Code Here

            new SignatureAlgorithm(doc.getDocumentElement(), "file:");
        SecretKey pk =
            new SecretKeySpec("01234567890123456789".getBytes(), verifier.getJCEAlgorithmString());

        verifier.initVerify(pk);
        verifier.update("sdjhfkjashkjf".getBytes());

        boolean result = verifier.verify(signatureValue);

        if (result) {
            System.out.println("It verified");
View Full Code Here

            // get the canonicalized bytes from SignedInfo
            byte signedInfoOctets[] = si.getCanonicalizedOctetStream();

            // sign those bytes
            sa.update(signedInfoOctets);

            byte jcebytes[] = sa.sign();

            // set them on the SignateValue element
            this.setSignatureValueElement(jcebytes);
View Full Code Here

         // Get the canonicalized (normalized) SignedInfo
         byte inputBytes[] = this._signedInfo.getCanonicalizedOctetStream();

         //set the input bytes on the SignateAlgorithm
         sa.update(inputBytes);

         //retrieve the byte[] from the stored signature
         byte sigBytes[] = this.getSignatureValue();

         log.debug("SignatureValue = "
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.