2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
2023-01-19 09:57:50 -05:00
|
|
|
*/
|
2022-09-05 03:06:08 -04:00
|
|
|
|
2023-01-19 09:57:50 -05:00
|
|
|
/*
|
2022-08-31 14:10:49 -04:00
|
|
|
Package oid defines OIDs for different CSPs. Currently this is used in attested TLS to distinguish the attestation documents.
|
|
|
|
OIDs beginning with 1.3.9900 are reserved and can be used without registration.
|
|
|
|
|
|
|
|
* The 1.3.9900.1 branch is reserved for placeholder values and testing.
|
|
|
|
|
|
|
|
* The 1.3.9900.2 branch is reserved for AWS.
|
|
|
|
|
|
|
|
* The 1.3.9900.3 branch is reserved for GCP.
|
|
|
|
|
|
|
|
* The 1.3.9900.4 branch is reserved for Azure.
|
|
|
|
|
|
|
|
* The 1.3.9900.5 branch is reserved for QEMU.
|
|
|
|
|
|
|
|
Deprecated OIDs should never be reused for different purposes.
|
|
|
|
Instead, new OIDs should be added in the appropriate branch at the next available index.
|
|
|
|
*/
|
2022-03-22 11:03:15 -04:00
|
|
|
package oid
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/asn1"
|
|
|
|
)
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// Getter returns an ASN.1 Object Identifier.
|
2022-03-22 11:03:15 -04:00
|
|
|
type Getter interface {
|
|
|
|
OID() asn1.ObjectIdentifier
|
|
|
|
}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// Dummy OID for testing.
|
2022-03-22 11:03:15 -04:00
|
|
|
type Dummy struct{}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// OID returns the struct's object identifier.
|
2022-03-22 11:03:15 -04:00
|
|
|
func (Dummy) OID() asn1.ObjectIdentifier {
|
2022-08-31 14:10:49 -04:00
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 1, 1}
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// AWS holds the AWS OID.
|
2022-03-22 11:03:15 -04:00
|
|
|
type AWS struct{}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// OID returns the struct's object identifier.
|
2022-03-22 11:03:15 -04:00
|
|
|
func (AWS) OID() asn1.ObjectIdentifier {
|
2022-08-31 14:10:49 -04:00
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 2, 1}
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// GCP holds the GCP OID.
|
2022-03-22 11:03:15 -04:00
|
|
|
type GCP struct{}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// OID returns the struct's object identifier.
|
2022-03-22 11:03:15 -04:00
|
|
|
func (GCP) OID() asn1.ObjectIdentifier {
|
2022-08-31 14:10:49 -04:00
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 3, 1}
|
|
|
|
}
|
|
|
|
|
|
|
|
// AzureSNP holds the OID for Azure SNP CVMs.
|
|
|
|
type AzureSNP struct{}
|
|
|
|
|
|
|
|
// OID returns the struct's object identifier.
|
|
|
|
func (AzureSNP) OID() asn1.ObjectIdentifier {
|
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 4, 1}
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-11-09 09:57:54 -05:00
|
|
|
// AzureTrustedLaunch holds the OID for Azure TrustedLaunch VMs.
|
2022-08-31 14:10:49 -04:00
|
|
|
type AzureTrustedLaunch struct{}
|
2022-03-22 11:03:15 -04:00
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// OID returns the struct's object identifier.
|
2022-08-31 14:10:49 -04:00
|
|
|
func (AzureTrustedLaunch) OID() asn1.ObjectIdentifier {
|
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 4, 2}
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// QEMU holds the QEMU OID.
|
2022-04-21 10:27:34 -04:00
|
|
|
type QEMU struct{}
|
|
|
|
|
2022-04-28 08:31:01 -04:00
|
|
|
// OID returns the struct's object identifier.
|
2022-04-21 10:27:34 -04:00
|
|
|
func (QEMU) OID() asn1.ObjectIdentifier {
|
2022-08-31 14:10:49 -04:00
|
|
|
return asn1.ObjectIdentifier{1, 3, 9900, 5, 1}
|
2022-04-21 10:27:34 -04:00
|
|
|
}
|