signDigest static method

Uint8List signDigest({
  1. required RSAPrivateKey privateKey,
  2. required Uint8List digest,
  3. String? digestOid,
})

Implementation

static Uint8List signDigest({
  required RSAPrivateKey privateKey,
  required Uint8List digest,
  String? digestOid,
}) {
  final digestInfo = buildDigestInfo(digest, digestOid: digestOid);
  final engine = PKCS1Encoding(RSAEngine())
    ..init(true, PrivateKeyParameter<RSAPrivateKey>(privateKey));
  final signature = engine.process(digestInfo);
  return Uint8List.fromList(signature);
}