Package java.security

Examples of java.security.Signature.verify()


        sgr.initVerify(pair.getPublic());

        sgr.update(message);

        if (!sgr.verify(sigBytes))
        {
            fail("DSTU4145 verification failed");
        }

        BigInteger[] sig = decode(sigBytes);
View Full Code Here


        catch (Exception e)
        {
            throw new SignatureException("exception encoding TBS cert request - " + e);
        }

        return sig.verify(sigBits.getBytes());
    }

    /**
     * return a DER encoded byte array representing this object
     */
 
View Full Code Here

            aOut.writeObject(req.getTbsRequest());

            signature.update(bOut.toByteArray());

            return signature.verify(this.getSignature());
        }
        catch (NoSuchProviderException e)
        {
            // TODO Why this special case?
            throw e;
View Full Code Here

    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);
    } catch (InvalidKeyException e) {
      throw new CertificateTransparencyException("Log's public key cannot be used", e);
View Full Code Here

            signature.initVerify(key);

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

            return signature.verify(this.getSignature());
        }
        catch (NoSuchProviderException e)
        {
            // TODO Why this special case?
            throw e;
View Full Code Here

        }

        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

       
        sig.initVerify(pubKey);
       
        sig.update(cert.getTBSCertificate());
       
        if (!sig.verify(cert.getSignature()))
        {
            fail("EC certificate signature not mapped correctly.");
        }
        // System.out.println(cert);
    }
View Full Code Here

       
        sig.initVerify(pubKey);
       
        sig.update(req.getCertificationRequestInfo().getEncoded());
       
        if (!sig.verify(req.getSignature().getBytes()))
        {
            fail("signature not mapped correctly.");
        }
    }
View Full Code Here

        sig.initVerify(pubKey);

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

        if (!sig.verify(req.getSignature().getBytes()))
        {
            fail("signature not mapped correctly.");
        }
    }
View Full Code Here

        sig.initVerify(pubKey);

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

        if (!sig.verify(req.getSignature().getBytes()))
        {
            fail("signature not mapped correctly.");
        }
    }
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.