acme.h (2161B)
1 /*
2 * Copyright (c) 2019-2022 Joris Vink <joris@coders.se>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef __H_ACME_H
18 #define __H_ACME_H
19
20 #if defined(__cplusplus)
21 extern "C" {
22 #endif
23
24 /*
25 * All acme paths are relative to the keymgr_root directory.
26 */
27 #define KORE_ACME_ACCOUNT_KEY "account-key.pem"
28 #define KORE_ACME_CERTDIR "certificates"
29
30 #define KORE_ACME_RSAKEY_E (KORE_MSG_ACME_BASE + 1)
31 #define KORE_ACME_RSAKEY_N (KORE_MSG_ACME_BASE + 2)
32 #define KORE_ACME_SIGN (KORE_MSG_ACME_BASE + 3)
33 #define KORE_ACME_SIGN_RESULT (KORE_MSG_ACME_BASE + 4)
34 #define KORE_ACME_PROC_READY (KORE_MSG_ACME_BASE + 5)
35 #define KORE_ACME_ACCOUNT_CREATE (KORE_MSG_ACME_BASE + 10)
36 #define KORE_ACME_ACCOUNT_RESOLVE (KORE_MSG_ACME_BASE + 11)
37 #define KORE_ACME_ORDER_CREATE (KORE_MSG_ACME_BASE + 12)
38 #define KORE_ACME_CSR_REQUEST (KORE_MSG_ACME_BASE + 13)
39 #define KORE_ACME_CSR_RESPONSE (KORE_MSG_ACME_BASE + 14)
40 #define KORE_ACME_INSTALL_CERT (KORE_MSG_ACME_BASE + 15)
41 #define KORE_ACME_ORDER_FAILED (KORE_MSG_ACME_BASE + 16)
42
43 #define KORE_ACME_CHALLENGE_CERT (KORE_MSG_ACME_BASE + 20)
44 #define KORE_ACME_CHALLENGE_SET_CERT (KORE_MSG_ACME_BASE + 21)
45 #define KORE_ACME_CHALLENGE_CLEAR_CERT (KORE_MSG_ACME_BASE + 22)
46
47 void kore_acme_init(void);
48 void kore_acme_run(void);
49 void kore_acme_setup(void);
50 void kore_acme_get_paths(const char *, char **, char **);
51
52 extern char *acme_email;
53 extern int acme_domains;
54 extern char *acme_provider;
55
56 #if defined(__cplusplus)
57 }
58 #endif
59
60 #endif