ocr2key

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RawReportContext3

func RawReportContext3(digest types.ConfigDigest, seqNr uint64) [2][32]byte

func ReportToSigData

func ReportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) []byte

func ReportToSigData3

func ReportToSigData3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) []byte

func ToEncryptedJSON

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

ToEncryptedJSON returns encrypted JSON representing key

Types

type EncryptedOCRKeyExport

type EncryptedOCRKeyExport struct {
	KeyType           string              `json:"keyType"`
	ChainType         corekeys.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

func (EncryptedOCRKeyExport) GetCrypto

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

	OCR3SignerVerifier

	ID() string
	ChainType() corekeys.ChainType
	Marshal() ([]byte, error)
	Unmarshal(b []byte) (err error)
	Raw() internal.Raw
	OnChainPublicKey() string
	// Decrypts ciphertext using the encryptionKey from an OCR2 offchainKeyring
	NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error)
}

func FromEncryptedJSON

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

FromEncryptedJSON returns key from encrypted json

func KeyFor

func KeyFor(raw internal.Raw) (kb KeyBundle)

func MustNewInsecure

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

MustNewInsecure returns key bundle based on the chain type or panics

func New

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

New returns key bundle based on the chain type

type OCR3SignerVerifier

type OCR3SignerVerifier interface {
	SignBlob(b []byte) (sig []byte, err error)
	VerifyBlob(publicKey ocrtypes.OnchainPublicKey, b []byte, sig []byte) bool
	Sign3(digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error)
	Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool
}

Jump to

Keyboard shortcuts

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