session-foundation / session-push-notification-server

Server which collects APNS tokens and sends oblivious notifications to iOS devices
GNU Affero General Public License v3.0
0 stars 0 forks source link

Where can I find the pubkey for the server ? #8

Closed ultrainstintgoku closed 2 years ago

ultrainstintgoku commented 2 years ago

I try to run the Push Notification server , But Cant Able to find the Pubkey

RyanRory commented 2 years ago

Hi @ultrainstintgoku, thanks for reaching out. You may want to create your own x25519 key pair so you can run the server. And you need your own apple push service certificate to make the server work. :)

ultrainstintgoku commented 2 years ago

Hello @RyanRory . Thanks for the update . I have Created the x25519 key pair using the following command openssl genpkey -algorithm x25519 -out x25519_private_key.pem . After running the server i am getting a error as

shared_secret = _curve25519.make_shared(server_privkey_bytes, client_pubkey_bytes) ValueError: input must be 32-byte string 500 error . is there any specific method to used to create a keys . and also need some explanation about how to create public key (hex) which is used inside the session to connect with the server

RyanRory commented 2 years ago

You can use a python script to generate the key pair, here is an example:

    random = get_random_bytes(32)                      # The private key 32 bytes
    priv = _curve25519.make_private(random)
    print(priv.hex())
    pub = _curve25519.make_public(priv)
    print(pub.hex())

I'll update the README to include this info.

martin-braun commented 1 year ago

@RyanRory Why does oxend not create a public key called key_ed25519.pub and key_X25519.pub on launch instead? The step could be unnecessary, actually.

For anybody else finding this: oxend-sn-keys generate FILENAME generates a new private key while printing the public key.