diff --git a/pkg/attestation/attestation.go b/pkg/attestation/attestation.go index 306cf1b..c7050dc 100644 --- a/pkg/attestation/attestation.go +++ b/pkg/attestation/attestation.go @@ -1,6 +1,7 @@ package attestation import ( + "bytes" "context" "encoding/json" "fmt" @@ -329,3 +330,12 @@ func (i *EmptyConfigImage) RawManifest() ([]byte, error) { } return json.Marshal(mf) } + +func (i *EmptyConfigImage) Digest() (v1.Hash, error) { + mb, err := i.RawManifest() + if err != nil { + return v1.Hash{}, err + } + digest, _, err := v1.SHA256(bytes.NewReader(mb)) + return digest, err +}