getPublicKeyOrCert returns the cert if we have it, otherwise return public key This mimics the same logic used in Tekton Chains
(signer signature.SignerVerifier)
| 1381 | // getPublicKeyOrCert returns the cert if we have it, otherwise return public key |
| 1382 | // This mimics the same logic used in Tekton Chains |
| 1383 | func getPublicKeyOrCert(signer signature.SignerVerifier) ([]byte, error) { |
| 1384 | // For now, we'll always use the public key since we're using test keys |
| 1385 | // In a real scenario with certificates, we'd check for cert first |
| 1386 | pub, err := signer.PublicKey() |
| 1387 | if err != nil { |
| 1388 | return nil, fmt.Errorf("getting public key: %w", err) |
| 1389 | } |
| 1390 | pem, err := cryptoutils.MarshalPublicKeyToPEM(pub) |
| 1391 | if err != nil { |
| 1392 | return nil, fmt.Errorf("key to pem: %w", err) |
| 1393 | } |
| 1394 | return pem, nil |
| 1395 | } |
| 1396 | |
| 1397 | func applyPatches(statement *in_toto.ProvenanceStatementSLSA02, patches *godog.Table) (*in_toto.ProvenanceStatementSLSA02, error) { |
| 1398 | if statement == nil || patches == nil || len(patches.Rows) == 0 { |
no test coverage detected