Asylo
descriptions.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 Asylo authors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef ASYLO_IDENTITY_DESCRIPTIONS_H_
20 #define ASYLO_IDENTITY_DESCRIPTIONS_H_
21 
22 #include "asylo/identity/attestation/null/internal/null_identity_constants.h"
23 #include "asylo/identity/identity.pb.h"
24 #include "asylo/identity/platform/sgx/internal/code_identity_constants.h"
25 
26 namespace asylo {
27 
28 /// Sets `assertion_description` to describe a null assertion.
29 ///
30 /// \param assertion_description The `AssertionDescription` to populate.
32  AssertionDescription *assertion_description) {
33  assertion_description->set_identity_type(EnclaveIdentityType::NULL_IDENTITY);
34  assertion_description->set_authority_type(kNullAssertionAuthority);
35 }
36 
37 /// Sets `identity_description` to describe a null identity.
38 ///
39 /// \param identity_description The `EnclaveIdentityDescription` to populate.
41  EnclaveIdentityDescription *identity_description) {
42  identity_description->set_identity_type(EnclaveIdentityType::NULL_IDENTITY);
43  identity_description->set_authority_type(kNullAuthorizationAuthority);
44 }
45 
46 /// Sets `assertion_description` to describe an SGX local assertion.
47 ///
48 /// \param assertion_description The `AssertionDescription` to populate.
50  AssertionDescription *assertion_description) {
51  assertion_description->set_identity_type(EnclaveIdentityType::CODE_IDENTITY);
52  assertion_description->set_authority_type(sgx::kSgxLocalAssertionAuthority);
53 }
54 
55 /// Sets `assertion_description` to describe an SGX remote assertion generated
56 /// by the Assertion Generator Enclave (AGE).
57 ///
58 /// \param assertion_description The `AssertionDescription` to populate.
60  AssertionDescription *assertion_description) {
61  assertion_description->set_identity_type(EnclaveIdentityType::CODE_IDENTITY);
62  assertion_description->set_authority_type(
63  sgx::kSgxAgeRemoteAssertionAuthority);
64 }
65 
66 /// Sets `assertion_description` to describe an SGX remote assertion generated
67 /// by the Intel ECDSA Quoting Enclave (QE).
68 ///
69 /// \param assertion_description The `AssertionDescription` to populate.
71  AssertionDescription *assertion_description) {
72  assertion_description->set_identity_type(EnclaveIdentityType::CODE_IDENTITY);
73  assertion_description->set_authority_type(
74  sgx::kSgxIntelEcdsaQeRemoteAssertionAuthority);
75 }
76 
77 /// Sets `identity_description` to describe an SGX identity.
78 ///
79 /// \param identity_description The `EnclaveIdentityDescription` to populate.
81  EnclaveIdentityDescription *identity_description) {
82  identity_description->set_identity_type(EnclaveIdentityType::CODE_IDENTITY);
83  identity_description->set_authority_type(sgx::kSgxAuthorizationAuthority);
84 }
85 
86 } // namespace asylo
87 
88 #endif // ASYLO_IDENTITY_DESCRIPTIONS_H_
void SetSgxLocalAssertionDescription(AssertionDescription *assertion_description)
Sets assertion_description to describe an SGX local assertion.
Definition: descriptions.h:49
void SetSgxAgeRemoteAssertionDescription(AssertionDescription *assertion_description)
Sets assertion_description to describe an SGX remote assertion generated by the Assertion Generator E...
Definition: descriptions.h:59
void SetSgxIdentityDescription(EnclaveIdentityDescription *identity_description)
Sets identity_description to describe an SGX identity.
Definition: descriptions.h:80
void SetNullIdentityDescription(EnclaveIdentityDescription *identity_description)
Sets identity_description to describe a null identity.
Definition: descriptions.h:40
ABSL_CONST_INIT const char kStatusMoveAssignmentMsg[]
void SetNullAssertionDescription(AssertionDescription *assertion_description)
Sets assertion_description to describe a null assertion.
Definition: descriptions.h:31
void SetSgxIntelEcdsaQeRemoteAssertionDescription(AssertionDescription *assertion_description)
Sets assertion_description to describe an SGX remote assertion generated by the Intel ECDSA Quoting E...
Definition: descriptions.h:70