Package org.apache.xml.security.signature

Examples of org.apache.xml.security.signature.XMLSignature.checkSignatureValue()


      boolean result=false;
      if (ki != null) {
         X509Certificate cert = ki.getX509Certificate();

         if (cert != null) {
           result=signature.checkSignatureValue(cert);
         } else {
            PublicKey pk = ki.getPublicKey();

            if (pk != null) {
              result=signature.checkSignatureValue(pk);
View Full Code Here


           result=signature.checkSignatureValue(cert);
         } else {
            PublicKey pk = ki.getPublicKey();

            if (pk != null) {
              result=signature.checkSignatureValue(pk);
            } else {
               throw new RuntimeException(
                  "Did not find a public key, so I can't check the signature");
            }
         }
View Full Code Here

                Transforms.TRANSFORM_ENVELOPED_SIGNATURE +
                " transform in signature");
        }

        // finally check the signature
        if (!oSig.checkSignatureValue(oPubKey))
        {
            throw new XMLSecurityException("Signature failed to verify.");
        }

    } // verifySignature()
View Full Code Here

               "I try to verify the signature using the X509 Certificate: "
               + cert);
            */
            System.out.println("The XML signature in file "
                               + f.toURL().toString() + " is "
                               + (signature.checkSignatureValue(cert)
                                  ? "valid (good)"
                                  : "invalid !!!!! (bad)"));
         } else {
            // System.out.println("Did not find a Certificate");

View Full Code Here

            if (pk != null) {
               // System.out.println("I try to verify the signature using the public key: " + pk);
               System.out.println("The XML signature in file "
                                  + f.toURL().toString() + " is "
                                  + (signature.checkSignatureValue(pk)
                                     ? "valid (good)"
                                     : "invalid !!!!! (bad)"));
            } else {
               System.out.println(
                  "Did not find a public key, so I can't check the signature");
View Full Code Here

      byte keybytes[] = "secret".getBytes("ASCII");
      javax.crypto.SecretKey sk = signature.createSecretKey(keybytes);

      System.out.println("The XML signature in file "
                               + f.toURL().toString() + " is "
                               + (signature.checkSignatureValue(sk)
                                  ? "valid (good)"
                                  : "invalid !!!!! (bad)"));
   }

   static {
View Full Code Here

            XMLSignature signature = new XMLSignature(sigElement, BaseURI);
            byte[] secretKey = "secretValue".getBytes();

            System.out
               .println("The XML signature number " + i + " in file " + BaseURI + " is "
                        + (signature
                           .checkSignatureValue(signature
                              .createSecretKey(CreateCollectableSignature
                                 .passphrase.getBytes()))
                           ? "valid (good)"
                           : "invalid !!!!! (bad)"));
View Full Code Here

               "I try to verify the signature using the X509 Certificate: "
               + cert);
            */
            System.out.println("The XML signature in file "
                               + f.toURL().toString() + " is "
                               + (signature.checkSignatureValue(cert)
                                  ? "valid (good)"
                                  : "invalid !!!!! (bad)"));
         } else {
            // System.out.println("Did not find a Certificate");

View Full Code Here

            if (pk != null) {
               // System.out.println("I try to verify the signature using the public key: " + pk);
               System.out.println("The XML signature in file "
                                  + f.toURL().toString() + " is "
                                  + (signature.checkSignatureValue(pk)
                                     ? "valid (good)"
                                     : "invalid !!!!! (bad)"));
            } else {
               System.out.println(
                  "Did not find a public key, so I can't check the signature");
View Full Code Here

      Element dsElem = (Element) XPathAPI.selectSingleNode(doc,
                          "//ds:Signature[1]", context);
      XMLSignature signature = new XMLSignature(dsElem, currentSystemId);

      // how can I reg my own keystore?
      boolean verify = signature.checkSignatureValue(signature.getKeyInfo().getPublicKey());

      System.out.println("Signature " + (verify
                                         ? "Verification successful"
                                         : "Verification failed"));
      System.out.println("Canonicalized SignedInfo:");
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.