3 // Copyright 2020 gRPC authors.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef GRPC_CORE_EXT_XDS_FILE_WATCHER_CERTIFICATE_PROVIDER_FACTORY_H
20 #define GRPC_CORE_EXT_XDS_FILE_WATCHER_CERTIFICATE_PROVIDER_FACTORY_H
22 #include <grpc/support/port_platform.h>
24 #include "src/core/ext/xds/certificate_provider_factory.h"
28 class FileWatcherCertificateProviderFactory
29 : public CertificateProviderFactory {
31 class Config : public CertificateProviderFactory::Config {
33 static RefCountedPtr<Config> Parse(const Json& config_json,
36 const char* name() const override;
38 std::string ToString() const override;
40 const std::string& identity_cert_file() const {
41 return identity_cert_file_;
44 const std::string& private_key_file() const { return private_key_file_; }
46 const std::string& root_cert_file() const { return root_cert_file_; }
48 grpc_millis refresh_interval_ms() const { return refresh_interval_ms_; }
51 std::string identity_cert_file_;
52 std::string private_key_file_;
53 std::string root_cert_file_;
54 grpc_millis refresh_interval_ms_;
57 const char* name() const override;
59 RefCountedPtr<CertificateProviderFactory::Config>
60 CreateCertificateProviderConfig(const Json& config_json,
61 grpc_error** error) override;
63 RefCountedPtr<grpc_tls_certificate_provider> CreateCertificateProvider(
64 RefCountedPtr<CertificateProviderFactory::Config> config) override {
65 // TODO(yashykt) : To be implemented
70 } // namespace grpc_core
72 #endif // GRPC_CORE_EXT_XDS_FILE_WATCHER_CERTIFICATE_PROVIDER_FACTORY_H