keyhelper

package
v0.0.0-...-e34fb4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: GPL-3.0 Imports: 7 Imported by: 7

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIdentityKeyPair

func GenerateIdentityKeyPair() (*identity.KeyPair, error)

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 GenerateSenderSigningKey

func GenerateSenderSigningKey() (*ecc.ECKeyPair, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL