A
A
alpa_kz2018-01-31 12:25:15
Encryption
alpa_kz, 2018-01-31 12:25:15

Who uses the node-rsa library, I can't figure out how to enable my private keys?

How to upload your key? writing

key.importKey('-----BEGIN RSA PRIVATE KEY-----\n'+
    "kNBrP8tIJOygO25g/R0ZocgY+WUPHE/xvVomhPf8hnD4X7ldn/NGYRXjsVJ5WPhB\n"+
    "4l0p95RNveQW2nlTyyRiqpymAD7iqM7ztpktTghh0Bjwl0Qk1zluxycCtZW3/HzW\n"+
    "vXdfOuQmftDh6gZsTQ5jx67YXZABqjTUV5RCAwwx4mklDC2TYpJd1pdVgdXjPCcP\n"+
    "LnREinm4QjFC7Ph27vbLc/no0PwJFgzzf4/UrYv0TFx90mwQCaz/gJg5h1nXolaG\n"+
    "3nTBXnND5jX99IdMOF1igGzGDAL8oLqclsP6d8Cq3/bHyENzPnAhXoro/oOH6q6F\n"+
    "3E+JY9ILIw6LCZr8JbE13XzCbbpds2kn+xTViGgbbgpTNx0q6AKwQtiwZsqcT7cu\n"+
    "mRoH4V8QdMEUO8AQV8LCH5xpw1qYbbfAFo2hM3le9lUqD5aOl8Dd19l0Im7rXC6/\n"+
    "QKGsweSqs+ysGjExP/xI9noH3kiE2vXlbiRmwUgoqYU5TSAV4t1RVsjm1zb8CtvY\n"+
    "B67OMPJx6ATN+bJs8mq54nz1Cpz6Nk7n2gUi+NWKleaxTcb1FOXTN3Zty5OM5LDs\n"+
    "WZqvaVawyaePaubVGGEcYB3Pq6MyJuxjROgneaU5Oxx3b+FyLoc197rELYsz+N1A\n"+
    "LpbJsnf+aXpKeLqDX5Nk0b9ZB4tOu+lWxfmUYZXAcvym32NhApXR5olkyqNVKSJi\n"+
    "GZZRtK+9gXPlKecB6/XZXm+H1hc6jw4gIesaEJ8b8YyYF3s6iJTGdba4D17kghQ7\n"+
    "XwXfhSxUBnkgI/RULCwnf8ZFjI7H92+qiiG/jW8JLMA=\n"+
    "-----END RSA PRIVATE KEY-----","private");

It gives such an error
InvalidAsn1Error: encoding too long
what is the problem? or advise something new to implement sha with rsa signature?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cyril, 2018-01-31
@argz

Did you look here: https://github.com/rzcoder/node-rsa#importexport-keys ?
And you have different quotes in the first and subsequent lines.
UPD:
And here is almost your issue: https://github.com/rzcoder/node-rsa/issues/45

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question