vkhandler

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAddressSignature = fmt.Errorf("invalid viewing key signature for requested address")

Functions

This section is empty.

Types

type VKHandler

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

VKHandler handles encryption and validation of viewing keys

func New

func New(requestedAddr *gethcommon.Address, vkPubKeyBytes, accountSignatureHexBytes []byte, chainID int64) (*VKHandler, error)

New creates a new viewing key handler if signature is valid and was produced by given address It receives address, viewing key and a signature over viewing key. In order to check signature validity, we need to reproduce a message that was originally signed

func (*VKHandler) Encrypt

func (m *VKHandler) Encrypt(bytes []byte) ([]byte, error)

Encrypt returns the payload encrypted with the viewingKey

Jump to

Keyboard shortcuts

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