Examples of verifySignature()


Examples of org.bouncycastle.crypto.Signer.verifySignature()

        if (signer != null)
        {
            byte[] sigByte = TlsUtils.readOpaque16(input);

            if (!signer.verifySignature(sigByte))
            {
                throw new TlsFatalAlert(AlertDescription.decrypt_error);
            }
        }
View Full Code Here

Examples of org.bouncycastle.crypto.Signer.verifySignature()

        ECDomainParameters curve_params = TlsECCUtils.readECParameters(namedCurves, clientECPointFormats, sigIn);

        byte[] point = TlsUtils.readOpaque8(sigIn);

        byte[] sigByte = TlsUtils.readOpaque16(input);
        if (!signer.verifySignature(sigByte))
        {
            throw new TlsFatalAlert(AlertDescription.decrypt_error);
        }

        this.ecAgreeServerPublicKey = TlsECCUtils.validateECPublicKey(TlsECCUtils.deserializeECPublicKey(
View Full Code Here

Examples of org.bouncycastle.crypto.Signer.verifySignature()

        BigInteger p = TlsDHUtils.readDHParameter(sigIn);
        BigInteger g = TlsDHUtils.readDHParameter(sigIn);
        BigInteger Ys = TlsDHUtils.readDHParameter(sigIn);

        byte[] sigBytes = TlsUtils.readOpaque16(input);
        if (!signer.verifySignature(sigBytes))
        {
            throw new TlsFatalAlert(AlertDescription.decrypt_error);
        }

        this.dhAgreeServerPublicKey = validateDHPublicKey(new DHPublicKeyParameters(Ys, new DHParameters(p, g)));
View Full Code Here

Examples of org.bouncycastle.crypto.Signer.verifySignature()

    {

        // Note: Only use the SHA1 part of the hash
        Signer signer = makeSigner(new NullDigest(), false, publicKey);
        signer.update(md5AndSha1, 16, 20);
        return signer.verifySignature(sigBytes);
    }

    public Signer createSigner(AsymmetricKeyParameter privateKey)
    {
        return makeSigner(new SHA1Digest(), true, new ParametersWithRandom(privateKey, this.context.getSecureRandom()));
View Full Code Here

Examples of org.bouncycastle.crypto.signers.DSASigner.verifySignature()

        DSASigner signer = new DSASigner();
        ASN1Sequence derSig = ASN1Sequence.getInstance(ASN1Primitive.fromByteArray(sigBytes));

        signer.init(false, keyParams);

        if (!signer.verifySignature(dummySha1, DERInteger.getInstance(derSig.getObjectAt(0)).getValue(), DERInteger.getInstance(derSig.getObjectAt(1)).getValue()))
        {
            fail("NONEwithDSA not really NONE!");
        }
    }
View Full Code Here

Examples of org.bouncycastle.crypto.signers.DSASigner.verifySignature()

                + " got      : " + sig[1]);
        }

        dsa.init(false, pair.getPublic());

        if (dsa.verifySignature(message, sig[0], sig[1]))
        {
            return new SimpleTestResult(true, getName() + ": Okay");
        }
        else
        {
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ECDSASigner.verifySignature()

            ECPublicKeyParameters pubKey = new ECPublicKeyParameters(
                curve.decodePoint(Hex.decode("0262b12d60690cdcf330babab6e69763b471f994dd702d16a5")), // Q
                params);

            ecdsa.init(false, pubKey);
            if ( ecdsa.verifySignature(message, sig[0], sig[1]) )
            {
                return new SimpleTestResult(true, getName() + ": Okay");
            }
            else
            {
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ECDSASigner.verifySignature()

            ECPublicKeyParameters pubKey = new ECPublicKeyParameters(
                curve.decodePoint(Hex.decode("025b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c70")), // Q
                params);

            ecdsa.init(false, pubKey);
            if ( ecdsa.verifySignature(message, sig[0], sig[1]) )
            {
                return new SimpleTestResult(true, getName() + ": Okay");
            }
            else
            {
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ECDSASigner.verifySignature()

            byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray();
            BigInteger[] sig = ecdsa.generateSignature(message);

            ecdsa.init(false, pair.getPublic());

            if (ecdsa.verifySignature(message, sig[0], sig[1]))
            {
                return new SimpleTestResult(true, getName() + ": Okay");
            }
            else
            {
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ISO9796d2PSSSigner.verifySignature()

        if (!isSameAs(sig6, 1, data))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 generation Test 6");
        }

        if (!eng.verifySignature(sig6))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 verify Test 6");
        }

        return new SimpleTestResult(true, "ISO9796: Okay");
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.