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

fix(ext/node): handle KeyObject in prepareAsymmetricKey #23026

Merged
merged 6 commits into from
Mar 22, 2024

Conversation

littledivy
Copy link
Member

Fixes #20938

@littledivy littledivy changed the title fix(ext/node): handle KeyObject in `prepareAsymmetricKey" fix(ext/node): handle KeyObject in prepareAsymmetricKey Mar 22, 2024
@littledivy littledivy enabled auto-merge (squash) March 22, 2024 04:56
@@ -215,6 +215,12 @@ export interface JsonWebKeyInput {
export function prepareAsymmetricKey(key) {
if (isStringOrBuffer(key)) {
return { format: "pem", data: getArrayBufferOrView(key, "key") };
} else if (isKeyObject(key)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting that this works in node but docs don't mention about KeyObject being a valid input.

Copy link
Member

@satyarohith satyarohith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@littledivy littledivy merged commit 43be979 into denoland:main Mar 22, 2024
17 checks passed
@littledivy littledivy deleted the assymetric_prepare_keyobject branch March 22, 2024 17:44
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 this pull request may close these issues.

jsonwebtoken cannot sign with RS256
2 participants