Package java.security

Examples of java.security.Signature.initVerify()


        sgr.update(message);

        byte[] sigBytes = sgr.sign();

        sgr.initVerify(pair.getPublic());

        sgr.update(message);

        if (!sgr.verify(sigBytes))
        {
View Full Code Here


            }
        }

        setSignatureParameters(sig, sigAlgId.getParameters());
       
        sig.initVerify(pubKey);

        try
        {
            sig.update(reqInfo.getEncoded(ASN1Encoding.DER));
        }
View Full Code Here

        try
        {
            Signature signature = OCSPUtil.createSignatureInstance(this.getSignatureAlgOID(), sigProvider);

            signature.initVerify(key);

            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

            aOut.writeObject(req.getTbsRequest());
View Full Code Here

              logInfo.getSignatureAlgorithm()));
    }

    try {
      Signature signature = Signature.getInstance("SHA256withECDSA");
      signature.initVerify(logInfo.getKey());
      signature.update(toVerify);
      return signature.verify(sct.getSignature().getSignature().toByteArray());
    } catch (SignatureException e) {
      throw new CertificateTransparencyException("Signature object not properly initialized or"
          + " signature from SCT is improperly encoded.", e);
View Full Code Here

    {
        try
        {
            Signature signature = OCSPUtil.createSignatureInstance(this.getSignatureAlgName(), sigProvider);

            signature.initVerify(key);

            signature.update(resp.getTbsResponseData().getEncoded(ASN1Encoding.DER));

            return signature.verify(this.getSignature());
        }
View Full Code Here

        else
        {
            sig = Signature.getInstance(getSigAlgName());
        }

        sig.initVerify(key);
        sig.update(this.getTBSCertList());

        if (!sig.verify(this.getSignature()))
        {
            throw new SignatureException("CRL does not verify with supplied public key.");
View Full Code Here

            fail("sig parameters present");
        }
       
        Signature sig = Signature.getInstance(algorithm, "BC");
       
        sig.initVerify(pubKey);
       
        sig.update(cert.getTBSCertificate());
       
        if (!sig.verify(cert.getSignature()))
        {
View Full Code Here

            fail("ECDSA parameters incorrect.");
        }
       
        Signature sig = Signature.getInstance(algorithm, "BC");
       
        sig.initVerify(pubKey);
       
        sig.update(req.getCertificationRequestInfo().getEncoded());
       
        if (!sig.verify(req.getSignature().getBytes()))
        {
View Full Code Here

            fail("ECDSA parameters incorrect.");
        }

        Signature sig = Signature.getInstance(algorithm, "BC");

        sig.initVerify(pubKey);

        sig.update(req.getCertificationRequestInfo().getEncoded());

        if (!sig.verify(req.getSignature().getBytes()))
        {
View Full Code Here

            fail("ECGOST parameters incorrect.");
        }

        Signature sig = Signature.getInstance(algorithm, "BC");

        sig.initVerify(pubKey);

        sig.update(req.getCertificationRequestInfo().getEncoded());

        if (!sig.verify(req.getSignature().getBytes()))
        {
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.