Skip to content

Commit 623dcc2

Browse files
authored
Merge pull request #3 from alopez-suse/NVSHAS-6217
NVSHAS-6217: add sct public key behavior
2 parents 7ad5e68 + 1c78859 commit 623dcc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ func setRootOfTrustCosignOptions(cosignOptions *cosign.CheckOpts, rootOfTrust Ro
197197
}
198198
// sct pub keys
199199
if rootOfTrust.SCTPublicKey != "" {
200-
return errors.New("providing an SCTPublicKey in the root of trust configuration has not yet been implemented")
200+
sctPubKeyCollection := cosign.NewTrustedTransparencyLogPubKeys()
201+
if err := sctPubKeyCollection.AddTransparencyLogPubKey([]byte(rootOfTrust.SCTPublicKey), tuf.Active); err != nil {
202+
return fmt.Errorf("could not add custom sct public key to collection: %w", err)
203+
}
204+
cosignOptions.CTLogPubKeys = &sctPubKeyCollection
201205
} else {
202206
cosignOptions.CTLogPubKeys, err = cosign.GetCTLogPubs(ctx)
203207
if err != nil {

0 commit comments

Comments
 (0)