From 9e08c70e3fd83f9bdc4b7d99ec04754f826f1458 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 19 Jun 2023 12:34:53 +0200 Subject: [PATCH] Use PGPUtil.getCurveName() instead of EcUtil.getCurveName() --- .../pgpainless/key/generation/type/ecc/EllipticCurve.java | 6 +++--- .../org/pgpainless/key/generation/type/xdh/XDHSpec.java | 2 +- .../src/main/java/org/pgpainless/key/info/KeyInfo.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/ecc/EllipticCurve.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/ecc/EllipticCurve.java index 2372896e..e4c266bb 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/ecc/EllipticCurve.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/ecc/EllipticCurve.java @@ -15,9 +15,9 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec; * {@link XDHSpec} and {@link org.pgpainless.key.generation.type.eddsa.EdDSACurve}. */ public enum EllipticCurve { - _P256("prime256v1", 256), // prime256v1 is equivalent to P-256, see https://tools.ietf.org/search/rfc4492#page-32 - _P384("secp384r1", 384), // secp384r1 is equivalent to P-384, see https://tools.ietf.org/search/rfc4492#page-32 - _P521("secp521r1", 521), // secp521r1 is equivalent to P-521, see https://tools.ietf.org/search/rfc4492#page-32 + _P256("NIST P-256", 256), // prime256v1 is equivalent to P-256, see https://tools.ietf.org/search/rfc4492#page-32 + _P384("NIST P-384", 384), // secp384r1 is equivalent to P-384, see https://tools.ietf.org/search/rfc4492#page-32 + _P521("NIST P-521", 521), // secp521r1 is equivalent to P-521, see https://tools.ietf.org/search/rfc4492#page-32 _SECP256K1("secp256k1", 256), _BRAINPOOLP256R1("brainpoolP256r1", 256), _BRAINPOOLP384R1("brainpoolP384r1", 384), diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/xdh/XDHSpec.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/xdh/XDHSpec.java index ccbd2038..b1ab3066 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/xdh/XDHSpec.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/type/xdh/XDHSpec.java @@ -7,7 +7,7 @@ package org.pgpainless.key.generation.type.xdh; import javax.annotation.Nonnull; public enum XDHSpec { - _X25519("X25519", "curve25519", 256), + _X25519("X25519", "Curve25519", 256), ; final String name; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java index f455608e..5642bdc7 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java @@ -11,9 +11,9 @@ import org.bouncycastle.bcpg.ECDSAPublicBCPGKey; import org.bouncycastle.bcpg.ECPublicBCPGKey; import org.bouncycastle.bcpg.EdDSAPublicBCPGKey; import org.bouncycastle.bcpg.S2K; -import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil; import org.bouncycastle.openpgp.PGPPublicKey; import org.bouncycastle.openpgp.PGPSecretKey; +import org.bouncycastle.openpgp.PGPUtil; import org.pgpainless.algorithm.PublicKeyAlgorithm; import org.pgpainless.key.generation.type.eddsa.EdDSACurve; @@ -89,7 +89,7 @@ public class KeyInfo { public static String getCurveName(ECPublicBCPGKey key) { ASN1ObjectIdentifier identifier = key.getCurveOID(); - String curveName = ECUtil.getCurveName(identifier); + String curveName = PGPUtil.getCurveName(identifier); if (curveName != null) { return curveName; }