ECDSASignature class

Constructors

ECDSASignature.fromCompact(Uint8List compact)
Takes a 64-byte compact signature representation. See this.compact. InvalidECDSASignature will be thrown if the signature is not valid.
ECDSASignature.fromCompactHex(String hex)
Takes a HEX encoded 64-byte compact signature representation. See ECDSASignature.fromCompact.
ECDSASignature.fromDer(Uint8List signature)
Takes a BIP66 DER formatted signature. InvalidECDSASignature will be thrown only if it is not formatted correctly. R and S values outside the order are accepted and will be set to 0 such that signatures will fail verification with a public key.
factory
ECDSASignature.fromDerHex(String hex)
Takes a BIP66 DER formatted signature as a HEX string. See ECDSASignature.fromDer.
factory
ECDSASignature.sign(ECPrivateKey privkey, Uint8List hash, {bool forceLowR = true})
Creates a signature using a private key (privkey) for a given 32-byte hash. The signature will be generated deterministically and shall be the same for a given hash and key. If forceLowR is true (default), then signatures with high r-values will be skipped until a signature with a low r-value is found.
factory

Properties

compact Uint8List
A compact representation of a ECDSASignature containing a big-endian 32-byte R value and big-endian 32-byte S value.
no setter
der Uint8List
Returns the DER encoding for the signature
no setter
hashCode int
The hash code for this object.
no setterinherited
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
verify(ECPublicKey publickey, Uint8List hash) bool
Takes a 32-byte message hash and publickey and returns true if the signature is valid for the public key and hash. This accepts malleable signatures with high and low S-values.

Operators

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

Constants

compactLength → const int