Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pg
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2014-06-08 06:52:05 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-06-08 06:52:05 +0400
commit4ce80f7ad7c0f861e85d4a899f13e27650577a15 (patch)
treea3544750a643ba3bab756cc4d93c79f5d3cc1ad4 /pg
parent197b3d7069e2778990804de21117cd1aa9bab8d8 (diff)
added support for extraction of EC keys.
Diffstat (limited to 'pg')
-rw-r--r--pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java b/pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java
index 3413166a..aaee3865 100644
--- a/pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java
+++ b/pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java
@@ -13,6 +13,7 @@ import org.bouncycastle.bcpg.BCPGObject;
import org.bouncycastle.bcpg.BCPGOutputStream;
import org.bouncycastle.bcpg.ContainedPacket;
import org.bouncycastle.bcpg.DSASecretBCPGKey;
+import org.bouncycastle.bcpg.ECSecretBCPGKey;
import org.bouncycastle.bcpg.ElGamalSecretBCPGKey;
import org.bouncycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle.bcpg.PublicKeyPacket;
@@ -485,6 +486,11 @@ public class PGPSecretKey
ElGamalSecretBCPGKey elPriv = new ElGamalSecretBCPGKey(in);
return new PGPPrivateKey(this.getKeyID(), pubPk, elPriv);
+ case PGPPublicKey.ECDH:
+ case PGPPublicKey.ECDSA:
+ ECSecretBCPGKey ecPriv = new ECSecretBCPGKey(in);
+
+ return new PGPPrivateKey(this.getKeyID(), pubPk, ecPriv);
default:
throw new PGPException("unknown public key algorithm encountered");
}