identity

package
v0.0.0-...-de156ab Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DecodeString   = base64.RawStdEncoding.DecodeString
	EncodeToString = base64.RawStdEncoding.EncodeToString
)

Functions

func NewIdentity

func NewIdentity(passphrase string, aliases []string) (*publicIdentity, *privateIdentity, error)

func NewLocalStore

func NewLocalStore(dbPath string) (*localStore, error)

Types

type PrivateIdentity

type PrivateIdentity interface {
	PublicIdentity

	ECDSAPrivateKey() *ecdsa.PrivateKey
	Ed25519PrivateKey() ed25519.PrivateKey
	SealPrivateKey() [32]byte

	OpenMessage(PublicIdentity, []byte) (string, error)
	SealMessage(PublicIdentity, string) ([]byte, error)

	OpenAnonymous([]byte) (string, error)
}

type PublicIdentity

type PublicIdentity interface {
	ECDSAPublicKey() *ecdsa.PublicKey
	Ed25519PublicKey() ed25519.PublicKey
	SealPublicKey() [32]byte

	String() string

	Authenticate(passphrase string) (PrivateIdentity, error)
	SealAnonymous(value string) ([]byte, error)
}

type Store

type Store interface {
	NewIdentity(string, []string) (PublicIdentity, PrivateIdentity, error)
	GetIdentity(string) (PublicIdentity, error)
	PutSecret(PublicIdentity, string, string) error
	GetSecret(PrivateIdentity, string) (string, error)
	Close()
}

Jump to

Keyboard shortcuts

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