How to upload your key? write

Displays this error

InvalidAsn1Error: encoding too long

what's the problem? or advise something new to implement signature with rsa sha?

```
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");
```

Displays this error

InvalidAsn1Error: encoding too long

what's the problem? or advise something new to implement signature with rsa sha?

asked June 8th 19 at 17:31

1 answer

answered on June 8th 19 at 17:33

And you've been looking at: https://github.com/rzcoder/node-rsa#importexport-keys?

And you have different quotes in the first and in the following lines.

UPD:

And that's a problem almost your: https://github.com/rzcoder/node-rsa/issues/45

And you have different quotes in the first and in the following lines.

UPD:

And that's a problem almost your: https://github.com/rzcoder/node-rsa/issues/45

Find more questions by tags CryptographyEncryptionNode.jsnpm