I receive an error "no importer for key" when try to add private key to keystore. ``` javascript var privkey = fs.readFileSync('/certs/key.pem'); var jose = require('node-jose'); var keystore = jose.JWK.createKeyStore(); keystore.add(privkey, 'pem') .then(function (key) { joseprivkey = key; }, function (err) { console.error('Failed to create JWE key: ', err); }); ``` **forge.asn1.validate errors:** [ECPrivateKey] Expected type "16", got "3" [ECPrivateKey] Expected tag class "0", got "64" **type**: SEQUENCE, got BITSTRING **tag class**: UNIVERSAL, got APPLICATION **certificate**: ``` -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,DA07AA34F2B9374D582546854D8362F5 XXX -----END RSA PRIVATE KEY----- ```
Activity
linuxwolf commentedon Jul 28, 2016
This method does not supported encrypted private keys. You would need to first decrypt it via other means and then pass the decrypted PEM to
add().mirik123 commentedon Jul 29, 2016
That means that the private key should be without passphrase?
linuxwolf commentedon Aug 1, 2016
That is correct