Documentation
¶
Overview ¶
Package identity manages the endpoint signing identity and signed envelopes.
Index ¶
- func Verify(publicKeyText string, value any, signatureText string) error
- func VerifyCheckpoint(checkpoint Checkpoint) error
- func VerifyRotation(rotation Rotation, identityName, pinnedPublicKey string) error
- type Checkpoint
- type Revocation
- type RevocationPlan
- type Rotation
- type RotationPlan
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyCheckpoint ¶
func VerifyCheckpoint(checkpoint Checkpoint) error
VerifyCheckpoint verifies the self-contained signature. Trust in PublicKey still requires an independently pinned key or earlier trusted checkpoint.
func VerifyRotation ¶
VerifyRotation verifies both signatures and the expected currently pinned identity. A transition for any other key or peer fails closed.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
Version int `json:"version"`
Identity string `json:"identity"`
PublicKey string `json:"public_key"`
Sequence uint64 `json:"sequence"`
AuditHead string `json:"audit_head"`
DeploymentSHA256 string `json:"deployment_sha256"`
CreatedAt string `json:"created_at"`
Signature string `json:"signature"`
}
Checkpoint is an independently storable signed audit head.
type Revocation ¶
type Revocation struct {
Identity string `json:"identity"`
PublicKey string `json:"public_key"`
CreatedAt string `json:"created_at"`
Signature string `json:"signature"`
}
Revocation proves that the local identity intentionally destroyed its private key. Peers must remove the pinned key separately.
type RevocationPlan ¶
type RevocationPlan struct {
// contains filtered or unexported fields
}
RevocationPlan holds a signed final certificate until the caller has durably recorded it.
func PrepareRevocation ¶
func PrepareRevocation(auditDir, name string, now time.Time) (*RevocationPlan, error)
PrepareRevocation signs a certificate without deleting the private key.
func (*RevocationPlan) Certificate ¶
func (p *RevocationPlan) Certificate() Revocation
Certificate returns the signed public revocation evidence.
func (*RevocationPlan) Commit ¶
func (p *RevocationPlan) Commit() error
Commit deletes the key only if it still matches the prepared certificate.
type Rotation ¶
type Rotation struct {
Identity string `json:"identity"`
PreviousPublicKey string `json:"previous_public_key"`
NewPublicKey string `json:"new_public_key"`
CreatedAt string `json:"created_at"`
PreviousSignature string `json:"previous_signature"`
NewSignature string `json:"new_signature"`
}
Rotation proves continuity from the currently pinned key to a new key. Both keys sign the transition before the old private key is atomically replaced.
type RotationPlan ¶
type RotationPlan struct {
// contains filtered or unexported fields
}
RotationPlan holds a signed transition until its caller has durably recorded the certificate. Commit then atomically replaces the old private key.
func PrepareRotation ¶
func PrepareRotation(auditDir, name string, now time.Time) (*RotationPlan, error)
PrepareRotation creates a transition without mutating the current identity.
func (*RotationPlan) Certificate ¶
func (p *RotationPlan) Certificate() Rotation
Certificate returns the dual-signed public transition.
func (*RotationPlan) Commit ¶
func (p *RotationPlan) Commit() error
Commit replaces the key only if the current identity still matches the certificate's previous key.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer owns one endpoint's private signing key.
func LoadOrCreate ¶
LoadOrCreate loads the identity key in auditDir, creating it when requested.
func (*Signer) Checkpoint ¶
func (s *Signer) Checkpoint(sequence uint64, head, deploymentSHA256 string, now time.Time) (Checkpoint, error)
Checkpoint signs a current audit head for independent anchoring.