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: Add support for pkcs#8 private keys #49

Merged
merged 1 commit into from
Jul 18, 2019
Merged

feat: Add support for pkcs#8 private keys #49

merged 1 commit into from
Jul 18, 2019

Conversation

Andrew-Lees11
Copy link
Contributor

This pull request adds support for PKCS#8 formatted private keys on macOS.
These are keys that begin with:

-----BEGIN PRIVATE KEY-----

This has been achieved by stripping the header byes for private keys inside stripX509CertificateHeader.

A test for this format has been added which would fail before but will now succeed.

This is required because on Swift-JWT issue 51 somebody was providing a pkcs8 private key which was working on linux but not on macOS.

@billabt
Copy link
Collaborator

billabt commented Jul 8, 2019

CI is failing... Don't want to merge unless we can get a clean CI build. I restarted it but it's still failing on the Swift dev snapshot. Here's that error being reported...


>> Building Swift package...
/Users/travis/build/IBM-Swift/BlueRSA: error: manifest parse error(s):
<unknown>:0: error: Swift does not support the SDK 'MacOSX10.14.sdk'
The command "./Package-Builder/build-package.sh -projectDir $TRAVIS_BUILD_DIR" exited with 1.

It looks to me like it could be a travis configuration issue...

Use correct PEM header in getPemString
@ianpartridge
Copy link
Contributor

Fixed the CI problem by rebasing the branch onto master so it included 9ead942 (the problem is that the latest Swift snapshots will only run on Xcode 11, which isn't available in Travis yet 😢)

@billabt can you approve and merge this please?

Copy link
Collaborator

@billabt billabt left a comment

Choose a reason for hiding this comment

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

👍

@billabt billabt merged commit 9435e10 into master Jul 18, 2019
@billabt billabt deleted the pkcs8 branch July 18, 2019 13:54
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