ppm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicParamsLoader

type PublicParamsLoader interface {
	// Fetch fetches the public parameters from the backend
	Fetch() ([]byte, error)
	// FetchParams fetches the public parameters from the backend and unmarshal them
	FetchParams() (*crypto.PublicParams, error)
}

type PublicParamsManager

type PublicParamsManager struct {
	PP                 *crypto.PublicParams
	PublicParamsLoader PublicParamsLoader
	// the vault
	Vault Vault
	// label of the public params
	PPLabel string

	Mutex sync.RWMutex
}

func NewFromParams

func NewFromParams(pp *crypto.PublicParams) (*PublicParamsManager, error)

func NewPublicParamsManager added in v0.2.0

func NewPublicParamsManager(PPLabel string, vault Vault, publicParamsLoader PublicParamsLoader) *PublicParamsManager

func (*PublicParamsManager) Fetch

func (v *PublicParamsManager) Fetch() ([]byte, error)

func (*PublicParamsManager) Load added in v0.2.0

func (v *PublicParamsManager) Load() error

func (*PublicParamsManager) NewCertifierKeyPair

func (v *PublicParamsManager) NewCertifierKeyPair() ([]byte, []byte, error)

func (*PublicParamsManager) PublicParameters

func (v *PublicParamsManager) PublicParameters() driver.PublicParameters

func (*PublicParamsManager) PublicParams

func (v *PublicParamsManager) PublicParams() *crypto.PublicParams

func (*PublicParamsManager) SerializePublicParameters

func (v *PublicParamsManager) SerializePublicParameters() ([]byte, error)

SerializePublicParameters returns the public params in a serialized form

func (*PublicParamsManager) SetPublicParameters added in v0.2.0

func (v *PublicParamsManager) SetPublicParameters(raw []byte) error

SetPublicParameters updates the public parameters with the passed value

func (*PublicParamsManager) Validate

func (v *PublicParamsManager) Validate() error

Validate validates the public parameters

type Vault added in v0.2.0

type Vault interface {
	// PublicParams returns the public parameters
	PublicParams() ([]byte, error)
}

Jump to

Keyboard shortcuts

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