@Immutable public final class Curve extends Object implements Serializable
Includes constants for the following standard cryptographic curves:
See
Modifier and Type | Field and Description |
---|---|
static Curve |
Ed25519
Ed25519 signature algorithm key pairs.
|
static Curve |
Ed448
Ed448 signature algorithm key pairs.
|
static Curve |
P_256
P-256 curve (secp256r1, also called prime256v1, OID =
1.2.840.10045.3.1.7).
|
static Curve |
P_256K
P-256K curve (secp256k1, OID = 1.3.132.0.10).
|
static Curve |
P_384
P-384 curve (secp384r1, OID = 1.3.132.0.34).
|
static Curve |
P_521
P-521 curve (secp521r1).
|
static Curve |
X25519
X25519 function key pairs.
|
static Curve |
X448
X448 function key pairs.
|
Constructor and Description |
---|
Curve(String name)
Creates a new cryptographic curve with the specified JOSE name.
|
Curve(String name,
String stdName,
String oid)
Creates a new cryptographic curve with the specified JOSE name,
standard name and object identifier (OID).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
static Curve |
forECParameterSpec(ECParameterSpec spec)
Gets the cryptographic curve for the specified parameter
specification.
|
static Set<Curve> |
forJWSAlgorithm(JWSAlgorithm alg)
Gets the cryptographic curve(s) for the specified JWS algorithm.
|
static Curve |
forOID(String oid)
Gets the cryptographic curve for the specified object identifier
(OID).
|
static Curve |
forStdName(String stdName)
Gets the cryptographic curve for the specified standard
name.
|
String |
getName()
Returns the JOSE name of this cryptographic curve.
|
String |
getOID()
Returns the standard object identifier (OID) of this cryptographic
curve.
|
String |
getStdName()
Returns the standard name of this cryptographic curve.
|
static Curve |
parse(String s)
Parses a cryptographic curve from the specified string.
|
ECParameterSpec |
toECParameterSpec()
Returns the parameter specification for this cryptographic curve.
|
String |
toString() |
public static final Curve P_256
public Curve(String name)
name
- The JOSE name of the cryptographic curve. Must not be
null
.public Curve(String name, String stdName, String oid)
name
- The JOSE name of the cryptographic curve. Must not
be null
.stdName
- The standard name of the cryptographic curve,
null
if not specified.oid
- The object identifier (OID) of the cryptographic
curve, null
if not specified.public String getName()
public String getStdName()
null
if not specified.public String getOID()
null
if not specified.public ECParameterSpec toECParameterSpec()
null
if it cannot be
determined.public static Curve parse(String s)
s
- The string to parse. Must not be null
or empty.public static Curve forStdName(String stdName)
stdName
- The standard curve name. May be null
.null
if it cannot be determined.public static Curve forOID(String oid)
oid
- The object OID. May be null
.null
if it cannot be determined.public static Set<Curve> forJWSAlgorithm(JWSAlgorithm alg)
alg
- The JWS algorithm. May be null
.null
if the JWS algorithm is not curve
based, or the JWS algorithm is not supported.public static Curve forECParameterSpec(ECParameterSpec spec)
spec
- The EC parameter spec. May be null
.null
if it cannot be determined.Copyright © 2019 Connect2id Ltd.. All rights reserved.