sharedsecret

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	// contains filtered or unexported fields
}

type Secret

type Secret struct {
	Identity *ecdsa.PublicKey
	Key      []byte
}

type SharedSecret

type SharedSecret struct {
	// contains filtered or unexported fields
}

SharedSecret generates and manages negotiated secrets. Identities (public keys) stored by SharedSecret are compressed. TODO: make compression of public keys a responsibility of sqlitePersistence instead of SharedSecret.

func New

func New(db *sql.DB, logger *zap.Logger) *SharedSecret

func (*SharedSecret) Agreed

func (s *SharedSecret) Agreed(myPrivateKey *ecdsa.PrivateKey, myInstallationID string, theirPublicKey *ecdsa.PublicKey, theirInstallationIDs []string) (*Secret, bool, error)

Agreed returns true if a secret has been acknowledged by all the installationIDs.

func (*SharedSecret) All

func (s *SharedSecret) All() ([]*Secret, error)

func (*SharedSecret) Generate

func (s *SharedSecret) Generate(myPrivateKey *ecdsa.PrivateKey, theirPublicKey *ecdsa.PublicKey, installationID string) (*Secret, error)

Generate will generate a shared secret for a given identity, and return it.

Jump to

Keyboard shortcuts

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