Package org.bouncycastle.openpgp

Examples of org.bouncycastle.openpgp.PGPSignature.initVerify()


        if (!ops.verify(sig))
        {
            fail("Failed generated signature check - " + hashAlgorithm);
        }
       
        sig.initVerify(pubKey, "BC");
       
        for (int i = 0; i != original.length; i++)
        {
            sig.update(original[i]);
        }
View Full Code Here


            int sigCount = 0;
            while (sigs.hasNext())
            {
                PGPSignature sig = (PGPSignature)sigs.next();

                sig.initVerify(pubKey, "BC");

                if (!sig.verifyCertification(attributes, pubKey))
                {
                    fail("signature failed verification");
                }
View Full Code Here

            int sigCount = 0;
            while (sigs.hasNext())
            {
                PGPSignature s = (PGPSignature)sigs.next();

                s.initVerify(pubKey, "BC");

                if (!s.verifyCertification(attributes, pubKey))
                {
                    fail("added signature failed verification");
                }
View Full Code Here

        it = pgpPub.getPublicKey().getSignaturesForID(uid);
       
        PGPSignature    sig = (PGPSignature)it.next();
       
        sig.initVerify(pgpPub.getPublicKey(), "BC");
       
        if (!sig.verifyCertification(uid, pgpPub.getPublicKey()))
        {
            fail("failed to verify certification");
        }
View Full Code Here

        it = key.getSignaturesForID(uid);

        sig = (PGPSignature)it.next();

        sig.initVerify(key, "BC");

        if (!sig.verifyCertification(uid, key))
        {
            fail("failed to verify certification");
        }
View Full Code Here

        Iterator            sgIt = key.getSignaturesOfType(PGPSignature.KEY_REVOCATION);

        sig = (PGPSignature)sgIt.next();

        sig.initVerify(key, "BC");

        if (!sig.verifyCertification(key))
        {
            fail("failed to verify revocation certification");
        }
View Full Code Here

        it = key.getSignaturesForID(uid);

        sig = (PGPSignature)it.next();

        sig.initVerify(key, "BC");

        if (!sig.verifyCertification(uid, key))
        {
            fail("failed to verify certification");
        }
View Full Code Here

        PGPObjectFactory           pgpFact = new PGPObjectFactory(aIn);
        PGPSignatureList           p3 = (PGPSignatureList)pgpFact.nextObject();
        PGPSignature               sig = p3.get(0);
       
        sig.initVerify(pgpRings.getPublicKey(sig.getKeyID()), "BC");

        ByteArrayOutputStream lineOut = new ByteArrayOutputStream();
        InputStream           sigIn = new ByteArrayInputStream(bOut.toByteArray());
        int lookAhead = readInputLine(lineOut, sigIn);
View Full Code Here

            Validate.notNull(publicKey,
                    "Could not obtain public key for signer key ID '%s'",
                    pgpSignature);

            pgpSignature.initVerify(publicKey, "BC");

            // Now verify the signed content
            final byte[] buff = new byte[BUFFER_SIZE];
            int chunk;
            do {
View Full Code Here

            if (count != 1)
            {
                fail("wrong number of revocations in test7.");
            }

            sig.initVerify(masterKey, "BC");
                                                                           
            if (!sig.verifyCertification(k))
            {
                fail("failed to verify revocation certification");
            }
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.