signing

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDependencyMissing = errors.New("dependency missing")

Functions

func IsDependencyMissing

func IsDependencyMissing(err error) bool

func IsRevoked

func IsRevoked(in RevocationList, keyID string, at time.Time) bool

func KeyID

func KeyID(pub ed25519.PublicKey) string

func NormalizeKeyID

func NormalizeKeyID(id string, pub ed25519.PublicKey) string

func Sign

func Sign(r *record.Record, key SigningKey) (*record.Record, error)

func SignRecordCosign

func SignRecordCosign(r *record.Record, keyPath string) (*record.Record, error)

func Verify

func Verify(r *record.Record, pub PublicKey) error

func VerifyDigest

func VerifyDigest(sig Signature, digest string, pub PublicKey) error

func VerifyDigestCosign

func VerifyDigestCosign(sig Signature, digest string, opts CosignVerifyOpts) error

func VerifyRecordCosign

func VerifyRecordCosign(r *record.Record, opts CosignVerifyOpts) error

func VerifyRevocationList

func VerifyRevocationList(in RevocationList, pub PublicKey) error

Types

type CosignVerifyOpts

type CosignVerifyOpts struct {
	KeyPath             string
	CertificatePath     string
	CertificateIdentity string
	CertificateIssuer   string
}

type PublicKey

type PublicKey struct {
	Public ed25519.PublicKey
	KeyID  string
}

type RevocationEntry

type RevocationEntry struct {
	KeyID     string `json:"key_id"`
	RevokedAt string `json:"revoked_at"`
	Reason    string `json:"reason,omitempty"`
}

type RevocationList

type RevocationList struct {
	Version   string            `json:"version"`
	CreatedAt string            `json:"created_at"`
	Revoked   []RevocationEntry `json:"revoked"`
	Signature Signature         `json:"signature"`
}

func SignRevocationList

func SignRevocationList(in RevocationList, key SigningKey) (RevocationList, error)

type Signature

type Signature struct {
	Alg          string `json:"alg"`
	KeyID        string `json:"key_id"`
	Sig          string `json:"sig"`
	SignedDigest string `json:"signed_digest"`
}

func SignDigest

func SignDigest(digest string, key SigningKey) (Signature, error)

func SignDigestCosign

func SignDigestCosign(digest string, keyPath string) (Signature, error)

type SigningKey

type SigningKey struct {
	Private ed25519.PrivateKey
	Public  ed25519.PublicKey
	KeyID   string
}

func GenerateKey

func GenerateKey() (SigningKey, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL