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

Function SignerWithKey

acceptance/crypto/keys.go:98–105  ·  view source on GitHub ↗

SignerWithKey configures a SignerVerifier with the provided key by name

(ctx context.Context, keyName string)

Source from the content-addressed store, hash-verified

96
97// SignerWithKey configures a SignerVerifier with the provided key by name
98func SignerWithKey(ctx context.Context, keyName string) (signature.SignerVerifier, error) {
99 key, err := keyWithNameFrom(ctx, keyName)
100 if err != nil {
101 return nil, err
102 }
103
104 return cosign.LoadPrivateKey(key.PrivateBytes, key.Password(), nil)
105}
106
107// PublicKeysFrom returns a map of all public keys encoded in PEM format
108// keyed by the name of the key

Calls 1

keyWithNameFromFunction · 0.85

Tested by

no test coverage detected