encoding method
Sets the RSAEncoding to use for RSA based encryption values.
Implementation
Rsa encoding(dynamic encoding) {
if (encoding is RSAEncoding) {
_encoding = encoding;
} else if (encoding is String) {
switch (encoding) {
case 'OAEP':
_encoding = RSAEncoding.OAEP;
break;
case 'PKCS1':
_encoding = RSAEncoding.PKCS1;
break;
default:
throw Exception(
'Unknown RSA Encoding value encountered: [$encoding]',
);
}
} else {
throw Exception(
'Unknown RSA Encoding type: [${encoding?.runtimeType.toString()}]',
);
}
return this;
}