recovery

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recovery

type Recovery interface {
	GenerateEncryptionKey(recoveryKeys map[string]string) ([]byte, error)
	GenerateRecoveryData(recoveryKeys map[string]string) (map[string][]byte, []byte, error)
	RecoverKey(secret []byte) (int, []byte, error)
	GetRecoveryData() ([]byte, error)
	SetRecoveryData(data []byte) error
}

Recovery describes an interface which the core can use to choose a recoverer (e.g. only single-party recoverer, multi-party recoverer) depending on the version of MarbleRun.

type SinglePartyRecovery

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

SinglePartyRecovery is a recoverer with support for single-party recovery only.

func NewSinglePartyRecovery

func NewSinglePartyRecovery() *SinglePartyRecovery

NewSinglePartyRecovery generates a single-party recoverer which the core can use to call recovery functions.

func (*SinglePartyRecovery) GenerateEncryptionKey

func (r *SinglePartyRecovery) GenerateEncryptionKey(recoveryKeys map[string]string) ([]byte, error)

GenerateEncryptionKey generates an encryption key according to the implicitly defined recovery mode.

func (*SinglePartyRecovery) GenerateRecoveryData

func (r *SinglePartyRecovery) GenerateRecoveryData(recoveryKeys map[string]string) (map[string][]byte, []byte, error)

GenerateRecoveryData generates the recovery data which is returned to the user.

func (*SinglePartyRecovery) GetRecoveryData

func (r *SinglePartyRecovery) GetRecoveryData() ([]byte, error)

GetRecoveryData returns the current recovery hash map. Given that we do not need to store any additional data in the state for Single Party Recovery, it does nothing here.

func (*SinglePartyRecovery) RecoverKey

func (r *SinglePartyRecovery) RecoverKey(secret []byte) (int, []byte, error)

RecoverKey is called by the client api and directly returns the recovery key (this is different for multi-party recovery in other versions of MarbleRun).

func (*SinglePartyRecovery) SetRecoveryData

func (r *SinglePartyRecovery) SetRecoveryData(_ []byte) error

SetRecoveryData sets the recovery hash map retrieved from the sealer on (failed) decryption. Given that we do not need to store any additional data in the state for Single Party Recovery, it does nothing here.

Jump to

Keyboard shortcuts

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