Asylo
sgx_local_credentials_options.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 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_LOCAL_CREDENTIALS_OPTIONS_H_
20 #define ASYLO_GRPC_AUTH_SGX_LOCAL_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 local SGX enclaves.
28 ///
29 /// A credential configured with these options enforces bidirectional
30 /// authentication using SGX enclave code identity.
31 ///
32 /// Sample usage for creating `::grpc::ChannelCredentials`:
33 ///
34 /// ```
35 /// std::shared_ptr<::grpc::ChannelCredentials> creds =
36 /// EnclaveChannelCredentials(BidirectionalSgxLocalCredentialsOptions());
37 /// ```
38 ///
39 /// Sample usage for creating `::grpc::ServerCredentials`:
40 ///
41 /// ```
42 /// std::shared_ptr<::grpc::ServerCredentials> creds =
43 /// EnclaveServerCredentials(BidirectionalSgxLocalCredentialsOptions());
44 /// ```
45 ///
46 /// \return Options used to configure gRPC credentials for a
47 /// bidirectionally-authenticated channel between SGX enclaves on the
48 /// same platform.
50 
51 /// Creates options suitable for configuring a credential used in establishing a
52 /// unidirectionally-authenticated gRPC channel between two local SGX enclaves.
53 ///
54 /// A credential configured with these options enforces that the peer
55 /// authenticates using SGX enclave code identity.
56 ///
57 /// Sample usage for creating `::grpc::ChannelCredentials`:
58 ///
59 /// ```
60 /// std::shared_ptr<::grpc::ChannelCredentials> creds =
61 /// EnclaveChannelCredentials(PeerSgxLocalCredentialsOptions());
62 /// ```
63 ///
64 /// Sample usage for creating `::grpc::ServerCredentials`:
65 ///
66 /// ```
67 /// std::shared_ptr<::grpc::ServerCredentials> creds =
68 /// EnclaveServerCredentials(PeerSgxLocalCredentialsOptions());
69 /// ```
70 ///
71 /// \return Options used to configure gRPC credentials for a channel that is
72 /// unidirectionally-authenticated on the peer's end using
73 /// SGX enclave code identity.
75 
76 /// Creates options suitable for configuring a credential used in establishing a
77 /// unidirectionally-authenticated gRPC channel between two local SGX enclaves.
78 ///
79 /// A credential configured with these options enforces that the credential
80 /// holder authenticates using SGX enclave code identity.
81 ///
82 /// Sample usage for creating `::grpc::ChannelCredentials`:
83 ///
84 /// ```
85 /// std::shared_ptr<::grpc::ChannelCredentials> creds =
86 /// EnclaveChannelCredentials(SelfSgxLocalCredentialsOptions());
87 /// ```
88 ///
89 /// Sample usage for creating `::grpc::ServerCredentials`:
90 ///
91 /// ```
92 /// std::shared_ptr<::grpc::ServerCredentials> creds =
93 /// EnclaveServerCredentials(SelfSgxLocalCredentialsOptions());
94 /// ```
95 ///
96 /// \return Options used to configure gRPC credentials for a channel that is
97 /// unidirectionally-authenticated on the credential holder's end using
98 /// SGX enclave code identity.
100 
101 } // namespace asylo
102 
103 #endif // ASYLO_GRPC_AUTH_SGX_LOCAL_CREDENTIALS_OPTIONS_H_
EnclaveCredentialsOptions SelfSgxLocalCredentialsOptions()
Creates options suitable for configuring a credential used in establishing a unidirectionally-authent...
EnclaveCredentialsOptions PeerSgxLocalCredentialsOptions()
Creates options suitable for configuring a credential used in establishing a unidirectionally-authent...
Definition: aes_gcm_siv.h:37
EnclaveCredentialsOptions BidirectionalSgxLocalCredentialsOptions()
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenti...