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

feat: Ignore newlines in key generation and allow DER formatting #68

Merged
merged 4 commits into from
Jul 16, 2019

Conversation

Andrew-Lees11
Copy link
Contributor

This pull request is intended to address issue #51 where the rsa key creation appears to be failing due to poor formatting.

Inside BlueRSA, the PEM headers are stripped by splitting on new line characters and removing the lines with the PEM header string (e.g -----BEGIN PRIVATE KEY-----). This causes the generation to fail if the headers are not on there own line (e.g. Google seems to create the key with headers and body on a single line)

This PR removes all whitespace and checks for the header dashes (-----) in the same was as BlueECC so that whitespace doesn't change the ability to process they key. The BlueRSA key is then created from the resulting DER data.

Since we are now initializing from DER data I allowed that to be passed in to the public key initializer without failing and have added a test to cover this behavior.

Copy link

@kilnerm kilnerm left a comment

Choose a reason for hiding this comment

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

This all looks OK to me.

@ianpartridge ianpartridge self-assigned this Jul 16, 2019
@ianpartridge ianpartridge merged commit 88dbad6 into master Jul 16, 2019
@ianpartridge ianpartridge deleted the keyGen branch July 16, 2019 09:17
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.

3 participants