rsaSign static method

Uint8List rsaSign(
  1. RSAPrivateKey privateKey,
  2. Uint8List dataToSign
)

Signing the given dataToSign with the given privateKey. algorithm support SHA-256/RSA only

Implementation

static Uint8List rsaSign(RSAPrivateKey privateKey, Uint8List dataToSign) {
  const String algorithmName = 'SHA-256/RSA';
  final RSASigner signer = Signer(algorithmName) as RSASigner;
  signer.init(true, PrivateKeyParameter<RSAPrivateKey>(privateKey));
  final RSASignature sig = signer.generateSignature(dataToSign);
  return sig.bytes;
}