Skip to content

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

Merged
ianpartridge merged 4 commits intomasterfrom
keyGen
Jul 16, 2019
Merged

feat: Ignore newlines in key generation and allow DER formatting#68
ianpartridge merged 4 commits intomasterfrom
keyGen

Conversation

@Andrew-Lees11
Copy link
Copy Markdown
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
Copy Markdown

@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