mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
Accept more Private Key formats
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user