Documentation ¶
Overview ¶
Package keyhelper is based on: https://github.com/WhisperSystems/libsignal-protocol-java/blob/master/java/src/main/java/org/whispersystems/libsignal/util/KeyHelper.java
Index ¶
- func GenerateIdentityKeyPair() (*identity.KeyPair, error)
- func GenerateIdentityKeyPairAsync(completion complete.Completionable)
- func GenerateLastResortKey(serializer record.PreKeySerializer) (*record.PreKey, error)
- func GeneratePreKeys(start int, count int, serializer record.PreKeySerializer) ([]*record.PreKey, error)
- func GenerateRegistrationID() uint32
- func GenerateSenderKey() []byte
- func GenerateSenderKeyID() uint32
- func GenerateSenderSigningKey() (*ecc.ECKeyPair, error)
- func GenerateSignedPreKey(identityKeyPair *identity.KeyPair, signedPreKeyID uint32, ...) (*record.SignedPreKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIdentityKeyPair ¶
GenerateIdentityKeyPair generates an identity keypair used for signing. Clients should only do this once at install time.
func GenerateIdentityKeyPairAsync ¶
func GenerateIdentityKeyPairAsync(completion complete.Completionable)
GenerateIdentityKeyPairAsync generates an identity keypair asyncronously.
func GenerateLastResortKey ¶
func GenerateLastResortKey(serializer record.PreKeySerializer) (*record.PreKey, error)
GenerateLastResortKey will generate the last resort PreKey. Clients should do this only once, at install time, and durably store it for the length of the install.
func GeneratePreKeys ¶
func GeneratePreKeys(start int, count int, serializer record.PreKeySerializer) ([]*record.PreKey, error)
GeneratePreKeys generates a list of PreKeys. Client shsould do this at install time, and subsequently any time the list of PreKeys stored on the server runs low.
PreKeys IDs are shorts, so they will eventually be repeated. Clients should store PreKeys in a circular buffer, so that they are repeated as infrequently as possible.
func GenerateRegistrationID ¶
func GenerateRegistrationID() uint32
GenerateRegistrationID generates a registration ID. Clients should only do this once, at install time.
func GenerateSenderKey ¶
func GenerateSenderKey() []byte
func GenerateSenderKeyID ¶
func GenerateSenderKeyID() uint32
func GenerateSignedPreKey ¶
func GenerateSignedPreKey(identityKeyPair *identity.KeyPair, signedPreKeyID uint32, serializer record.SignedPreKeySerializer) (*record.SignedPreKey, error)
GenerateSignedPreKey generates a signed PreKey.
Types ¶
This section is empty.