mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
Add missing \n at the end of Public Pem causing errors.
This commit is contained in:
parent
baaac91055
commit
09cdf6c77d
@ -224,7 +224,7 @@ function PublicKey(rsa) {
|
||||
}
|
||||
|
||||
function toPublicPem(encoding) {
|
||||
return encodeBuffer(rsa.getPublicPEM(), encoding);
|
||||
return encodeBuffer(rsa.getPublicPEM() + "\n", encoding);
|
||||
}
|
||||
|
||||
function toPublicSsh(encoding) {
|
||||
@ -339,10 +339,10 @@ function PrivateKey(rsa) {
|
||||
*/
|
||||
function createPublicKey(pem, encoding) {
|
||||
var rsa = new RsaWrap();
|
||||
//pem = decodeString(pem, encoding);
|
||||
pem = decodeString(pem, encoding);
|
||||
|
||||
try {
|
||||
rsa.loadFromPEM(pem);
|
||||
rsa.loadFromPEM(pem.toString('utf8'));
|
||||
} catch (ex) {
|
||||
if (!isPublicKeyPem(pem)) {
|
||||
throw new Error("Not a public key.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user