privateKey method

Rsa privateKey(
  1. dynamic key
)

Sets the private key on this encryption object.

Implementation

Rsa privateKey(dynamic key) {
  if (key is RSAPrivateKey) {
    _privateKey = key;
  } else if (key is String) {
    _privateKey = RSAKeyParser().parse(key) as RSAPrivateKey;
  } else {
    throw Exception(
        'Unknown privateKey type: [${key?.runtimeType.toString()}]');
  }

  return this;
}