-
-
Notifications
You must be signed in to change notification settings - Fork 689
redbean: Add LuaCrypto compatible functions (plus some auxiliary functions) #1422
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for submitting this; looks great! Couple of suggestions on the API:
- I'd consider the following renaming for consistency:
csrGenerate
togenerateCsr
(orcreateCsr
),generatekeypair
togenerateKeyPair
andPemToJwk
toconvertPemToJwk
. - I wonder if
generatekeypair
can make its first parameter optional. I'd still allow it to be passed, but given that RSA has an optional integer parameter, if nothing is passed or an integer is passed, I'd run RSA key pair generation. - why is luaopen_lcrypto there if it doesn't seem to be defined/used?
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.
Looks good to me. Thanks!
@jart, does the API look good to you?
… GCM) Improve test coverage
Cleanup language on the test file
Add definitions Align function name
The options are now passed in a table instead of positional parameters. This is not LuaCrypto compatible but it is a nicer interface.
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.
Had a chance to review added methods and updated API. Looks good to me. Thanks!
Add correct jwltopem and pemtojwk function Expand tests
Awesome ! |
Improve error messages Improve parameter validation Correct base64url encoding for JWK Add support for optional claims to convertPemToJwk Expand test coverage Add basic definitions
@mterron, thank you for the updates! I liked added error checking and new functions! Noticed a couple of things to check on (couldn't leave comments on individual lines for some reason, so summarizing it here):
|
Improve JWK functions Enable PKCS1 v2.1 support in MBEDTLS
Implements part of Issue #1136