Documentation ¶
Overview ¶
Package file provides a PEM file backed signer.
Index ¶
- Constants
- Variables
- func NewFactory(config interface{}, roles ...signature.SignerRole) (signature.SignerFactory, error)
- type Factory
- func (fac *Factory) EnsureRole(role signature.SignerRole) error
- func (fac *Factory) ForceLoad(fn string) (signature.Signer, error)
- func (fac *Factory) Generate(role signature.SignerRole, rng io.Reader) (signature.Signer, error)
- func (fac *Factory) Load(role signature.SignerRole) (signature.Signer, error)
- type Signer
Constants ¶
const ( // SignerName is the name used to identify the file backed signer. SignerName = "file" // StaticEntropySize is the size of the provided static entropy. StaticEntropySize = 32 )
Variables ¶
var ( // FileEntityKey is the entity key filename. FileEntityKey = "entity.pem" // FileIdentityKey is the identity key filename. FileIdentityKey = "identity.pem" // FileP2PKey is the P2P key filename. FileP2PKey = "p2p.pem" // FileP2PStaticEntropy is the static P2P entropy filename. FileP2PStaticEntropy = "p2p_entropy.pem" // FileConsensusKey is the consensus key filename. FileConsensusKey = "consensus.pem" // FileVRFKey is the vrf key filename. FileVRFKey = "vrf.pem" )
Functions ¶
func NewFactory ¶
func NewFactory(config interface{}, roles ...signature.SignerRole) (signature.SignerFactory, error)
NewFactory creates a new factory with the specified roles, with the specified dataDir.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a PEM file backed SignerFactory.
func (*Factory) EnsureRole ¶
func (fac *Factory) EnsureRole(role signature.SignerRole) error
EnsureRole ensures that the SignerFactory is configured for the given role.
func (*Factory) ForceLoad ¶
ForceLoad is evil and should be destroyed, however that requires fixing deployment, and the entity key for node registration mess.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is a PEM file backed Signer.
func (*Signer) ContextSign ¶
ContextSign generates a signature with the private key over the context and message.
func (*Signer) Prove ¶ added in v0.2200.0
Prove generates a VRF proof with the private key over the alpha.
func (*Signer) Reset ¶
func (s *Signer) Reset()
Reset tears down the Signer and obliterates any sensitive state if any.
func (*Signer) StaticEntropy ¶ added in v0.2200.0
StaticEntropy returns PrivateKeySize bytes of cryptographic entropy that is independent from the Signer's private key. The value of this entropy is constant for the lifespan of the signer's underlying key pair.