ecdsaSignDer method

Future<Uint8List> ecdsaSignDer({
  1. required String namedCurve,
  2. required String hashAlgorithm,
  3. required Uint8List pkcs8PrivateKey,
  4. required Uint8List data,
})

Implementation

Future<Uint8List> ecdsaSignDer({
  required String namedCurve,
  required String hashAlgorithm,
  required Uint8List pkcs8PrivateKey,
  required Uint8List data,
}) async {
  final signature = await _crypto.ecdsaSign(
    namedCurve: namedCurve,
    hashAlgorithm: hashAlgorithm,
    pkcs8PrivateKey: pkcs8PrivateKey,
    data: data,
  );
  if (_looksLikeDer(signature)) {
    return signature;
  }
  return ecdsaRawToDer(signature, namedCurve: namedCurve);
}