ECDSASignature.fromDer constructor

ECDSASignature.fromDer(
  1. 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.

Implementation

factory ECDSASignature.fromDer(Uint8List signature) {
  try {
    return ECDSASignature.fromCompact(
      secp256k1.ecdsaSignatureFromDer(signature),
    );
  } on Secp256k1Exception {
    throw InvalidECDSASignature();
  }
}