Documentation
¶
Overview ¶
Package keylesshelper manages local application signing keys and referenced PEM files.
Index ¶
- Constants
- Variables
- func CleanupUnreferencedSigningKey(ctx context.Context, kc keychain.KeychainAccess, previous core.AppConfig, ...) error
- func RegistrationSigners(kc keychain.KeychainAccess) []keysigner.Signer
- func ResolvePrivateKeyFilePath(path string) (string, error)
- func ResolveSigner(name string, kc keychain.KeychainAccess) (keysigner.Signer, error)
- func SignClientAssertionContext(ctx context.Context, signer keysigner.Signer, id, clientID, audience string, ...) (assertion string, err error)
- type FileSigner
- func (s *FileSigner) DeleteKey(ctx context.Context, ref keysigner.KeyRef) error
- func (s *FileSigner) EnsureKey(ctx context.Context, ref keysigner.KeyRef) (crypto.PublicKey, error)
- func (*FileSigner) Name() string
- func (s *FileSigner) PublicKey(ctx context.Context, ref keysigner.KeyRef) (crypto.PublicKey, error)
- func (*FileSigner) SecurityLevel() keysigner.SecurityLevel
- func (s *FileSigner) Sign(ctx context.Context, ref keysigner.KeyRef, signingInput []byte) ([]byte, string, error)
- func (s *FileSigner) SignClientAssertion(ctx context.Context, ref keysigner.KeyRef, clientID, audience string, ...) (string, error)
- type Key
- type KeyStore
Constants ¶
const (
FileSignerName = "file"
)
Variables ¶
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 ¶
ResolvePrivateKeyFilePath validates a local credential path and resolves it before persistence so changing the working directory cannot change the key.
func ResolveSigner ¶
ResolveSigner restores the exact built-in backend recorded in a profile.
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) Name ¶
func (*FileSigner) Name() string
func (*FileSigner) SecurityLevel ¶
func (*FileSigner) SecurityLevel() keysigner.SecurityLevel
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 ¶
ProbeKeyContext checks that the bound signer can sign with the existing key.
func (*Key) Thumbprint ¶
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 ¶
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.