node-jose icon indicating copy to clipboard operation
node-jose copied to clipboard

Example for Encrypt Data

Open bryannbarbosa opened this issue 4 years ago • 1 comments

Hello everyone, I want to implement a solution to encrypt a JWT in JWE, but I find it difficult to find a working example, could the support provide a happy way for this in the documentation?

The requirements for encrypt are: {"alg": "RSA-OAEP", "enc": "A128GCM", "cty": "JWT"}

I also have a PEM public key, if anyone can help in any way, I would be immensely grateful!

bryannbarbosa avatar Mar 09 '21 12:03 bryannbarbosa

Cheers, @bryannbarbosa

You could get started with my node-jose-tools package. It offers a CLI interface for node-jose. Its docu has some examples and you can toy with different features and strategies on the command line.

Each tool is structurally isolated, so you can have a closer look at how to implement the different features with node-jose. It has also a worked example for importing different key formats, including PEM.

phish108 avatar Mar 09 '21 20:03 phish108