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,10 +36,20 @@ class RsaKeyPair {
} }
} }
try { if (privateKey == null) {
this.privateKey = RSAPrivateKey.fromPEM(privateKey); try {
} catch (e) { this.privateKey = RSAPrivateKey.fromPEM(privateKey);
// Ignore } catch (e) {
// Ignore
}
}
if (privateKey == null) {
try {
this.privateKey = RSAPrivateKey.fromString(privateKey);
} catch (e) {
// Ignore
}
} }
} }