Accept more Private Key formats

This commit is contained in:
Vishesh Handa
2020-11-15 00:35:49 +01:00
parent b9e81b7ae7
commit 3b4c257afc

View File

@ -36,6 +36,7 @@ class RsaKeyPair {
}
}
if (privateKey == null) {
try {
this.privateKey = RSAPrivateKey.fromPEM(privateKey);
} catch (e) {
@ -43,6 +44,15 @@ class RsaKeyPair {
}
}
if (privateKey == null) {
try {
this.privateKey = RSAPrivateKey.fromString(privateKey);
} catch (e) {
// Ignore
}
}
}
RsaKeyPair.generate() {
var keyPair = RSAKeypair.fromRandom(keySize: 4096);