Class COSEEllipticCurves
java.lang.Object
com.authlete.cose.constants.COSEEllipticCurves
COSE Elliptic Curves
Name Value Key Type Description P-256
1 EC2
NIST P-256 also known as secp256r1 P-384
2 EC2
NIST P-384 also known as secp384r1 P-521
3 EC2
NIST P-521 also known as secp521r1 X25519
4 OKP
X25519 for use w/ ECDH only X448
5 OKP
X448 for use w/ ECDH only Ed25519
6 OKP
Ed25519 for use w/ EdDSA only Ed448
7 OKP
Ed448 for use w/ EdDSA only secp256k1
8 EC2
Ed448 for use w/ EdDSA only
- Since:
- 1.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Ed25519 (6)static final String
"Ed25519"static final int
Ed448 (7)static final String
"Ed448"static final int
P-256 (1)static final String
"P-256"static final int
P-384 (2)static final String
"P-384"static final int
P-521 (3)static final String
"P-521"static final int
secp256k1 (8)static final String
"secp256k1"static final int
X25519 (4)static final String
"X25519"static final int
X448 (5)static final String
"X448" -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getNameByValue
(int value) Get the name of the elliptic curve to which the integer identifier has been assigned to.static int
getValueByName
(String name) Get the integer identifier assigned to the elliptic curve.
-
Field Details
-
P_256
public static final int P_256P-256 (1)- See Also:
-
P_384
public static final int P_384P-384 (2)- See Also:
-
P_521
public static final int P_521P-521 (3)- See Also:
-
X25519
public static final int X25519X25519 (4)- See Also:
-
X448
public static final int X448X448 (5)- See Also:
-
Ed25519
public static final int Ed25519Ed25519 (6)- See Also:
-
Ed448
public static final int Ed448Ed448 (7)- See Also:
-
SECP256K1
public static final int SECP256K1secp256k1 (8)- See Also:
-
P_256_NAME
-
P_384_NAME
-
P_521_NAME
-
X25519_NAME
-
X448_NAME
-
Ed25519_NAME
-
Ed448_NAME
-
SECP256K1_NAME
-
-
Method Details
-
getValueByName
Get the integer identifier assigned to the elliptic curve.- Parameters:
name
- An elliptic curve name such as"P-256"
. Ifnull
is given, 0 is returned.- Returns:
- The integer identifier assigned to the elliptic curve. If the given name is not recognized, 0 is returned.
-
getNameByValue
Get the name of the elliptic curve to which the integer identifier has been assigned to.- Parameters:
value
- An integer identifier assigned to an elliptic curve.- Returns:
- The name of the elliptic curve to which the integer identifier
has been assigned to. If the given identifier is not recognized,
null
is returned.
-