diff options
author | David Hook <dgh@cryptoworkshop.com> | 2013-06-19 03:47:33 +0400 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2013-06-19 03:47:33 +0400 |
commit | d77bc271b93313338b8fec502f8011726324d82a (patch) | |
tree | c0e93c80609c9643dac3852d228075ab40282901 /pg | |
parent | 1190848be88884358ae50d46c6266ce680492688 (diff) |
removed deprecated method, some JavaDoc
Diffstat (limited to 'pg')
-rw-r--r-- | pg/src/main/java/org/bouncycastle/openpgp/examples/PGPExampleUtil.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pg/src/main/java/org/bouncycastle/openpgp/examples/PGPExampleUtil.java b/pg/src/main/java/org/bouncycastle/openpgp/examples/PGPExampleUtil.java index 084c4683..93202579 100644 --- a/pg/src/main/java/org/bouncycastle/openpgp/examples/PGPExampleUtil.java +++ b/pg/src/main/java/org/bouncycastle/openpgp/examples/PGPExampleUtil.java @@ -20,6 +20,7 @@ import org.bouncycastle.openpgp.PGPSecretKey; import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.bouncycastle.openpgp.PGPSecretKeyRingCollection; import org.bouncycastle.openpgp.PGPUtil; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; class PGPExampleUtil { @@ -40,7 +41,7 @@ class PGPExampleUtil * @param pgpSec a secret key ring collection. * @param keyID keyID we want. * @param pass passphrase to decrypt secret key with. - * @return + * @return the private key. * @throws PGPException * @throws NoSuchProviderException */ @@ -54,7 +55,7 @@ class PGPExampleUtil return null; } - return pgpSecKey.extractPrivateKey(pass, "BC"); + return pgpSecKey.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder().setProvider("BC").build(pass)); } static PGPPublicKey readPublicKey(String fileName) throws IOException, PGPException @@ -69,8 +70,8 @@ class PGPExampleUtil * A simple routine that opens a key ring file and loads the first available key * suitable for encryption. * - * @param input - * @return + * @param input data stream containing the public key data + * @return the first public key found. * @throws IOException * @throws PGPException */ |