Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

VAPID keys generated by npm web-push do not work #3

Open
mbemowski opened this issue Jan 24, 2018 · 1 comment
Open

VAPID keys generated by npm web-push do not work #3

mbemowski opened this issue Jan 24, 2018 · 1 comment

Comments

@mbemowski
Copy link

The method for creating VAPID keys using node web-push, that is described in the readme, does not work correctly. The tool does not include a padding that is required by BouncyCastle to correctly generate the EC keys. However, they work in the node web-push CLI itself.

I could not find a solution for this issue for a long time because I assumed that the keys are valid. I had to use the web-push-libs/webpush-java CLI to generate the VAPID keys and then it finally worked.

Please update the readme and consider adding CLI for generating keys, like in the webpush-java.

@martijndwars
Copy link

martijndwars commented Feb 2, 2018

FYI: This problem has been fixed in webpush-java. The relevant change can be found here. To apply the fix to the Scala library, modify line 31 in Utils.java to use BigIntegers.fromUnsignedByteArray(privateKey) instead of new BigInteger(privateKey). Please leave a comment if you're still unable to use keys generated by Node's web-push.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants