decryption

package
v0.0.0-...-6d02989 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotInRecipients is returned when the connector is not one
	// of the recipients of the link to decrypt.
	ErrNotInRecipients = errors.New("the link was not encrypted for us")

	// ErrNoData is returned when the link contains no data.
	ErrNoData = errors.New("the link contains no data")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// SigningPrivateKey is pretty well named.
	EncryptionPrivateKey string `toml:"encryption_private_key" comment:"The encryption private key."`

	// ConfigVersion is the version of the configuration file.
	ConfigVersion int `toml:"configuration_version" comment:"The version of the service configuration."`
}

Config contains configuration options for the Ping service.

type Decryptor

type Decryptor interface {
	// Decrypt a single link. The decryption is done in place.
	DecryptLink(context.Context, *cs.Link) error
	// DecryptLinks decrypts a list of links. e.g. trace.links.nodes. The decryption is done in place.
	DecryptLinks(context.Context, []*cs.Link) error
	// DecryptLinkData decrypts data given a list of recipients and returns the decrypted data.
	DecryptLinkData(ctx context.Context, data []byte, recipients []*Recipient) ([]byte, error)
}

Decryptor decrypt links using the connector's key. Each link mist contain data and meta.recipients.

type Recipient

type Recipient struct {
	PubKey       string
	SymmetricKey []byte
}

Recipient is a decryption recipient.

type Service

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

Service is the Ping service.

func (*Service) Config

func (s *Service) Config() interface{}

Config returns the current service configuration or creates one with good default values.

func (*Service) Desc

func (s *Service) Desc() string

Desc returns a description of what the service does.

func (*Service) Expose

func (s *Service) Expose() interface{}

Expose exposes the stratumn client to other services.

It exposes the decryptor instance

func (*Service) ID

func (s *Service) ID() string

ID returns the unique identifier of the service.

func (*Service) Migrations

func (s *Service) Migrations() []cfg.MigrateHandler

Migrations is the services migrations.

func (*Service) Name

func (s *Service) Name() string

Name returns the human friendly name of the service.

func (*Service) Needs

func (s *Service) Needs() map[string]struct{}

Needs returns the set of services this service depends on.

func (*Service) Plug

func (s *Service) Plug(exposed map[string]interface{}) error

Plug sets the connected services.

func (*Service) Run

func (s *Service) Run(ctx context.Context, running, stopping func()) error

Run starts the service.

func (*Service) SetConfig

func (s *Service) SetConfig(config interface{}) error

SetConfig configures the service.

func (*Service) VersionKey

func (s *Service) VersionKey() string

VersionKey is the version key.

Directories

Path Synopsis
Package mockdecryptor is a generated GoMock package.
Package mockdecryptor is a generated GoMock package.

Jump to

Keyboard shortcuts

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