diff --git a/README.md b/README.md index b921e18..49e5d14 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,9 @@ library to create, verify, and evaluate policy for attestations on container ima 1. sign attestations ```go - signedImageIndex, err := attest.SignIndexAttestations(ctx, att, signer, opts) + signedImageIndex, err := attest.Sign(ctx, att, signer, opts) ``` - `attest.SignedIndexAttestations()` iterates over all attestation manifests in the image index and signs all intoto statements (optionally generates a VSA), returning a mutated ImageIndex with all intoto statements signed as attestations. + `attest.Sign()` iterates over attestation manifests in the image index and signs all intoto statements (optionally generates a VSA), returning a mutated ImageIndex with all intoto statements signed as attestations. 1. save output (optional) * push to oci registry diff --git a/pkg/attest/sign.go b/pkg/attest/sign.go index a554e6e..dd63183 100644 --- a/pkg/attest/sign.go +++ b/pkg/attest/sign.go @@ -17,7 +17,7 @@ import ( "github.com/secure-systems-lab/go-securesystemslib/dsse" ) -func SignIndexAttestations(ctx context.Context, idx v1.ImageIndex, signer dsse.SignerVerifier, opts *SigningOptions) (v1.ImageIndex, error) { +func Sign(ctx context.Context, idx v1.ImageIndex, signer dsse.SignerVerifier, opts *SigningOptions) (v1.ImageIndex, error) { // extract attestation manifests from index attestationManifests, err := attestation.GetAttestationManifestsFromIndex(idx) if err != nil { diff --git a/pkg/attest/sign_test.go b/pkg/attest/sign_test.go index bff0f57..f2f6787 100644 --- a/pkg/attest/sign_test.go +++ b/pkg/attest/sign_test.go @@ -61,7 +61,7 @@ func TestSignVerifyOCILayout(t *testing.T) { } attIdx, err := oci.AttestationIndexFromPath(tc.TestImage) assert.NoError(t, err) - signedIndex, err := SignIndexAttestations(ctx, attIdx.Index, signer, opts) + signedIndex, err := Sign(ctx, attIdx.Index, signer, opts) assert.NoError(t, err) // output signed attestations