yaronn / ws.js

A WS-* client stack for node.js. Written in pure javascript!
http://webservices20.blogspot.com/
103 stars 64 forks source link

Key format #27

Closed carbonrobot closed 8 years ago

carbonrobot commented 8 years ago

What is the expected key format? I have tried PEM and DER, but keep getting errors.

yaronn commented 8 years ago

PEM should work, for example: https://github.com/yaronn/xml-crypto/blob/master/test/static/client.pem (you can debug in xml-crypto to see the exact error if you still get errors)

carbonrobot commented 8 years ago

Do you just create a PEM file using openssl? And how do create one that doesn't use a passphrase?

yaronn commented 8 years ago

I think you should be able to use the workaround here: https://github.com/yaronn/xml-crypto/issues/45

On Mon, Feb 15, 2016 at 11:36 PM, Charlie Brown notifications@github.com wrote:

After some debugging and playing with different formats, I got it working. Needed to export PKCS12 to PEM.

How do I set the password for it?

— Reply to this email directly or view it on GitHub https://github.com/yaronn/ws.js/issues/27#issuecomment-184404793.

I'm on Twitter (@YaronNaveh http://twitter.com/#!/YaronNaveh)

carbonrobot commented 8 years ago

Using a key of the format https://github.com/yaronn/xml-crypto/blob/master/test/static/client.pem gets and error. "Provided PEM-format key does not contain certificate information!"

yaronn commented 8 years ago

Try this https://github.com/yaronn/ws.js/blob/master/examples/signature.js The pem is in the same folder. On Feb 16, 2016 04:03, "Charlie Brown" notifications@github.com wrote:

Using a key of the format https://github.com/yaronn/xml-crypto/blob/master/test/static/client.pem gets and error. "Provided PEM-format key does not contain certificate information!"

— Reply to this email directly or view it on GitHub https://github.com/yaronn/ws.js/issues/27#issuecomment-184474792.

carbonrobot commented 8 years ago

Covered in the xml-crypto readme.

https://github.com/yaronn/xml-crypto#x509--key-formats