![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
X.509 helpers implementation: CA generation and per-host leaf minting. More...
#include "nilorea/n_x509.h"#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include <arpa/inet.h>#include <string.h>#include <openssl/bn.h>#include <openssl/evp.h>#include <openssl/pem.h>#include <openssl/rsa.h>#include <openssl/x509.h>#include <openssl/x509v3.h>
Include dependency graph for n_x509.c:Go to the source code of this file.
Macros | |
| #define | N_X509_KEY_BITS 2048 |
| RSA modulus size in bits used for the CA and leaf keys. | |
| #define | N_X509_SAN_BUF 300 |
| buffer size for a subjectAltName value string | |
| #define | N_X509_SERIAL_BITS 64 |
| random serial number size in bits | |
Functions | |
| static int | add_ext (X509 *issuer, X509 *subject, int nid, const char *value) |
| static int | bio_to_nstr (BIO *bio, N_STR **out) |
| static EVP_PKEY * | gen_rsa (int bits) |
| static int | host_is_ip (const char *host) |
| int | n_x509_generate_ca (const char *cn, int days, N_STR **ca_cert_pem, N_STR **ca_key_pem) |
| Generate a self-signed certificate authority (CA) keypair and cert. | |
| int | n_x509_keypair_pem (int bits, N_STR **key_pem) |
| Generate an RSA private key and return it as a PEM string. | |
| int | n_x509_mint_host_cert (const char *host, const N_STR *ca_cert_pem, const N_STR *ca_key_pem, int days, N_STR **leaf_cert_pem, N_STR **leaf_key_pem) |
| Mint a per-host leaf certificate signed by the given CA. | |
| static int | pkey_to_pem (EVP_PKEY *pkey, N_STR **out) |
| static int | set_cn (X509_NAME *name, const char *cn) |
| static int | set_random_serial (X509 *x) |
| static int | x509_to_pem (X509 *x, N_STR **out) |
X.509 helpers implementation: CA generation and per-host leaf minting.
Definition in file n_x509.c.
| #define N_X509_KEY_BITS 2048 |
| #define N_X509_SAN_BUF 300 |
| #define N_X509_SERIAL_BITS 64 |
|
static |
Definition at line 110 of file n_x509.c.
Referenced by n_x509_generate_ca(), and n_x509_mint_host_cert().
Here is the caller graph for this function:
|
static |
Definition at line 59 of file n_x509.c.
References char_to_nstr_ex().
Referenced by pkey_to_pem(), and x509_to_pem().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 144 of file n_x509.c.
Referenced by n_x509_generate_ca(), n_x509_keypair_pem(), and n_x509_mint_host_cert().
Here is the caller graph for this function:
|
static |
Definition at line 133 of file n_x509.c.
Referenced by n_x509_mint_host_cert().
Here is the caller graph for this function:
|
static |
Definition at line 71 of file n_x509.c.
References bio_to_nstr().
Referenced by n_x509_generate_ca(), n_x509_keypair_pem(), and n_x509_mint_host_cert().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 126 of file n_x509.c.
Referenced by n_x509_generate_ca(), and n_x509_mint_host_cert().
Here is the caller graph for this function:
|
static |
Definition at line 95 of file n_x509.c.
References N_X509_SERIAL_BITS.
Referenced by n_x509_generate_ca(), and n_x509_mint_host_cert().
Here is the caller graph for this function:
|
static |
Definition at line 83 of file n_x509.c.
References bio_to_nstr().
Referenced by n_x509_generate_ca(), and n_x509_mint_host_cert().
Here is the call graph for this function:
Here is the caller graph for this function: