Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment contains incorrect code example. #1233

Closed
coryschwartz opened this issue Nov 8, 2024 · 1 comment · Fixed by #1234
Closed

Comment contains incorrect code example. #1233

coryschwartz opened this issue Nov 8, 2024 · 1 comment · Fixed by #1234
Assignees

Comments

@coryschwartz
Copy link

This comment here

gives an example for encrypting a JWT toekn in a JWE container, and the example tells us to do this:

//	   Encrypt(jwa.RSA_OAEP, key.PublicKey).

But I think this might be wrong. Encrypt() wants an EncryptionOption which is not implemented
by the algorithm or the the key. Instead, I think this what is intended.

// publicKey := recipientPublicKeyFromSomewhereMaybeFromCache()
...
// Encrypt(jwt.WithEncryptOption(jwe.WithKey(jwa.RSA_OAEP(), publicKey)))

@lestrrat
Copy link
Collaborator

lestrrat commented Nov 9, 2024

That's probably an artifact from v1. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants