Class COSEEllipticCurves

java.lang.Object
com.authlete.cose.constants.COSEEllipticCurves

public final class COSEEllipticCurves extends Object
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 Details

  • Method Details

    • getValueByName

      public static int getValueByName(String name)
      Get the integer identifier assigned to the elliptic curve.
      Parameters:
      name - An elliptic curve name such as "P-256". If null 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

      public static String getNameByValue(int value)
      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.