Examples of extractPrivateKey()


Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

        //
        String  newPass = "newPass";
       
        secretKey = PGPSecretKey.copyWithNewPassword(secretKey, new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(passPhrase), new BcPBESecretKeyEncryptorBuilder(secretKey.getKeyEncryptionAlgorithm()).build(newPass.toCharArray()));
       
        secretKey.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(newPass.toCharArray()));
       
        secretKey.encode(new ByteArrayOutputStream());
       
        key = secretKey.getPublicKey();
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

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

        pgpPrivKey = secretKey.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(newPass.toCharArray()));
       
        //
        // signature generation
        //
        String                                data = "hello world!";
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

        //
        pgpPriv = new PGPSecretKeyRing(pgp8Key, new BcKeyFingerprintCalculator());
       
        secretKey = pgpPriv.getSecretKey();
       
        pgpPrivKey = secretKey.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(pgp8Pass));

        //
        // expiry
        //
        testExpiry(expiry60and30daysSig13Key, 60, 30);
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

                pk.getSignatures();
               
                if (k.getKeyID() == -4049084404703773049L
                     || k.getKeyID() == -1413891222336124627L)
                {
                    k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec2pass1));
                }
                else if (k.getKeyID() == -6498553574938125416L
                    || k.getKeyID() == 59034765524361024L)
                {
                    k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec2pass2));
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

                    k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec2pass1));
                }
                else if (k.getKeyID() == -6498553574938125416L
                    || k.getKeyID() == 59034765524361024L)
                {
                    k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec2pass2));
                }
            }
           
            if (keyCount != 2)
            {
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

            {
                keyCount++;

                PGPSecretKey    k = (PGPSecretKey)it.next();

                k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec3pass1));
            }
           
            if (keyCount != 2)
            {
                fail("wrong number of secret keys");
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

            {
                keyCount++;

                PGPSecretKey    k = (PGPSecretKey)it.next();

                k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec3pass1));
            }
           
            if (keyCount != 2)
            {
                fail("wrong number of secret keys");
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

            {
                keyCount++;

                PGPSecretKey    k = (PGPSecretKey)it.next();

                k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec5pass1));
            }
           
            if (keyCount != 2)
            {
                fail("wrong number of secret keys");
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

            {
                keyCount++;

                PGPSecretKey    k = (PGPSecretKey)it.next();

                k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec8pass));
            }
           
            if (keyCount != 2)
            {
                fail("wrong number of secret keys");
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey()

            {
                keyCount++;

                PGPSecretKey    k = (PGPSecretKey)it.next();

                PGPPrivateKey   pKey = k.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(sec9pass));
                if (keyCount == 1 && pKey != null)
                {
                    fail("primary secret key found, null expected");
                }
            }
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.