- All Implemented Interfaces:
Serializable
,Comparable<ECCurve>
,Constable
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionP-256 curve as defined by RFC7518 Section 6.2.1.1P-384 curve as defined by RFC7518 Section 6.2.1.1P-521 curve as defined by RFC7518 Section 6.2.1.1Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic ECCurve
Returns the curve corresponding to the specified JWA registered curve name.getCurve()
Returns the JWA registered curve name.int
Returns the field size in bits.Returns the JCA curve name.int
Returns the key length in bytes.Returns the Elliptic curve parameters.int
Returns the signature length in bytes.boolean
isOnCurve
(BigInteger x, BigInteger y) Determines whether the specified point is on the curve.static ECCurve
Returns the enum constant of this class with the specified name.static ECCurve[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
P_256
P-256 curve as defined by RFC7518 Section 6.2.1.1 -
P_384
P-384 curve as defined by RFC7518 Section 6.2.1.1 -
P_521
P-521 curve as defined by RFC7518 Section 6.2.1.1 -
SECP256K1
Deprecated.secp256k1 has been disabled in the JDK (>=15), it can be activated by setting jdk.sunec.disableNative property to false (-Djdk.sunec.disableNative=false
)secp256k1 curve as defined by RFC8812 Section 4.4
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getCurve
Returns the JWA registered curve name.
- Returns:
- the registered name of the curve
-
getJCAName
Returns the JCA curve name.
- Returns:
- the JCA curve name
-
getFieldSize
public int getFieldSize()Returns the field size in bits.
- Returns:
- the field size in bits
-
getKeyLength
public int getKeyLength()Returns the key length in bytes.
- Returns:
- the key length in bytes
-
getSignatureLength
public int getSignatureLength()Returns the signature length in bytes.
- Returns:
- the signature length in bytes
-
getParameterSpec
Returns the Elliptic curve parameters.
- Returns:
- the Elliptic curve parameters
- Throws:
JWAProcessingException
- if the curve is not fully supportedIllegalStateException
- if there was an error creating the parameters
-
isOnCurve
Determines whether the specified point is on the curve.
- Parameters:
x
- the x coordinatey
- the y coordinate- Returns:
- true if the point is on the curve, false otherwise
-
fromCurve
Returns the curve corresponding to the specified JWA registered curve name.
- Parameters:
crv
- a JWA registered curve name- Returns:
- an Elliptic curve
- Throws:
IllegalArgumentException
- if the specified curve is not supported
-
-Djdk.sunec.disableNative=false
)