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 {
this.privateKey = RSAPrivateKey.fromPEM(privateKey);
} catch (e) {
// Ignore
if (privateKey == null) {
try {
this.privateKey = RSAPrivateKey.fromPEM(privateKey);
} catch (e) {
// Ignore
}
}
if (privateKey == null) {
try {
this.privateKey = RSAPrivateKey.fromString(privateKey);
} catch (e) {
// Ignore
}
}
}