Replies: 1 comment
-
Because it's not a valid PEM. PEM requires new line after and before the envelope. This works just fine because the newlines were added. jose.JWK.asKey(`-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA3u72sO2d+i+XyAp52pd6xFvPjf0FyXRIe0rAWZ9//nZNnWbDxWA4TxUertB6xaW5aB/pBTa7DY0Cxh6IvR1F6QU3w+r60W/0/Lj+XNqkA1vwHgpJzYBpHHTt5ka59hE4ahVjqVrBZD1hbj4D3xrS4CjAQKjbVXQ/q5knZQEJhfEcSff6n51RyQxSxusqEH/VxLirl1Sn6TdQ4cg4n8Get0+qAMiV0NeePVnOdFQoTrngo5Lx+Z0/ta/YFvS09xgbr6Dd6AgIOfpRuCoTJ3gV45HzwiECfqCG5dXFj2GDG7K9A4e/QIVVOFCHhnJ5FNe0znM1cwOnCtB4ku+woYaV9QIDAQABAoIBAQC5T7BWYB66kgc8LKEf+Fz/jkXYhGPkEroRapC7rx8JGbPozDyd/B6ydh7cN8ZmNx0IlcXwJI+WcwnEQCtv8D5ltYWmYNR/de4SiYA/FSvS8wCFKA4zObOmCPicO1xnU+cuH3uJkjxBo9gyeHBla3mxBY7R8MrpnMk0Tgn2JseQws6+5mOAknOTMvazvo+xs5eIV7wbSc3TnXW49EnTpa/JmkxVx9r5i8q1H74goQOtO9NqoV3mZXIUMDo6JilFfCNitUnbY7jBWsM2J1afdk8S/DLpGfqiydQvilb4sXR+MF38A540uWwMYPvz7PrmdLLBZhaU7dl0dks0UycBFlOhAoGBAP7d7PLxFXaBna4qbSFSZ+ekW/4oQIiJVsJ1nq7Y+w+uZpA/YcJXQtmsc/av8/8aqgPRvszbGBLL2I0wWyHYdehFqo2atkMgb6AQXyydzSkLGwRPhzaVejJMRJIF5Mw52kWLgGx8KBOFTk2fV8W/lb4FCY1ufI1hWdO87LIEboY5AoGBAN/ssXv5S7ENqq5MO6CUArF5R5ScydddwahFYlfxAVR4vNzCU5aspOFbzJG2wuPuS3lVtEgexbjK3yI2i8ycmWjAO2/MO8gS83XtuVTHKE2GslpYJ22JhKiDJj6SGU5UqGglx6NnfFkKkIpz440ZGZnwXFWG/Y6Ajs3gS/BvWG2dAoGBAOmxG97257MtziMwi7gOE2/26NL2nZWUOJU9vC6ejjYmt6x0MXM9B/MHiZ0cYSH8lP/DhqvYCQ7TEtEDEczK6fH8TxJgVdbfGvsth9clKkUEBdXCBj0qek08WXN7K/uG4Hj8HNlcTnL3vIC4JocP0IHXpJamRFZueSsJBA+GuMEhAoGBALA2flD2FGeHPrqcyQuLjjcFHpxHadruL/hwaXyU7pv/y3faAJeA0tt5Nxmv/dwKaSBZnl5mwOez1jYBQLBKx7qUE/HdgWnn5+j0ozSg6QlhJzdLSfO8FUXatxzkMb/fhQs4N8tSI5uaYbZijj4581idurufWCds6XP/vyK9LJRNAoGATUh6A8Kfqv73lXu06lVIiaqIrbhXtcbvZtYhvmqpgdd8u4LTFytcn2NHRi48pv2VtForzTC5ID4UVylp6HJ0QDLYC5z3bDt9st5IOYJX6zdNVJkB7FEsnS5/n+tNz3fgYUqGXBmz29hq9dfXBPSoHvlDZviQRfXeIDwYw+BAX2g=
-----END RSA PRIVATE KEY-----`) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I tried to migrate
asKey
from the node-jose library (which worked) to jose.Here is how I invoke the function:
asKey(secretKey, { use: 'sig' });
I noticed that an error is being thrown by line 82 of
import.js
which is where the private key should be created from the secretKey string.Here is a sample secretKey that I'm using just for development purposes:
Any thoughts as to why this string isn't compatible with the new library? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions