CCF
Loading...
Searching...
No Matches
acme_client_config.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/ds/json.h"
6
7#include <optional>
8#include <string>
9#include <vector>
10
11namespace ccf
12{
14 {
15 // Root certificate(s) of the CA to connect to in PEM format (for TLS
16 // connections to the CA, e.g. Let's Encrypt's ISRG Root X1)
17 std::vector<std::string> ca_certs;
18
19 // URL of the ACME server's directory
20 std::string directory_url;
21
22 // DNS name of the service we represent
23 std::string service_dns_name;
24
25 // Alternative DNS names of the service we represent
26 std::vector<std::string> alternative_names;
27
28 // Contact addresses (see RFC8555 7.3, e.g. mailto:john@example.com)
29 std::vector<std::string> contact;
30
31 // Indication that the user/operator is aware of the latest terms and
32 // conditions for the CA
34
35 // Type of the ACME challenge
36 std::string challenge_type = "http-01";
37
38 // Validity range (Note: not supported by Let's Encrypt)
39 std::optional<std::string> not_before;
40 std::optional<std::string> not_after;
41
42 // Name of the interface that the challenge server listens on (if using the
43 // built-in http-01 challenge server frontend)
44 std::optional<std::string> challenge_server_interface = std::nullopt;
45
46 bool operator==(const ACMEClientConfig& other) const = default;
47 };
48
52 ca_certs,
53 directory_url,
54 service_dns_name,
55 contact,
56 terms_of_service_agreed,
57 challenge_type);
59 ACMEClientConfig, not_before, not_after, challenge_server_interface);
60
62 {
63 public:
64 std::map<std::string, std::string> token_responses;
65
67 virtual ~ACMEChallengeHandler() = default;
68
69 virtual bool ready(const std::string& token) = 0;
70 virtual void remove(const std::string& token) = 0;
71 };
72}
Definition acme_client_config.h:62
std::map< std::string, std::string > token_responses
Definition acme_client_config.h:64
virtual bool ready(const std::string &token)=0
virtual void remove(const std::string &token)=0
virtual ~ACMEChallengeHandler()=default
ACMEChallengeHandler()
Definition acme_client_config.h:66
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_TYPE(TYPE)
Definition json.h:663
#define DECLARE_JSON_OPTIONAL_FIELDS(TYPE,...)
Definition json.h:786
Definition app_interface.h:14
Definition acme_client_config.h:14
std::optional< std::string > not_after
Definition acme_client_config.h:40
std::string directory_url
Definition acme_client_config.h:20
std::optional< std::string > challenge_server_interface
Definition acme_client_config.h:44
std::vector< std::string > alternative_names
Definition acme_client_config.h:26
std::string service_dns_name
Definition acme_client_config.h:23
std::vector< std::string > contact
Definition acme_client_config.h:29
bool operator==(const ACMEClientConfig &other) const =default
std::vector< std::string > ca_certs
Definition acme_client_config.h:17
std::optional< std::string > not_before
Definition acme_client_config.h:39
bool terms_of_service_agreed
Definition acme_client_config.h:33
std::string challenge_type
Definition acme_client_config.h:36