Documentation ¶
Index ¶
- Variables
- func DecryptSeedShare(key *rsa.PrivateKey, seedShare *userapi.SeedShare) ([]byte, error)
- func EncryptSeedShares(seed []byte, ownerPubKeys []HexString) ([]*userapi.SeedShare, error)
- func ExtractWorkloadOwnerPublicKey(keyData []byte) ([]byte, error)
- func NewSeedShareOwnerPrivateKey() ([]byte, error)
- func NewWorkloadOwnerKey() ([]byte, error)
- func ParseSeedShareOwnerKey(pubKeyHex HexString) (*rsa.PublicKey, error)
- func ParseSeedshareOwnerPrivateKey(keyData []byte) (*rsa.PrivateKey, error)
- func ParseWorkloadOwnerPrivateKey(keyBytes []byte) (*ecdsa.PrivateKey, error)
- func RuntimeHandler(platform platforms.Platform) (string, error)
- type AKSReferenceValues
- type BareMetalTDXReferenceValues
- type EmbeddedReferenceValues
- type HexString
- type HexStrings
- type Manifest
- type Policy
- type PolicyEntry
- type ReferenceValues
- type SNPReferenceValues
- type SNPTCB
- type SVN
Constants ¶
This section is empty.
Variables ¶
var EmbeddedReferenceValuesJSON []byte
EmbeddedReferenceValuesJSON contains the embedded reference values in JSON format.
Functions ¶
func DecryptSeedShare ¶ added in v0.8.0
DecryptSeedShare tries to decrypt a SeedShare with the given owner key.
func EncryptSeedShares ¶ added in v0.8.0
EncryptSeedShares encrypts a seed for owners identified by their public keys and returns a SeedShare slice suitable for userapi.SetManifestResponse.
func ExtractWorkloadOwnerPublicKey ¶ added in v0.8.0
ExtractWorkloadOwnerPublicKey extracts the public key for a workload owner and returns it as serialized DER.
This function supports PEM-encoded public and private keys.
func NewSeedShareOwnerPrivateKey ¶ added in v0.8.0
NewSeedShareOwnerPrivateKey creates and PEM-encodes a new seed share private key.
func NewWorkloadOwnerKey ¶ added in v0.8.0
NewWorkloadOwnerKey creates and marshals a private key.
func ParseSeedShareOwnerKey ¶ added in v0.8.0
ParseSeedShareOwnerKey reads a public key embedded in a userapi.SetManifestRequest.
func ParseSeedshareOwnerPrivateKey ¶ added in v0.8.0
func ParseSeedshareOwnerPrivateKey(keyData []byte) (*rsa.PrivateKey, error)
ParseSeedshareOwnerPrivateKey decodes a PEM-encoded seed share private key.
func ParseWorkloadOwnerPrivateKey ¶ added in v0.8.0
func ParseWorkloadOwnerPrivateKey(keyBytes []byte) (*ecdsa.PrivateKey, error)
ParseWorkloadOwnerPrivateKey parses a PEM-encoded private key.
Types ¶
type AKSReferenceValues ¶ added in v0.9.0
type AKSReferenceValues struct { SNP SNPReferenceValues TrustedMeasurement HexString }
AKSReferenceValues contains reference values for AKS.
func (AKSReferenceValues) Validate ¶ added in v0.9.0
func (r AKSReferenceValues) Validate() error
Validate checks the validity of all fields in the AKS reference values.
type BareMetalTDXReferenceValues ¶ added in v0.9.0
type BareMetalTDXReferenceValues struct {
TrustedMeasurement HexString
}
BareMetalTDXReferenceValues contains reference values for BareMetalTDX.
func (BareMetalTDXReferenceValues) Validate ¶ added in v0.9.0
func (r BareMetalTDXReferenceValues) Validate() error
Validate checks the validity of all fields in the bare metal TDX reference values.
type EmbeddedReferenceValues ¶ added in v0.9.0
type EmbeddedReferenceValues map[string]ReferenceValues
EmbeddedReferenceValues is a map of runtime handler names to reference values, as embedded in the binary.
func GetEmbeddedReferenceValues ¶ added in v0.9.0
func GetEmbeddedReferenceValues() EmbeddedReferenceValues
GetEmbeddedReferenceValues returns the reference values embedded in the binary.
func (*EmbeddedReferenceValues) ForPlatform ¶ added in v0.9.0
func (e *EmbeddedReferenceValues) ForPlatform(platform platforms.Platform) (*ReferenceValues, error)
ForPlatform returns the reference values for the given platform.
type HexString ¶
type HexString string
HexString is a hex encoded string.
func ExtractSeedshareOwnerPublicKey ¶ added in v0.8.0
ExtractSeedshareOwnerPublicKey extracts the public key for a seedshare owner and returns it as serialized DER.
This function supports PEM-encoded public and private keys.
func HashWorkloadOwnerKey ¶ added in v0.8.0
HashWorkloadOwnerKey converts a public key into the format for Manifest.WorkloadOwnerKeyDigests.
func MarshalSeedShareOwnerKey ¶ added in v0.8.0
MarshalSeedShareOwnerKey converts a public key into the format for userapi.SetManifestRequest.
func NewHexString ¶
NewHexString creates a new HexString from a byte slice.
type HexStrings ¶
type HexStrings []HexString
HexStrings is a slice of HexString.
func (*HexStrings) ByteSlices ¶
func (l *HexStrings) ByteSlices() ([][]byte, error)
ByteSlices returns the byte slice representation of the HexStrings.
type Manifest ¶
type Manifest struct { // policyHash/HOSTDATA -> commonName Policies map[HexString]PolicyEntry ReferenceValues ReferenceValues WorkloadOwnerKeyDigests []HexString }
Manifest is the Coordinator manifest and contains the reference values of the deployment.
func (*Manifest) AKSValidateOpts ¶ added in v0.9.0
AKSValidateOpts returns validate options populated with the manifest's AKS reference values and trusted measurement.
type Policy ¶
type Policy []byte
Policy is a CocCo execution policy.
func NewPolicyFromAnnotation ¶
NewPolicyFromAnnotation parses a base64 encoded policy from an annotation.
type PolicyEntry ¶ added in v0.9.0
PolicyEntry is a policy entry in the manifest. It contains further information the user wants to associate with the policy.
type ReferenceValues ¶
type ReferenceValues struct { // AKS holds the reference values for AKS. AKS *AKSReferenceValues `json:"aks,omitempty"` // BareMetalTDX holds the reference values for TDX on bare metal. BareMetalTDX *BareMetalTDXReferenceValues `json:"bareMetalTDX,omitempty"` }
ReferenceValues contains the workload-independent reference values for each platform.
func (ReferenceValues) Validate ¶ added in v0.8.0
func (r ReferenceValues) Validate() error
Validate checks the validity of all fields in the reference values.
type SNPReferenceValues ¶
type SNPReferenceValues struct {
MinimumTCB SNPTCB
}
SNPReferenceValues contains reference values for the SNP report.
type SVN ¶
type SVN uint8
SVN is a SNP secure version number.
func (SVN) MarshalJSON ¶
MarshalJSON marshals the SVN to JSON.
func (*SVN) UnmarshalJSON ¶
UnmarshalJSON unmarshals the SVN from a JSON.