mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-05-16 13:36:33 +00:00
parse dsse envelope
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
26
verifiers/internal/vsa/verifier.go
Normal file
26
verifiers/internal/vsa/verifier.go
Normal 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
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user