SignerWithKey configures a SignerVerifier with the provided key by name
(ctx context.Context, keyName string)
| 96 | |
| 97 | // SignerWithKey configures a SignerVerifier with the provided key by name |
| 98 | func 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 |
no test coverage detected