- All Implemented Interfaces:
Serializable
,Comparable<OKPCurve>
,Constable
Octet Key Pair Elliptic curves as defined by RFC8037
Supported curves:
- Ed25519
- Ed448
- X25519
- X448
These curves are used in conjuntion with algorithms defined by EdECAlgorithm
and XECAlgorithm
.
- 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 ConstantDescriptionEd25519 curve as defined by RFC8037 Section 3.1Ed448 curve as defined by RFC8037 Section 3.1X25519 curve as defined by RFC8037 Section 3.2X448 curve as defined by RFC8037 Section 3.2 -
Method Summary
Modifier and TypeMethodDescriptionstatic OKPCurve
Returns the curve corresponding to the specified JWA registered curve name.getCurve()
Returns the JWA registered curve name.Returns the JCA curve name.int
Returns the key length in bytes.static OKPCurve
Returns the enum constant of this class with the specified name.static OKPCurve[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ED25519
Ed25519 curve as defined by RFC8037 Section 3.1 -
ED448
Ed448 curve as defined by RFC8037 Section 3.1 -
X25519
X25519 curve as defined by RFC8037 Section 3.2 -
X448
X448 curve as defined by RFC8037 Section 3.2
-
-
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
-
getKeyLength
public int getKeyLength()Returns the key length in bytes.
- Returns:
- the key length in bytes
-
fromCurve
Returns the curve corresponding to the specified JWA registered curve name.
- Parameters:
crv
- a JWA registered curve name- Returns:
- an OKP curve
- Throws:
IllegalArgumentException
- if the specified curve is not supported
-