tls_certificate_provider.cc
Go to the documentation of this file.
1 //
2 // Copyright 2020 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #include <string>
18 #include <vector>
19 
20 #include <grpc/grpc_security.h>
21 #include <grpc/support/log.h>
23 #include <grpcpp/support/config.h>
24 
25 namespace grpc {
26 namespace experimental {
27 
30  const std::vector<IdentityKeyCertPair>& identity_key_cert_pairs) {
34  grpc_tls_identity_pairs_add_pair(pairs_core, pair.private_key.c_str(),
35  pair.certificate_chain.c_str());
36  }
38  root_certificate.c_str(), pairs_core);
39  GPR_ASSERT(c_provider_ != nullptr);
40 };
41 
44 };
45 
47  const std::string& private_key_path,
48  const std::string& identity_certificate_path,
49  const std::string& root_cert_path, unsigned int refresh_interval_sec) {
51  private_key_path.c_str(), identity_certificate_path.c_str(),
52  root_cert_path.c_str(), refresh_interval_sec);
53  GPR_ASSERT(c_provider_ != nullptr);
54 };
55 
58 };
59 
60 } // namespace experimental
61 } // namespace grpc
log.h
grpc_tls_identity_pairs_create
GRPCAPI grpc_tls_identity_pairs * grpc_tls_identity_pairs_create()
Definition: grpc_tls_certificate_distributor.cc:332
grpc
Definition: grpcpp/alarm.h:33
grpc_tls_identity_pairs
Definition: grpc_tls_certificate_distributor.h:38
grpc::experimental::StaticDataCertificateProvider::StaticDataCertificateProvider
StaticDataCertificateProvider(const std::string &root_certificate, const std::vector< IdentityKeyCertPair > &identity_key_cert_pairs)
Definition: tls_certificate_provider.cc:28
grpc::experimental::IdentityKeyCertPair
Definition: tls_certificate_provider.h:45
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_tls_certificate_provider_release
GRPCAPI void grpc_tls_certificate_provider_release(grpc_tls_certificate_provider *provider)
Definition: grpc_tls_certificate_provider.cc:477
grpc_tls_identity_pairs_add_pair
GRPCAPI void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs *pairs, const char *private_key, const char *cert_chain)
Definition: grpc_tls_certificate_distributor.cc:336
grpc_security.h
grpc::experimental::FileWatcherCertificateProvider::c_provider_
grpc_tls_certificate_provider * c_provider_
Definition: tls_certificate_provider.h:121
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc::experimental::FileWatcherCertificateProvider::FileWatcherCertificateProvider
FileWatcherCertificateProvider(const std::string &private_key_path, const std::string &identity_certificate_path, const std::string &root_cert_path, unsigned int refresh_interval_sec)
Definition: tls_certificate_provider.cc:46
tls_certificate_provider.h
config.h
grpc::experimental::FileWatcherCertificateProvider::~FileWatcherCertificateProvider
~FileWatcherCertificateProvider() override
Definition: tls_certificate_provider.cc:56
grpc::experimental::StaticDataCertificateProvider::c_provider_
grpc_tls_certificate_provider * c_provider_
Definition: tls_certificate_provider.h:71
identity_key_cert_pairs
grpc_core::PemKeyCertPairList identity_key_cert_pairs
Definition: xds_end2end_test.cc:143
grpc_tls_certificate_provider_file_watcher_create
GRPCAPI grpc_tls_certificate_provider * grpc_tls_certificate_provider_file_watcher_create(const char *private_key_path, const char *identity_certificate_path, const char *root_cert_path, unsigned int refresh_interval_sec)
Definition: grpc_tls_certificate_provider.cc:467
grpc_tls_certificate_provider_static_data_create
GRPCAPI grpc_tls_certificate_provider * grpc_tls_certificate_provider_static_data_create(const char *root_certificate, grpc_tls_identity_pairs *pem_key_cert_pairs)
Definition: grpc_tls_certificate_provider.cc:449
root_certificate
std::string root_certificate
Definition: xds_end2end_test.cc:142
pair
std::pair< std::string, std::string > pair
Definition: abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc:78
grpc::experimental::StaticDataCertificateProvider::~StaticDataCertificateProvider
~StaticDataCertificateProvider() override
Definition: tls_certificate_provider.cc:42


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:39