RsaKeyPair: Improve isValid

This commit is contained in:
Vishesh Handa
2020-11-15 00:50:33 +01:00
parent f821fc73e1
commit 568e9a407f

View File

@ -72,6 +72,9 @@ class RsaKeyPair {
// Tries to encrypt and decrypt
bool isValid() {
if (publicKey == null || privateKey == null) {
return false;
}
var orig = 'word';
var enc = publicKey.encrypt(orig);
var dec = privateKey.decrypt(enc);