Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Private keys from APN support #146

Merged
merged 6 commits into from
Oct 18, 2016
Merged

Private keys from APN support #146

merged 6 commits into from
Oct 18, 2016

Conversation

Spomky
Copy link
Member

@Spomky Spomky commented Oct 17, 2016

This PR fixes #141

The keys generated by the Apple Push Notification Service are not correctly loaded by the JWKFactory and the EC key converter.
It seems that the problem comes from the way the keys are encoded.
As per the ASN.1 parser, the sequence that holds the information is wrapped into another sequence. This sequence comes from the RFC5208.

At the moment, this PR fixes the bug. A test has been added.
However the key converter should be updated to be fully compliant with the RFC5915 and RFC5208.

  • Load keys from APN (see RFC5208)
  • Fix loading with older OpenSSL versions whern linebreaks after 64 chars are not set.

@Spomky
Copy link
Member Author

Spomky commented Oct 17, 2016

@edamov could you please verify the key is correctly loaded with by this PR?

@edamov
Copy link

edamov commented Oct 18, 2016

It works!

@Spomky
Copy link
Member Author

Spomky commented Oct 18, 2016

Thanks. It seems I introduced a new bug (a test failed on that PR).
I will fix it then I'll merge and tag by the end of the day.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.051% when pulling 409e992 on APNKeysSupport into 229c6ca on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.051% when pulling 409e992 on APNKeysSupport into 229c6ca on master.

@coveralls
Copy link

coveralls commented Oct 18, 2016

Coverage Status

Coverage increased (+0.06%) to 93.087% when pulling 2609dc2 on APNKeysSupport into 229c6ca on master.

@Spomky Spomky merged commit 4b1cb24 into master Oct 18, 2016
@Spomky
Copy link
Member Author

Spomky commented Oct 18, 2016

Merged and tagged as v6.1.1.

Thanks again

@Spomky Spomky deleted the APNKeysSupport branch October 20, 2016 08:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate JWT for Apple Push Notification
3 participants