-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support ASN.1 RSAPublicKey type as defined by PKCS#1 #257
Conversation
@travist Could you review this PR? |
ping @travist |
Looks good! Thank you! Since this is a pretty large change, I would like to see some automated tests written for these changes for me to accept this into the library. Please add some tests and I would be happy to include this contribution. Thanks. Travis. |
@travist Thanks! Could you let me know how to run the test code? Docs have no information about the test. Also, there's no test script in the package.json |
dfda016
to
7ee4a46
Compare
Test code does not work, so I enable test code for local using chai & dirty-chai & ts-mocha and add test script to package.json. Also, I add the unit test for pkcs#1 format pub key. As the OpenSSL only exports pubkey by X509 format, I generate pkcs#1 format pub key using ssh-keygen with type RSA. I refer to https://www.rfc-editor.org/rfc/rfc4716#section-3.4, https://stackoverflow.com/questions/18039401/how-can-i-transform-between-the-two-styles-of-public-key-format-one-begin-rsa. |
I would like to do this PR as part of hacktoberfest. Would you add the label "HACKTOBERFEST-ACCEPTED" to this PR? |
ping @travist |
Done! Thank you and have fun at hacktoberfest! |
@travist Oh, thanks! However, it was not the title but this label! |
Also, Could you review this PR? @travist |
I tried to pull this in and build but ran into issues. First one was
I then changed the module to "esnext" in tsconfig-def.json but then ran into this
I then tried to change the "require" statements to "import" and then received the following
I think this PR still needs some work. |
Co-authored-by: oscharchoi <[email protected]>
…nit test - Fix "to.have.keys" to "to.include.all.keys" for superset of [n, e] in pubkey verification unit test
- Change webpack.config.js and webpack.prod.js to esm - Change tsconfig-def.json's module to esnext - Get version from process.env.npm_package_version
@travist Oh, Sorry for that. I changed package.json's type to module due to test code's esm.
|
@travist Could you review that? I checked them and all scripts currently work! |
ping @travist |
Looks good! Thanks! |
So I am not able to release this because it broke the application. Try the following to reproduce...
Not sure what you changed that would affect that but it will block release... |
I'll check it now. |
I found out that bin/jsencrypt.min.js is breaking when build. |
When I remove the next line in webpack.config.js, then build successfully.
|
I run into a problem getting the version in the browser using the process variable.
I changed the original code which gets the version from package.json because the test script does not work well. I will fix it today. |
Currently, the jsencrypt package only supports ASN.1 SubjectPublicKeyInfo type as defined by X.509.
However, many native platforms' RSA key libraries still only support ASN.1 RSAPublicKey type as defined by PKCS#1. Thus, we also need to support ASN.1 RSAPublicKey type as defined by PKCS#1.
Thanks @travist for the JavaScript RSA Encryption package!