KeyPair class final
An ECDSA key pair, which signs with the algorithm it was made for.
- Implemented types
Constructors
- KeyPair.fromPkcs8(SigningAlgorithm algorithm, Uint8List der)
-
Parses a PKCS#8 private key for
algorithm's curve. - KeyPair.fromScalarAndPublicKey(SigningAlgorithm algorithm, Uint8List scalar, Uint8List publicKey)
-
Loads a fixed-length big-endian
scalar, refused unlesspublicKey, an X9.62 point, is its public key, as a JWK'sdandx/ycarry them. - KeyPair.fromSec1(SigningAlgorithm algorithm, Uint8List der)
-
Parses a SEC1
ECPrivateKeyforalgorithm's curve. - KeyPair.generate(SigningAlgorithm algorithm)
-
Generates a random key pair for
algorithm.
Properties
- algorithm → SigningAlgorithm
-
The algorithm the key pair signs with.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- publicKey → PublicKey
-
The public key, which verifies the key pair's signatures with the
VerificationAlgorithm of algorithm's name.
latefinal
- 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
-
sign(
Uint8List message) → Uint8List -
Signs
message. -
toPkcs8(
) → Uint8List - Encodes the private key as PKCS#8.
-
toScalar(
) → Uint8List - The private key's fixed-length big-endian scalar.
-
toSec1(
) → Uint8List -
Encodes the private key as a SEC1
ECPrivateKey. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited