ECDSARecoverableSignature class
An ECDSARecoverableSignature is similar to an ECDSASignature but contains an additional byte that encodes a "recid" and compression flag that allows for the public key to be recovered from the message hash and signature.
Constructors
- ECDSARecoverableSignature.fromCompact(Uint8List compact)
-
Takes a 65-byte compact recoverable signature representation.
InvalidECDSARecoverableSignature will be thrown if the signature is not
valid.
factory
- ECDSARecoverableSignature.fromCompactHex(String hex)
-
Takes a HEX encoded 65-byte compact recoverable signature representation.
See ECDSARecoverableSignature.fromCompact.
factory
- ECDSARecoverableSignature.sign(ECPrivateKey privkey, Uint8List hash)
-
Creates a recoverable signature using a private key (
privkey
) for a given 32-bytehash
.factory
Properties
- compact → Uint8List
-
no setter
- compressed → bool
-
Whether the recovered public key should be in compressed format or not
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- recid → int
-
The recovery ID needed to recover the public key
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature → ECDSASignature
-
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recover(
Uint8List hash) → ECPublicKey? -
Given a 32-byte
hash
, returns a public key recovered from the signature and hash. This can be compared against the expected public key or public key hash to determine if the message was signed correctly. If a public key cannot be extracted, null shall be returned. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- compactLength → const int