parse dsse envelope

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
Ramon Petgrave
2024-06-17 16:07:41 +00:00
parent a3a573a800
commit 9704c97a22
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
package vsa
import (
"context"
"fmt"
"github.com/slsa-framework/slsa-verifier/v2/options"
"github.com/slsa-framework/slsa-verifier/v2/verifiers/utils"
)
// VerifyVSA verifies the VSA attestations.
func VerifyVSA(ctx context.Context,
attestations []byte,
vsaOpts *options.VSAOpts,
) ([]byte, *utils.TrustedAttesterID, error) {
// parse the envelope
envelope, err := utils.EnvelopeFromBytes(attestations)
if err != nil {
return nil, nil, err
}
fmt.Println(envelope)
// verify the envelope. signature
// verify the metadata
// print the attestation
return nil, nil, nil
}

View File

@@ -9,6 +9,7 @@ import (
"github.com/slsa-framework/slsa-verifier/v2/register"
_ "github.com/slsa-framework/slsa-verifier/v2/verifiers/internal/gcb"
"github.com/slsa-framework/slsa-verifier/v2/verifiers/internal/gha"
"github.com/slsa-framework/slsa-verifier/v2/verifiers/internal/vsa"
"github.com/slsa-framework/slsa-verifier/v2/verifiers/utils"
)
@@ -80,6 +81,5 @@ func VerifyVSA(ctx context.Context,
attestations []byte,
vsaOpts *options.VSAOpts,
) ([]byte, *utils.TrustedAttesterID, error) {
// TODO: Implement this function.
return nil, nil, nil
return vsa.VerifyVSA(ctx, attestations, vsaOpts)
}