Asylo
sgx_age_remote_credentials_options.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2020 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_GRPC_AUTH_SGX_AGE_REMOTE_CREDENTIALS_OPTIONS_H_
20 #define ASYLO_GRPC_AUTH_SGX_AGE_REMOTE_CREDENTIALS_OPTIONS_H_
21 
22 #include "asylo/grpc/auth/enclave_credentials_options.h"
23 
24 namespace asylo {
25 
26 /// Creates options suitable for configuring a credential used in establishing a
27 /// bidirectionally-authenticated gRPC channel between two SGX enclaves which
28 /// each use Asylo's Assertion Generator Enclave.
29 ///
30 /// A credential configured with these options enforces bidirectional
31 /// authentication using SGX enclave code identity.
32 ///
33 /// Sample usage for creating `::grpc::ChannelCredentials`:
34 ///
35 /// ```
36 /// std::shared_ptr<::grpc::ChannelCredentials> creds =
37 /// EnclaveChannelCredentials(BidirectionalSgxAgeRemoteCredentialsOptions());
38 /// ```
39 ///
40 /// Sample usage for creating `::grpc::ServerCredentials`:
41 ///
42 /// ```
43 /// std::shared_ptr<::grpc::ServerCredentials> creds =
44 /// EnclaveServerCredentials(BidirectionalSgxAgeRemoteCredentialsOptions());
45 /// ```
46 ///
47 /// \return Options used to configure gRPC credentials for a
48 /// bidirectionally-authenticated channel between SGX enclaves.
50 
51 /// Creates options suitable for configuring a credential used in establishing a
52 /// unidirectionally-authenticated gRPC channel.
53 ///
54 /// A credential configured with these options enforces that the credential
55 /// holder authenticates using SGX enclave code identity attested by Asylo's
56 /// Assertion Generator Enclave.
57 ///
58 /// Sample usage for creating `::grpc::ChannelCredentials`:
59 ///
60 /// ```
61 /// std::shared_ptr<::grpc::ChannelCredentials> creds =
62 /// EnclaveChannelCredentials(SelfSgxAgeRemoteCredentialsOptions());
63 /// ```
64 ///
65 /// Sample usage for creating `::grpc::ServerCredentials`:
66 ///
67 /// ```
68 /// std::shared_ptr<::grpc::ServerCredentials> creds =
69 /// EnclaveServerCredentials(SelfSgxAgeRemoteCredentialsOptions());
70 /// ```
71 ///
72 /// \return Options used to configure gRPC credentials for a channel that is
73 /// unidirectionally-authenticated on the credential holder's end using
74 /// SGX enclave code identity.
76 
77 } // namespace asylo
78 
79 #endif // ASYLO_GRPC_AUTH_SGX_AGE_REMOTE_CREDENTIALS_OPTIONS_H_
EnclaveCredentialsOptions SelfSgxAgeRemoteCredentialsOptions()
Creates options suitable for configuring a credential used in establishing a unidirectionally-authent...
ABSL_CONST_INIT const char kStatusMoveAssignmentMsg[]
EnclaveCredentialsOptions BidirectionalSgxAgeRemoteCredentialsOptions()
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenti...