Skip to content

JWE Encypt support string type in plainText parameter #156

Answered by panva
adrianlivr asked this question in Q&A
Discussion options

You must be logged in to vote

Did you open the docs? It shows how in each jwe example. Also, Buffer instances are Uint8Arrays in Node.

All you have to do in node is pass Buffer.from(yourString), alternatively, if your string uses encoding other than utf-8, pass Buffer.from(yourString, encoding).

The API intentionally only accepts and returns UInt8Array so that it does not have to deal with encoding.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianlivr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants