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: support unencrypted PKCS#8 keys again #503

Merged
merged 2 commits into from
Jan 29, 2023

Conversation

mastermatt
Copy link
Contributor

Allow node-rsa to detect the format of the private key by not explicitly specifying an alias for the pkcs1-private-pem format.
Reference comment for details.

Fixes #452

@tngan

Allow `node-rsa` to detect the format of the private key by not explicitly specifying an alias for the `pkcs1-private-pem` format.
Reference [comment](tngan#452 (comment)) for details.

Fixes tngan#452
@tngan
Copy link
Owner

tngan commented Jan 28, 2023

@mastermatt thanks for the PR.

Is the new function octetStringBuilder only used in testing?
The create request function should already return the octet string (which is the query).

@mastermatt
Copy link
Contributor Author

@tngan octetStringBuilder is part of another change set Im working on, but it doesn't make sense to include it for this PR as, you are correct, it was only being used in the tests. I've I just pushed a commit that removes it and uses the parseRedirectUrlContextCallBack test helper instead.

@tngan
Copy link
Owner

tngan commented Jan 29, 2023

@mastermatt The change is valid, but I will make a remark in release where samlify only supports the key in PEM format.

Notice: For import, if keyData is PEM string or buffer containing string, you can do not specify format, but if you provide keyData as DER you must specify it in format string.

PEM is the most common format now where DER is just a binary version, we can bring the support easily later on.
Thanks for your nice work again.

@tngan tngan merged commit 3a8f9f3 into tngan:master Jan 29, 2023
@mastermatt mastermatt deleted the support-pkcs8-keys branch January 30, 2023 20:03
@mastermatt
Copy link
Contributor Author

@tngan could you publish a patch version to npm with this change please?

@tngan
Copy link
Owner

tngan commented Feb 14, 2023

Sure, please check v2.8.9

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.

"InvalidAsn1Error: encoding too long" after updating to 2.8.2
2 participants