Examples of extractPrivateKey()


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

                                    new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(rewrapPass),
                                    null);
                pgpPriv = PGPSecretKeyRing.insertSecretKey(pgpPriv, pgpKey);
           
                // this should succeed
                PGPPrivateKey privTmp = pgpKey.extractPrivateKey(null);
            }
        }
    }

    private void testPublicKeyRingWithX509()
View Full Code Here

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

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

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

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

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

            {
                keyCount++;

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

                k.extractPrivateKey(sec3pass1, "BC");
            }
           
            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(sec3pass1, "BC");
            }

            if (keyCount != 2)
            {
                fail("test4 - 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 JcePBESecretKeyDecryptorBuilder().setProvider("BC").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 JcePBESecretKeyDecryptorBuilder().setProvider("BC").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 JcePBESecretKeyDecryptorBuilder().setProvider("BC").build(sec9pass));
                if (keyCount == 1 && pKey != null)
                {
                    fail("primary secret key found, null expected");
                }
            }
View Full Code Here

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

                                    new JcePBESecretKeyDecryptorBuilder(new JcaPGPDigestCalculatorProviderBuilder().setProvider("BC").build()).setProvider("BC").build(rewrapPass),
                                    null);
                pgpPriv = PGPSecretKeyRing.insertSecretKey(pgpPriv, pgpKey);
           
                // this should succeed
                PGPPrivateKey privTmp = pgpKey.extractPrivateKey(null);
            }
        }
    }

    private void testPublicKeyRingWithX509()
View Full Code Here

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

        {
            digest = PGPUtil.SHA1;
        }
       
        PGPSecretKey                    pgpSecKey = PGPExampleUtil.readSecretKey(keyIn);
        PGPPrivateKey                   pgpPrivKey = pgpSecKey.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder().setProvider("BC").build(pass));
        PGPSignatureGenerator           sGen = new PGPSignatureGenerator(new JcaPGPContentSignerBuilder(pgpSecKey.getPublicKey().getAlgorithm(), digest).setProvider("BC"));
        PGPSignatureSubpacketGenerator  spGen = new PGPSignatureSubpacketGenerator();
       
        sGen.init(PGPSignature.CANONICAL_TEXT_DOCUMENT, pgpPrivKey);
       
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.