Documentation ¶
Overview ¶
Package plugin implements the Go plugin signature signer.
Index ¶
Constants ¶
View Source
const (
// SignerName is the name used to identify the plugin backed signer.
SignerName = "plugin"
)
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory(config interface{}, roles ...signature.SignerRole) (signature.SignerFactory, error)
NewFactory creates a new factory backed by the specified plugin and plugin configuration.
Types ¶
type FactoryConfig ¶
type FactoryConfig struct { // Name is the expected human readable name of the plugin (eg: "ledger", "memory") Name string // Path is the path to the plugin dynamic shared object. Path string // Config is the plugin configuration. Config string }
FactoryConfig is the plugin factory configuration.
type RPCContextSignArgs ¶
type RPCContextSignArgs struct { Role signature.SignerRole RawContext signature.Context Message []byte }
RPCContextSignArgs is exposed entirely to placate `net/rpc`.
type RPCInitArgs ¶
type RPCInitArgs struct { Config string Roles []signature.SignerRole }
RPCInitArgs is exposed entirely to placate `net/rpc`.
type RPCLoadArgs ¶
type RPCLoadArgs struct { Role signature.SignerRole MustGenerate bool }
RPCLoadArgs is exposed entirely to placate `net/rpc`.
type Signer ¶
type Signer interface { // Initialize initializes the plugin with the provided configuration // and roles. Initialize(config string, roles ...signature.SignerRole) error // Load will load the private key corresponding to the provided role, // optionally generating a new keypair if requested. Load(role signature.SignerRole, mustGenerate bool) error // Public returns the public key corresponding to a given role. Public(role signature.SignerRole) (signature.PublicKey, error) // ContextSign generates a signature with the given role's private // key over the context and message. // // Note: Unlike the real signature.Signer interface, it is assumed // that the caller handles context registration and domain // separation. ContextSign(role signature.SignerRole, rawContext signature.Context, message []byte) ([]byte, error) }
Signer is the interface that must be implemented by all signer plugins.
Click to show internal directories.
Click to hide internal directories.