keylesshelper

package
v1.0.101-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package keylesshelper manages local application signing keys and referenced PEM files.

Index

Constants

View Source
const (
	FileSignerName = "file"
)

Variables

View Source
var ErrLifecycleNotSupported = errors.New("signing key lifecycle operation is unsupported")

Functions

func CleanupUnreferencedSigningKey

func CleanupUnreferencedSigningKey(ctx context.Context, kc keychain.KeychainAccess, previous core.AppConfig, current *core.MultiAppConfig) error

CleanupUnreferencedSigningKey removes a CLI-managed key after its configuration has been saved or removed. User-owned PEM files are retained.

func RegistrationSigners

func RegistrationSigners(kc keychain.KeychainAccess) []keysigner.Signer

RegistrationSigners orders new bindings from native L1/L2 backends to L3 software storage. Construction does not access keys or the credential store.

func ResolvePrivateKeyFilePath

func ResolvePrivateKeyFilePath(path string) (string, error)

ResolvePrivateKeyFilePath validates a local credential path and resolves it before persistence so changing the working directory cannot change the key.

func ResolveSigner

func ResolveSigner(name string, kc keychain.KeychainAccess) (keysigner.Signer, error)

ResolveSigner restores the exact built-in backend recorded in a profile.

func SignClientAssertionContext

func SignClientAssertionContext(ctx context.Context, signer keysigner.Signer, id, clientID, audience string, now time.Time) (assertion string, err error)

SignClientAssertionContext signs with the bound signer under the managed key store lock.

Types

type FileSigner

type FileSigner struct {
	// contains filtered or unexported fields
}

FileSigner reads a host-local credential referenced by keysigner.KeyRef.Label through vfs. It is independent of workspace FileIO and never copies the key.

func (*FileSigner) DeleteKey

func (s *FileSigner) DeleteKey(ctx context.Context, ref keysigner.KeyRef) error

func (*FileSigner) EnsureKey

func (s *FileSigner) EnsureKey(ctx context.Context, ref keysigner.KeyRef) (crypto.PublicKey, error)

func (*FileSigner) Name

func (*FileSigner) Name() string

func (*FileSigner) PublicKey

func (s *FileSigner) PublicKey(ctx context.Context, ref keysigner.KeyRef) (crypto.PublicKey, error)

func (*FileSigner) SecurityLevel

func (*FileSigner) SecurityLevel() keysigner.SecurityLevel

func (*FileSigner) Sign

func (s *FileSigner) Sign(ctx context.Context, ref keysigner.KeyRef, signingInput []byte) ([]byte, string, error)

func (*FileSigner) SignClientAssertion

func (s *FileSigner) SignClientAssertion(ctx context.Context, ref keysigner.KeyRef, clientID, audience string, now time.Time) (string, error)

SignClientAssertion reads the PEM once so a rotation cannot separate the public key used for kid from the private key used for the signature.

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key holds the selected provider and a snapshot of its public key.

func ProbeKeyContext

func ProbeKeyContext(ctx context.Context, signer keysigner.Signer, id string) (key *Key, err error)

ProbeKeyContext checks that the bound signer can sign with the existing key.

func (*Key) DeleteContext

func (k *Key) DeleteContext(ctx context.Context) error

func (*Key) ID

func (k *Key) ID() string

func (*Key) Provider

func (k *Key) Provider() string

func (*Key) Signer

func (k *Key) Signer() keysigner.Signer

func (*Key) Thumbprint

func (k *Key) Thumbprint() (string, error)

type KeyStore

type KeyStore struct {
	// contains filtered or unexported fields
}

KeyStore selects a signing backend for new private_key_jwt_local_keypair registrations.

func NewKeyStore

func NewKeyStore(signers ...keysigner.Signer) *KeyStore

NewKeyStore uses the supplied signing backends in order.

func (*KeyStore) CreateAttestationContext

func (s *KeyStore) CreateAttestationContext(ctx context.Context, id, nonce string, now time.Time) (key *Key, assertion string, err error)

CreateAttestationContext holds one lock across backend selection, key creation and signing. It returns the key on signing failure so the caller can clean up.

func (*KeyStore) ProbeWritableContext

func (s *KeyStore) ProbeWritableContext(ctx context.Context) error

Jump to

Keyboard shortcuts

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