kukosk / pyapns_client

Simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the HTTP/2 Push provider API.
Other
25 stars 11 forks source link

Support using an encrypted auth key #9

Closed ppawlak closed 2 years ago

ppawlak commented 2 years ago

Keeping an unencrypted private key on your filesystem is not a good practice and before deploying my code I have encrypted my private key with:

openssl ec -aes256 -in AuthKey_XXXXXX.p8  -out AuthKey_XXXXXRX.encrypted.p8

This PR adds supports for auth keys encrypted this way, by adding an optional password parameter to APNSClient constructor.

kukosk commented 2 years ago

Thank you very much @ppawlak for the PR, but I think private key encryption is out of the scope of pyapns_client. I also checked other APNS libraries and none of them are built to work with encrypted private key out of the box. So considering the fact that it can be added very easily by subclassing APNSClient and overriding just one method, I decided not to merge this change in.