mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
RsaKeyPair: Improve isValid
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user