-
Notifications
You must be signed in to change notification settings - Fork 358
Implement rsa toPem, toDer, and fromJwk utilities #2389
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
Conversation
if (result.error != simdutf::SUCCESS) return kj::none; | ||
KJ_ASSERT(result.count <= size); | ||
return buf.first(result.count).attach(kj::mv(buf)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewer note: This is a more efficient alternative to the existing base64 url decoding method we have based on kj::decodeBase64. This one follows the standard forgiving base64 decode algorithm defined by whatwg specs. Soon I expect this to be moved out of this rsa.c++ file and into a shared location.
Separating out more of the node.js crypto key handling support. There's a lot to do with all this so I'm piecing it out into separate PRs that individually are easier to review. This adds methods but does not add the stuff that uses it yet. Tests for these individual pieces will also be added separately. A fair amount of this is adapted from https://github.com/nodejs/node/blob/main/src/crypto/crypto_keys.cc