1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-05 03:55:58 +01:00

Use PGPUtil.getCurveName() instead of EcUtil.getCurveName()

This commit is contained in:
Paul Schaub 2023-06-19 12:34:53 +02:00
parent 367164a819
commit 9e08c70e3f
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 6 additions and 6 deletions

View file

@ -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),

View file

@ -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;

View file

@ -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;
}