sharedsecret

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MPL-2.0, MPL-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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