-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathistorehandler.go
38 lines (32 loc) · 1.46 KB
/
istorehandler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2024 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package handler
import (
"github.com/veraison/services/plugin"
"github.com/veraison/services/proto"
)
// IStoreHandler defines the interfaces for creating and obtaining keys
// to access objects in the Veraison storage layer.
// This includes obtaining Trust Anchor IDs from evidence and synthesizing
// Reference Value and TrustAnchor keys from endorsements
type IStoreHandler interface {
plugin.IPluggable
// GetTrustAnchorIDs returns a slice of trust anchor identifiers used
// to retrieve the trust anchors associated with this token. The trust anchors may be necessary to validate the
// entire token and/or extract its claims (if it is encrypted).
GetTrustAnchorIDs(token *proto.AttestationToken) ([]string, error)
// GetRefValueIDs returns a slice of identifiers used to retrieve
// reference values for an attestation scheme, using the claims
// extracted from attestation token and the associated trust anchors.
GetRefValueIDs(
tenantID string,
trustAnchors []string,
claims map[string]interface{},
) ([]string, error)
// SynthKeysFromRefValue synthesizes lookup key(s) for the
// provided reference value endorsement.
SynthKeysFromRefValue(tenantID string, refVal *Endorsement) ([]string, error)
// SynthKeysFromTrustAnchor synthesizes lookup key(s) for the provided
// trust anchor.
SynthKeysFromTrustAnchor(tenantID string, ta *Endorsement) ([]string, error)
}