• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * Copyright 2016 gRPC 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 #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H
19 #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H
20 
21 #include <grpc/support/port_platform.h>
22 
23 #include "src/core/lib/security/credentials/credentials.h"
24 
25 typedef struct {
26   grpc_channel_credentials base;
27   grpc_ssl_config config;
28 } grpc_ssl_credentials;
29 
30 struct grpc_ssl_server_certificate_config {
31   grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs;
32   size_t num_key_cert_pairs;
33   char* pem_root_certs;
34 };
35 
36 typedef struct {
37   grpc_ssl_server_certificate_config_callback cb;
38   void* user_data;
39 } grpc_ssl_server_certificate_config_fetcher;
40 
41 typedef struct {
42   grpc_server_credentials base;
43   grpc_ssl_server_config config;
44   grpc_ssl_server_certificate_config_fetcher certificate_config_fetcher;
45 } grpc_ssl_server_credentials;
46 
47 tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
48     const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
49     size_t num_key_cert_pairs);
50 
51 void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
52                                              size_t num_key_cert_pairs);
53 
54 #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H */
55