Asterisk - The Open Source Telephony Project  18.5.0
stir_shaken.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2020, Sangoma Technologies Corporation
5  *
6  * Kevin Harwell <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 #ifndef _STIR_SHAKEN_H
19 #define _STIR_SHAKEN_H
20 
21 #include <openssl/evp.h>
22 
23 /*!
24  * \brief Output configuration settings to the Asterisk CLI
25  *
26  * \param obj A sorcery object containing configuration data
27  * \param arg Asterisk CLI argument object
28  * \param flags ao2 container flags
29  *
30  * \retval 0
31  */
32 int stir_shaken_cli_show(void *obj, void *arg, int flags);
33 
34 /*!
35  * \brief Tab completion for name matching with STIR/SHAKEN CLI commands
36  *
37  * \param word The word to tab complete on
38  * \param container The sorcery container to iterate through
39  *
40  * \retval The tab completion options
41  */
42 char *stir_shaken_tab_complete_name(const char *word, struct ao2_container *container);
43 
44 /*!
45  * \brief Reads the public (or private) key from the specified path
46  *
47  * \param path The path to the file containing the private key
48  * \param priv Specify 0 for public, 1 for private
49  *
50  * \retval NULL on failure
51  * \retval The public/private key on success
52  */
53 EVP_PKEY *stir_shaken_read_key(const char *path, int priv);
54 
55 /*!
56  * \brief Gets the serial number in hex form from the X509 certificate at path
57  *
58  * \note The returned string will need to be freed by the caller
59  *
60  * \param path The full path of the X509 certificate
61  *
62  * \retval NULL on failure
63  * \retval serial number on success
64  */
65 char *stir_shaken_get_serial_number_x509(const char *path);
66 
67 #endif /* _STIR_SHAKEN_H */
EVP_PKEY * stir_shaken_read_key(const char *path, int priv)
Reads the public (or private) key from the specified path.
Definition: stir_shaken.c:89
struct ao2_container * container
Definition: res_fax.c:502
Generic container type.
char * stir_shaken_tab_complete_name(const char *word, struct ao2_container *container)
Tab completion for name matching with STIR/SHAKEN CLI commands.
Definition: stir_shaken.c:66
int stir_shaken_cli_show(void *obj, void *arg, int flags)
Output configuration settings to the Asterisk CLI.
Definition: stir_shaken.c:35
char * stir_shaken_get_serial_number_x509(const char *path)
Gets the serial number in hex form from the X509 certificate at path.
Definition: stir_shaken.c:140
short word