MCPcopy Create free account
hub / github.com/conforma/cli / PublicKeyFromKeyRef

Function PublicKeyFromKeyRef

internal/utils/key_resolver.go:55–57  ·  view source on GitHub ↗

PublicKeyFromKeyRef resolves a public key from either a file path or a Kubernetes secret reference. This provides a consistent interface with PrivateKeyFromKeyRef. Supported formats: - File path: "/path/to/public-key.pem" - Kubernetes secret: "k8s://namespace/secret-name/key-field" (explicit key fie

(ctx context.Context, keyRef string, fs afero.Fs)

Source from the content-addressed store, hash-verified

53// - Kubernetes secret: "k8s://namespace/secret-name/key-field" (explicit key field)
54// - Kubernetes secret: "k8s://namespace/secret-name" (auto-select if single key exists)
55func PublicKeyFromKeyRef(ctx context.Context, keyRef string, fs afero.Fs) ([]byte, error) {
56 return KeyFromKeyRef(ctx, keyRef, fs)
57}
58
59// keyFromFile reads a key from the filesystem
60func keyFromFile(keyPath string, fs afero.Fs) ([]byte, error) {

Callers 2

TestPublicKeyFromKeyRefFunction · 0.85

Calls 1

KeyFromKeyRefFunction · 0.85

Tested by 1

TestPublicKeyFromKeyRefFunction · 0.68