| 1 |
syntax = "proto3"; |
| 2 |
|
| 3 |
package keymanager; |
| 4 |
|
| 5 |
import "google/protobuf/duration.proto"; |
| 6 |
import "keymanager/km_common/proto/algorithms.proto"; |
| 7 |
|
| 8 |
option go_package = "github.com/google/go-tpm-tools/keymanager/km_common/proto;keymanager"; |
| 9 |
|
| 10 |
// Used to refer to key instances held by various daemons. |
| 11 |
message KeyHandle { |
| 12 |
string handle = 1; |
| 13 |
} |
| 14 |
|
| 15 |
enum KeyType { |
| 16 |
KEY_TYPE_UNSPECIFIED = 0; |
| 17 |
// A standard HPKE binding key-pair used for internal isolation. |
| 18 |
KEY_TYPE_VM_PROTECTION_BINDING = 1; |
| 19 |
// A KEM key-pair managed by the Key Protection Service. |
| 20 |
KEY_TYPE_VM_PROTECTION_KEY = 2; |
| 21 |
} |
| 22 |
|
| 23 |
// GetKeyClaimsRequest defines the input required to retrieve claims for a key. |
| 24 |
message GetKeyClaimsRequest { |
| 25 |
// The unique identifier (UUID) for the key. |
| 26 |
KeyHandle key_handle = 1; |
| 27 |
|
| 28 |
// The type of key (Binding or KEM) which determines the claim format. |
| 29 |
KeyType key_type = 2; |
| 30 |
} |
| 31 |
|
| 32 |
enum KeyProtectionMechanism { |
| 33 |
KEY_PROTECTION_MECHANISM_UNSPECIFIED = 0; |
| 34 |
|
| 35 |
// The key is held by the Workload Services Daemon, and is endorsed by a single CVM |
| 36 |
// attestation. |
| 37 |
DEFAULT = 1; |
| 38 |
|
| 39 |
// The key is held by the Key Protection Services VM, and is endorsed by a pair of CVM |
| 40 |
// attestations, from the Workload Services Daemon and Key Protection VM. |
| 41 |
KEY_PROTECTION_VM = 2; |
| 42 |
|
| 43 |
// An interim solution where the key is held by the Workload Services Daemon emulating |
| 44 |
// the Key Protection Service. It is endorsed by a single CVM attestation. |
| 45 |
KEY_PROTECTION_VM_EMULATED = 3; |
| 46 |
} |
| 47 |
|
| 48 |
message KemPublicKey { |
| 49 |
KemAlgorithm algorithm = 1; |
| 50 |
bytes public_key = 2; // `Npk` bytes long; see the KemAlgorithm definition. |
| 51 |
} |
| 52 |
|
| 53 |
message HpkePublicKey { |
| 54 |
HpkeAlgorithm algorithm = 1; |
| 55 |
bytes public_key = 2; // `Npk` bytes long. Raw bytes. |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
message KeyClaims { |
| 60 |
// The following two messages are used for keys whose protection mechanism is |
| 61 |
// KEY_PROTECTION_VM or KEY_PROTECTION_VM_EMULATED. |
| 62 |
|
| 63 |
message VmProtectionBindingClaims { |
| 64 |
// The workload attests that it controls the corresponding private key. |
| 65 |
HpkePublicKey binding_pub_key = 1; |
| 66 |
} |
| 67 |
|
| 68 |
message VmProtectionKeyClaims { |
| 69 |
// The Key Protection Service attests that it controls the KEM private key, and that |
| 70 |
// it will encrypt all resulting shared secrets to the binding key. |
| 71 |
KemPublicKey kem_pub_key = 1; |
| 72 |
HpkePublicKey binding_pub_key = 2; |
| 73 |
|
| 74 |
// The remaining time until the Key Protection Service will autonomously delete its |
| 75 |
// KEM keypair. |
| 76 |
google.protobuf.Duration remaining_lifespan = 3; |
| 77 |
} |
| 78 |
|
| 79 |
oneof claims { |
| 80 |
VmProtectionBindingClaims vm_binding_claims = 1; |
| 81 |
VmProtectionKeyClaims vm_key_claims = 2; |
| 82 |
} |
| 83 |
} |
| 84 |
|