AndrewBarba / apns2

Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
MIT License
118 stars 32 forks source link

Change signerKey to be either object or string to allow certificate passphrases #53

Closed bigboypantson closed 2 years ago

bigboypantson commented 2 years ago

We could change the signerKey to accept either string or object, then we can pass in an object with key and passphrase like the example below, jwt.sign accepts the following format.

signingKey: { key: fs.readFileSync('/path/to/your/key.ext'), passphrase: 'secretpassphrase' }

I have tested this and it works with very few changes, let me know if you think this is a good idea and I will do the PR.

Thanks

AndrewBarba commented 2 years ago

Hey @bigboypantson sorry for the delay. This makes sense to me - feel free to open PR

AndrewBarba commented 2 years ago

@bigboypantson This is all set on main, I'll be releasing v10 shortly