Documentation ¶
Overview ¶
Package module provides the interface to code running within the Thales HSM. It includes an implementation of the Hsm interface, which forms part of the Thales privValidator implementation.
Index ¶
- type ThalesHSM
- func (h ThalesHSM) GenerateKey() (validator.Ed25519KeyPair, error)
- func (h ThalesHSM) LoadKeys(wrappedPrivKey []byte) error
- func (h ThalesHSM) SignHeartbeat(chainId string, hb *types.Heartbeat) ([]byte, error)
- func (h ThalesHSM) SignProposal(chainId string, proposal *types.Proposal) ([]byte, error)
- func (h ThalesHSM) SignVote(chainId string, vote *types.Vote) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThalesHSM ¶
ThalesHSM implements validator.Hsm and is the interface to the CodeSafe machine running inside the nShield HSM. The CodeSafe machine will respond to instructions sent to its network interface (hence Port, Host).
func (ThalesHSM) GenerateKey ¶
func (h ThalesHSM) GenerateKey() (validator.Ed25519KeyPair, error)
GenerateKey implements Hsm.GenerateKey by creating a new ed25519 key pair in the HSM and returning an encrypted copy of the private key and the public key.
func (ThalesHSM) LoadKeys ¶
LoadKeys implements Hsm.LoadKeys by sending the encrypted key to the HSM to be loaded.
func (ThalesHSM) SignHeartbeat ¶
SignHeartbeat implements Hsm.SignHeartbeat by signing the canonical representation of the heartbeat, within the HSM.
func (ThalesHSM) SignProposal ¶
SignProposal implements Hsm.SignProposal by signing the canonical representation of the proposal, within the HSM. This operation will fail if there is a regression in round, step or height.