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

Function keyWithNameFrom

acceptance/crypto/keys.go:86–95  ·  view source on GitHub ↗

keyWithNameFrom returns a specific key by name from the Context

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

84
85// keyWithNameFrom returns a specific key by name from the Context
86func keyWithNameFrom(ctx context.Context, name string) (*cosign.KeysBytes, error) {
87 keys := allKeysFrom(ctx)
88
89 key := keys[name]
90 if key != nil {
91 return key, nil
92 }
93
94 return nil, fmt.Errorf("can't find key named %s, did you create the key pair beforehand", name)
95}
96
97// SignerWithKey configures a SignerVerifier with the provided key by name
98func SignerWithKey(ctx context.Context, keyName string) (signature.SignerVerifier, error) {

Callers 1

SignerWithKeyFunction · 0.85

Calls 2

allKeysFromFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected