Documentation
¶
Overview ¶
Package local implements chainbind.Signer in-process with crypto/ed25519, so a library user can sign a package without a Vault deployment (TECHSPEC-001 §6.6 decision 3). It never reads a key from disk or the environment; the caller supplies one. The Vault Transit adapter is a separate, deployed implementation of the same port (TASK-001-11), not a variant of this one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrKeySize = errors.New("chainbind/signer/local: invalid private key size")
ErrKeySize is returned by New when the supplied private key is not a valid Ed25519 private key length. The message names only the expected and actual byte counts, never key material.
Functions ¶
func Verify ¶
Verify reports whether sig is a valid Ed25519 signature over message under pub. It is a plain function, not a Signer method: verification needs only a public key, never the signer or its private key (TECHSPEC-001 §6.4 — "verification ... does not require this port").
The length guards are not defensive noise. crypto/ed25519.Verify panics on a public key of the wrong size, and this function sits on the verification path, where every input is attacker-controlled by definition: the issuer key is resolved from issuer.iss and issuer.kid carried inside the very package being verified. A panic there is a denial of service on the one operation that exists to process hostile artifacts. A malformed key is not a valid signature, so it returns false.
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer signs messages with an in-process Ed25519 private key. It implements chainbind.Signer.
func New ¶
func New(priv ed25519.PrivateKey, kid string) (*Signer, error)
New returns a Signer over priv, identified to callers as kid (echoed back from Sign so the caller can stamp it into signature.kid). priv must be ed25519.PrivateKeySize bytes.
func (*Signer) Kid ¶
Kid returns the configured key identifier. It never signs anything: a caller that needs the kid before it can build the bytes to be signed — which Seal does, since issuer.kid is inside the signing view — must be able to ask.