prekey

package
v0.0.0-...-32f009b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidIdentityKey = errors.New("invalid identity key - expected length to be 32 bytes")
)

Functions

This section is empty.

Types

type PreKey

type PreKey struct {
	x3dh.KeyPair
	IdentityPublicKey [32]byte
	Signature         []byte
	// unix timestamp in second
	Time int64
}

func FromProtoBuf

func FromProtoBuf(preKey pb.PreKey) (PreKey, error)

func (PreKey) OlderThan

func (p PreKey) OlderThan(past time.Duration) bool

check if pre key is older than given date

func (*PreKey) Sign

func (p *PreKey) Sign(km km.KeyManager) error

sign prekey public key

func (PreKey) ToProtobuf

func (p PreKey) ToProtobuf() (pb.PreKey, error)

func (PreKey) VerifySignature

func (p PreKey) VerifySignature(publicKey ed25519.PublicKey) (bool, error)

Jump to

Keyboard shortcuts

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