mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
Accept more Private Key formats
This commit is contained in:
@ -36,6 +36,7 @@ class RsaKeyPair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (privateKey == null) {
|
||||||
try {
|
try {
|
||||||
this.privateKey = RSAPrivateKey.fromPEM(privateKey);
|
this.privateKey = RSAPrivateKey.fromPEM(privateKey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -43,6 +44,15 @@ class RsaKeyPair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (privateKey == null) {
|
||||||
|
try {
|
||||||
|
this.privateKey = RSAPrivateKey.fromString(privateKey);
|
||||||
|
} catch (e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RsaKeyPair.generate() {
|
RsaKeyPair.generate() {
|
||||||
var keyPair = RSAKeypair.fromRandom(keySize: 4096);
|
var keyPair = RSAKeypair.fromRandom(keySize: 4096);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user