EcdhCurve enum ECDH

The elliptic curve used for ECDH key agreement.

Passed to EcdhBuilder.curve. Defaults to p256.

Selection guide:

Curve Security Typical use
p256 128-bit Default. TLS, WebCrypto, mobile.
p384 192-bit Regulated or long-lived secrets.
p521 256-bit Maximum security; slower.

See also:

Inheritance
Available extensions

Values

p256 → const EcdhCurve

NIST P-256 (secp256r1). 128-bit security level. Default.

The most widely deployed curve — used by TLS, JWK, WebCrypto, and most cloud KMS systems.

Example:

final pair = await Fortis.ecdh().curve(EcdhCurve.p256).generateKeyPair();
p384 → const EcdhCurve

NIST P-384 (secp384r1). 192-bit security level.

Recommended for regulated environments (CNSA Suite, NSA Suite B) and long-lived secrets.

Example:

final pair = await Fortis.ecdh().curve(EcdhCurve.p384).generateKeyPair();
p521 → const EcdhCurve

NIST P-521 (secp521r1). 256-bit security level.

Highest security among the NIST curves; also the slowest. Field size is 521 bits (not 512) — the padding in encoded points reflects this.

Example:

final pair = await Fortis.ecdh().curve(EcdhCurve.p521).generateKeyPair();

Properties

domainName String
The PointyCastle domain name for this curve.
no setter
fieldSizeBytes int
The field size in bytes for this curve.
no setter
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
oid String
The ASN.1 OID that identifies this curve in X.509 / PKCS#8 structures.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromOid(String oid) EcdhCurve?
Resolves an OID string to an EcdhCurve, or null if not recognized.

Constants

values → const List<EcdhCurve>
A constant List of the values in this enum, in order of their declaration.