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

Support string value for APNs private key #13

Open
cat-bro opened this issue Oct 27, 2019 · 4 comments
Open

Support string value for APNs private key #13

cat-bro opened this issue Oct 27, 2019 · 4 comments
Labels

Comments

@cat-bro
Copy link

cat-bro commented Oct 27, 2019

Would be possible in future versions to allow the private key (key argument to APNs) to be a string instead of a file path, or to have a separate argument (e.g. key_string) for this purpose?

The use case for this is an application that keeps all of its private keys in an encrypted file in an external package. We don't want to keep a file containing the private key in the code base, or write temp files.

@akalex
Copy link

akalex commented Mar 9, 2021

@Fatal1ty just wondering are there any plans to get it done?

@Fatal1ty
Copy link
Owner

I'll try my best to implement this soon. If you want this done asap, pull requests are welcome.

@arunrejimitsogo
Copy link

Please add option to pass APNs certificate(containing private key) as bytes instead of file path.

@rnevius
Copy link

rnevius commented May 6, 2022

This would be nice to have. I have implemented something like the following in my own project, but it's not ideal:

import tempfile

from aioapns import APNs

keyfile = tempfile.NamedTemporaryFile()
keyfile.write(b"APNS_KEY")
keyfile.seek(0)
client = APNs(
    key=keyfile.name,
    # ...other config
)
keyfile.close()

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

No branches or pull requests

5 participants