ocr2key

package
v1.3.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyBundleFromOCR1Key

func NewKeyBundleFromOCR1Key(v1key ocrkey.KeyV2) (evmKeyBundle, error)

NewKeyBundleFromOCR1Key gets the key bundle from an OCR1 key

func ToEncryptedJSON

func ToEncryptedJSON(key KeyBundle, password string, scryptParams utils.ScryptParams) (export []byte, err error)

ToEncryptedJSON returns encrypted JSON representing key

Types

type EncryptedOCRKeyExport

type EncryptedOCRKeyExport struct {
	KeyType           string              `json:"keyType"`
	ChainType         chaintype.ChainType `json:"chainType"`
	ID                string              `json:"id"`
	OnchainPublicKey  string              `json:"onchainPublicKey"`
	OffChainPublicKey string              `json:"offchainPublicKey"`
	ConfigPublicKey   string              `json:"configPublicKey"`
	Crypto            keystore.CryptoJSON `json:"crypto"`
}

EncryptedOCRKeyExport represents encrypted OCR key export

type KeyBundle

type KeyBundle interface {
	// OnchainKeyring is used for signing reports (groups of observations, verified onchain)
	ocrtypes.OnchainKeyring
	// OffchainKeyring is used for signing observations
	ocrtypes.OffchainKeyring
	ID() string
	ChainType() chaintype.ChainType
	Marshal() ([]byte, error)
	Unmarshal(b []byte) (err error)
	Raw() Raw
	OnChainPublicKey() string
}

nolint

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (KeyBundle, error)

FromEncryptedJSON returns key from encrypted json

func MustNewInsecure

func MustNewInsecure(reader io.Reader, chainType chaintype.ChainType) KeyBundle

MustNewInsecure returns key bundle based on the chain type or panics

func New

func New(chainType chaintype.ChainType) (KeyBundle, error)

New returns key bundle based on the chain type

type OffchainKeyring

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

OffchainKeyring contains the secret keys needed for the OCR nodes to share secrets and perform aggregation.

This is currently an ed25519 signing key and a separate encryption key.

All its functions should be thread-safe.

func (*OffchainKeyring) ConfigDiffieHellman

func (ok *OffchainKeyring) ConfigDiffieHellman(point [curve25519.PointSize]byte) ([curve25519.PointSize]byte, error)

ConfigDiffieHellman returns the shared point obtained by multiplying someone's public key by a secret scalar ( in this case, the offchain key ring's encryption key.)

func (*OffchainKeyring) ConfigEncryptionPublicKey

func (ok *OffchainKeyring) ConfigEncryptionPublicKey() ocrtypes.ConfigEncryptionPublicKey

ConfigEncryptionPublicKey returns config public key

func (*OffchainKeyring) OffchainPublicKey

func (ok *OffchainKeyring) OffchainPublicKey() ocrtypes.OffchainPublicKey

OffchainPublicKey returns the public component of this offchain keyring.

func (*OffchainKeyring) OffchainSign

func (ok *OffchainKeyring) OffchainSign(msg []byte) (signature []byte, err error)

OffchainSign signs message using private key

type Raw

type Raw []byte

nolint

func (Raw) Key

func (raw Raw) Key() KeyBundle

Jump to

Keyboard shortcuts

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