signal-bot icon indicating copy to clipboard operation
signal-bot copied to clipboard

Save keys (don't generate new IdentityKeyPair every time)

Open EscolarProgramming opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. It would be great if the KeyPair is not regenerated at every startup, but is saved so that the contact does not have to be reconfirmed every time in Signal.

Describe the solution you'd like Keys shuld be saved

Additional context I've already tried to do it by myself, but it looks like I used the wrong approach. I'm using the following approach: Check if KeyPair.txt exists if not exists -> Generate KeyPair, serialize it and save it to KeyPair.txt if exists -> Deserialize key from KeyPair.txt After that refresh the pre keys. At the first start everything works without problems. But when I stop it and start it again, it doesn't work anymore. I always get the following error when I try to write a message to the bot: "Error processing message: org.signal.libsignal.metadata.ProtocolNoSessionException: org.whispersystems.libsignal.NoSessionException: No session for: <UUID>:1". It doesn't matter where I put the refreshPreKeys, or if I leave it out altogether.

EscolarProgramming avatar Nov 21 '21 13:11 EscolarProgramming