forked from veraison/swid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresource_extension.go
More file actions
40 lines (35 loc) · 1.38 KB
/
resource_extension.go
File metadata and controls
40 lines (35 loc) · 1.38 KB
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
39
40
// Copyright 2020 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package swid
var (
// ResourceTypePSAMeasuredSoftwareComponent is the resource type to use for
// a PSA measured software component
ResourceTypePSAMeasuredSoftwareComponent = "arm.com-PSAMeasuredSoftwareComponent"
)
// ResourceExtension is a placeholder for $$resource-extension
type ResourceExtension struct {
// PSA endorsements extensions
PSAMeasuredSoftwareComponent
}
// PSAMeasuredSoftwareComponent describes a PSA measured software component
// See Section 3.4.1 of draft-tschofenig-rats-psa-token-05
type PSAMeasuredSoftwareComponent struct {
MeasurementValue HashEntry `cbor:"arm.com-PSAMeasurementValue" json:"arm.com-PSAMeasurementValue" xml:"measurementValue,attr"`
SignerID HashEntry `cbor:"arm.com-PSASignerId" json:"arm.com-PSASignerId" xml:"signerId,attr"`
}
// NewPSAMeasuredSoftwareComponentResource returns a Resource of type
// PSAMeasuredSoftwareComponent initialized according to the supplied
// measurement value and signer ID
func NewPSAMeasuredSoftwareComponentResource(
measurementValue HashEntry, signerID HashEntry,
) (*Resource, error) {
return &Resource{
Type: ResourceTypePSAMeasuredSoftwareComponent,
ResourceExtension: ResourceExtension{
PSAMeasuredSoftwareComponent{
MeasurementValue: measurementValue,
SignerID: signerID,
},
},
}, nil
}