Documentation ¶
Overview ¶
Package memory provides a memory backed Signer, primarily for use in testing.
Index ¶
- Constants
- func NewFactory() signature.SignerFactory
- func NewFromRuntime(rtPrivKey goEd25519.PrivateKey) signature.Signer
- func NewFromSeed(seed []byte) (signature.Signer, error)
- func NewSigner(entropy io.Reader) (signature.Signer, error)
- func NewTestSigner(name string) signature.Signer
- type Factory
- type Signer
Constants ¶
const ( // SignerName is the name used to identify the memory backed signer. SignerName = "memory" // SeedSize is the size of an RFC 8032 seed in bytes. SeedSize = ed25519.SeedSize )
Variables ¶
This section is empty.
Functions ¶
func NewFromRuntime ¶
func NewFromRuntime(rtPrivKey goEd25519.PrivateKey) signature.Signer
NewFromRuntime creates a new signer from a runtime private key.
func NewFromSeed ¶ added in v0.2102.0
NewFromSeed creates a new signer from a RFC 8032 seed.
func NewTestSigner ¶
NewTestSigner generates a new signer deterministically from a test key name string, registers it as a test key, and returns the signer.
This routine will panic on failure.
Types ¶
type Factory ¶
type Factory struct{}
Factory is a memory backed SignerFactory.
func (*Factory) EnsureRole ¶
func (fac *Factory) EnsureRole(role signature.SignerRole) error
EnsureRole is a no-op for testing expedience.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is a memory backed Signer.
func (*Signer) ContextSign ¶
ContextSign generates a signature with the private key over the context and message.
func (*Signer) Reset ¶
func (s *Signer) Reset()
Reset tears down the Signer and obliterates any sensitive state if any.
func (*Signer) UnsafeBytes ¶
UnsafeBytes returns the byte representation of the private key. This MUST be removed for HSM support.