KeyType enum

The key types Activeledger understands, and their exact wire strings.

These strings are the whole contract. The ledger validates nothing else about them: the value travels from $tx.$i[label].type into the identity stream's meta.authorities[].type verbatim, and comes back out at verification time. Two consequences worth knowing before debugging anything:

  • A typo in the string, or a key of the wrong length, surfaces as 1220 "Signature Incorrect", never as "unknown algorithm".
  • The ledger defaults a missing type to rsa. Omitting it for a post-quantum key produces an RSA verification attempt against a base64 blob, so this SDK always sends it explicitly.
Inheritance
Available extensions

Values

secp256k1 → const KeyType

secp256k1 ECDSA. Keys are 0x-prefixed hex; signatures are SHA-256, then ECDSA, then DER.

const KeyType('secp256k1')
mlDsa65 → const KeyType

ML-DSA-65 (FIPS 204). The conservative post-quantum choice - a finalised standard, at the cost of 1952 byte public keys and 3309 byte signatures against secp256k1's 33 and ~71. Always available: implemented in pure Dart.

const KeyType('ml-dsa-65')
falcon512 → const KeyType

Falcon-512 (FN-DSA). Roughly a fifth of ML-DSA-65's signature size, which matters because every signature is broadcast to every node and stored for the life of the ledger.

Its signature length VARIES, 649-662 bytes, because the encoding compresses. Do not assume a fixed width anywhere.

Needs the activeledger_falcon package - see PostQuantum.isAvailable.

const KeyType('falcon-512')
rsa → const KeyType

RSA, for legacy identities only (for example a network's contract deployer). Existing PEM keys can sign and verify; new ones cannot be generated.

const KeyType('rsa')

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
isPostQuantum → bool
True for the post-quantum schemes, whose keys are base64 raw bytes.
no setter
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
wire → String
The exact string the ledger stores and compares.
final

Methods

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

Operators

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

Static Properties

preferredPostQuantum → KeyType
The best post-quantum scheme available in this process.
no setter

Static Methods

fromWire(String value) → KeyType
Parses a wire string, throwing on anything unrecognised.

Constants

postQuantum → const List<KeyType>
The post-quantum members of KeyType.
values → const List<KeyType>
A constant List of the values in this enum, in order of their declaration.