Examples of checkSignatureValue()


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

         (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                              Constants._TAG_SIGNATURE).item(0);
      XMLSignature signature = new XMLSignature(sigElement,
                                                f.toURL().toString());
      boolean verify =
         signature.checkSignatureValue(signature.getKeyInfo().getPublicKey());
      int failures = 0;

      if (!verify) {
         for (int i = 0; i < signature.getSignedInfo().getLength(); i++) {
            boolean refVerify =
View Full Code Here

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

            KeyInfo keyInfo = signature.getKeyInfo();
           
            if (keyInfo != null) {
                cert = keyInfo.getX509Certificate();
                if (cert != null) {
                    valid = signature.checkSignatureValue(cert);
                } else {
                    publicKey = keyInfo.getPublicKey();
                    if (publicKey != null) {
                        valid = signature.checkSignatureValue(publicKey);
                    }
View Full Code Here

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

                if (cert != null) {
                    valid = signature.checkSignatureValue(cert);
                } else {
                    publicKey = keyInfo.getPublicKey();
                    if (publicKey != null) {
                        valid = signature.checkSignatureValue(publicKey);
                    }
                }
            } else if (!keyInfoMustBeAvailable) {
                String user = getUserName(crypto, message);
                cert = SecurityUtils.getCertificates(crypto, user)[0];
View Full Code Here

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

                }
            } else if (!keyInfoMustBeAvailable) {
                String user = getUserName(crypto, message);
                cert = SecurityUtils.getCertificates(crypto, user)[0];
                publicKey = cert.getPublicKey();
                valid = signature.checkSignatureValue(cert);
            }
           
            // validate trust
            new TrustValidator().validateTrust(crypto, cert, publicKey);
            if (valid && persistSignature) {
View Full Code Here

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

               "There must be exactly one EnvelopedSignature Transform");
         }

         SecretKey secretKey = this.generateKeyFromPass(signature, password);

         return signature.checkSignatureValue(secretKey);
      } catch (XMLSignatureException ex) {
         throw new IOException(ex.getMessage());
      } catch (XMLSecurityException ex) {
         throw new IOException(ex.getMessage());
      }
View Full Code Here

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

            // See also WSS4J SAMLUtil.getCredentialFromKeyInfo
            KeyInfo keyInfo = signature.getKeyInfo();
           
            X509Certificate cert = keyInfo.getX509Certificate();
            if (cert != null) {
                valid = signature.checkSignatureValue(cert);
            } else {
                PublicKey pk = keyInfo.getPublicKey();
                if (pk != null) {
                    valid = signature.checkSignatureValue(pk);
                }
View Full Code Here

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

            if (cert != null) {
                valid = signature.checkSignatureValue(cert);
            } else {
                PublicKey pk = keyInfo.getPublicKey();
                if (pk != null) {
                    valid = signature.checkSignatureValue(pk);
                }
            }
            // is this call redundant given that signature.checkSignatureValue uses References ?
            ref = getReference(signature);
            Element signedElement = validateReference(root, ref);
View Full Code Here

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

      }

      XMLSignature s = new XMLSignature(doc.getDocumentElement(),
                                        signatureFile.toURL().toString());
      boolean verify =
         s.checkSignatureValue(s.createSecretKey("secret".getBytes()));

      System.out.println("verify=" + verify);

      System.out.println("");
View Full Code Here

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

            .getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature")
               .item(0), f.toURL().toString());

      System.out.println("Signature erzeugt");

      boolean v = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());

      System.out.println("Merlin: " + v);
   }

   /**
 
View Full Code Here

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

                return;
            }

            XMLSignature sig = new XMLSignature(signatureElem, BaseURI);

            boolean verify = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());
            System.out.println("Server verification complete.");

            System.out.println("The signature is" + (verify
                    ? " "
                    : " not ") + "valid");
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.