module

package
v0.0.0-...-903559f Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2018 License: MIT Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThalesHSM

type ThalesHSM struct {
	Port int
	Host string
}

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

func (h ThalesHSM) LoadKeys(wrappedPrivKey []byte) error

LoadKeys implements Hsm.LoadKeys by sending the encrypted key to the HSM to be loaded.

func (ThalesHSM) SignHeartbeat

func (h ThalesHSM) SignHeartbeat(chainId string, hb *types.Heartbeat) ([]byte, error)

SignHeartbeat implements Hsm.SignHeartbeat by signing the canonical representation of the heartbeat, within the HSM.

func (ThalesHSM) SignProposal

func (h ThalesHSM) SignProposal(chainId string, proposal *types.Proposal) ([]byte, error)

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.

func (ThalesHSM) SignVote

func (h ThalesHSM) SignVote(chainId string, vote *types.Vote) ([]byte, error)

SignVote implements Hsm.SignVote by signing the canonical representation of the vote, within the HSM. This operation will fail if there is a regression in round, step or height.

Jump to

Keyboard shortcuts

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