mailproxy: github.com/katzenpost/mailproxy/internal/recipient Index | Files

package recipient

import "github.com/katzenpost/mailproxy/internal/recipient"

Package recipient implements the recipient public key store.

Index

Package Files

recipient.go

type Store Uses

type Store struct {
    sync.Mutex
    // contains filtered or unexported fields
}

Store is the recipient store.

func New Uses

func New(cfg *config.Config, t *thwack.Server) *Store

New constructs a new Store instance.

func (*Store) Clear Uses

func (s *Store) Clear(r string) error

Clear removes the recipient and corresponding ecdh.PublicKey from the Store.

func (*Store) CloneRecipients Uses

func (s *Store) CloneRecipients() map[string]*ecdh.PublicKey

CloneRecipients returns a copy of the internal recipient map.

func (*Store) Get Uses

func (s *Store) Get(r string) *ecdh.PublicKey

Get returns the ecdh.PublicKey for the given recipient, or nil iff the recipient does not exist. Note that this treats Normalize() failures as if the recipient is invalid.

func (*Store) GetByKey Uses

func (s *Store) GetByKey(k *ecdh.PublicKey) string

GetByKey returns the identifier for the provided public key if any.

func (*Store) LoadFromPEM Uses

func (s *Store) LoadFromPEM(path string) error

LoadFromPEM adds a receipient from a PEM file on disk.

func (*Store) Normalize Uses

func (s *Store) Normalize(r string) (string, string, string, error)

Normalize normalizes the provided recipient according to the rules specified at the Store construction time, along with performing some basic sanity checking, and returns the normalized address, local part and domain. The Store is not queried for recipient presence.

func (*Store) Set Uses

func (s *Store) Set(r string, k *ecdh.PublicKey) error

Set sets the ecdh.PublicKey for the provided recipient. If an existing key is present, it will be silently overwritten.

Package recipient imports 13 packages (graph) and is imported by 1 packages. Updated 2018-11-10. Refresh now. Tools for package owners.