Documentation
¶
Index ¶
- func ToEncryptedJSON(key KeyBundle, password string, scryptParams utils.ScryptParams) (export []byte, err error)
- type EncryptedOCRKeyExport
- type KeyBundle
- type OffchainKeyring
- func (ok *OffchainKeyring) ConfigDiffieHellman(point [curve25519.PointSize]byte) ([curve25519.PointSize]byte, error)
- func (ok *OffchainKeyring) ConfigEncryptionPublicKey() ocrtypes.ConfigEncryptionPublicKey
- func (ok *OffchainKeyring) NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error)
- func (ok *OffchainKeyring) OffchainPublicKey() ocrtypes.OffchainPublicKey
- func (ok *OffchainKeyring) OffchainSign(msg []byte) (signature []byte, err error)
- type Raw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
func (EncryptedOCRKeyExport) GetCrypto ¶
func (x EncryptedOCRKeyExport) GetCrypto() keystore.CryptoJSON
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
// Decrypts ciphertext using the encryptionKey from an OCR2 OffchainKeyring
NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error)
}
nolint
func FromEncryptedJSON ¶
FromEncryptedJSON returns key from encrypted json
func MustNewInsecure ¶
MustNewInsecure returns key bundle based on the chain type or panics
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) NaclBoxOpenAnonymous ¶ added in v2.3.0
func (ok *OffchainKeyring) NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error)
NaclBoxOpenAnonymous decrypts a message that was encrypted using the OCR2 Offchain 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