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 ¶
View Source
const (
// SignerName is the name used to identify the file backed signer.
SignerName = "file"
)
Variables ¶
View Source
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" // FileConsensusKey is the consensus key filename. FileConsensusKey = "consensus.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.
Click to show internal directories.
Click to hide internal directories.