Package org.apache.xml.security.signature

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


               if (cert != null) {

                  //check if the signature is valid using the cert
                  System.out.println("Check: "
                                     + signature.checkSignatureValue(cert));
               } else {

                  //Maybe it's a public key
                  PublicKey pk = signature.getKeyInfo().getPublicKey();
View Full Code Here


                  if (pk != null) {

                     //check if the signature is valid using the public key
                     System.out.println("Check: "
                                        + signature.checkSignatureValue(pk));
                  } else {

                     //No X509Cert or PublicKey could be found.
                     System.out
                        .println("Could not find Certificate or PublicKey");
View Full Code Here

                     .item(0);
            String keyValue = keyName.getFirstChild().getNodeValue();

            System.out
               .println("The signature number " + (i + 1) + " is "
                        + (signature
                           .checkSignatureValue(signature
                              .createSecretKey(keyValue.getBytes()))
                           ? "valid (good)"
                           : "invalid !!!!! (bad)"));
View Full Code Here

            X509Certificate cert = signature.getKeyInfo().getX509Certificate();

            if (cert != null) {
               System.out.println("The XML signature in file "
                                  + f.toURL().toString() + " is "
                                  + (signature.checkSignatureValue(cert)
                                     ? "valid (good)"
                                     : "invalid !!!!! (bad)"));
            } else {
               PublicKey pk = signature.getKeyInfo().getPublicKey();
View Full Code Here

               PublicKey pk = signature.getKeyInfo().getPublicKey();

               if (pk != null) {
                  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

                  "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

                     "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) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                                 Constants._TAG_SIGNATURE).item(0);
         XMLSignature sign = new XMLSignature(sigElement,
                                                   "");
         boolean verify =
             sign.checkSignatureValue(sign.getKeyInfo().getPublicKey());
         if (!verify) {
         for (int i = 0; i < sign.getSignedInfo().getLength(); i++) {
              boolean refVerify =
                 sign.getSignedInfo().getVerificationResult(i);             
              if (!refVerify) {             
View Full Code Here

        PublicKey pk = signature.getKeyInfo().getPublicKey();

        if (pk == null) {
          throw new RuntimeException("No public key");
        }
        assertTrue(signature.checkSignatureValue(pk) );
    }

}
View Full Code Here

            (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                                 Constants._TAG_SIGNATURE).item(0);
         XMLSignature sign = new XMLSignature(sigElement,
                                                   "");
         boolean verify =
             sign.checkSignatureValue(sign.getKeyInfo().getPublicKey());
         if (!verify) {
         for (int i = 0; i < sign.getSignedInfo().getLength(); i++) {
              boolean refVerify =
                 sign.getSignedInfo().getVerificationResult(i);             
              if (!refVerify) {             
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.