UDIF: Universal Digital Identification Framework 1.1.0.0a (A1)
A quantum-secure cryptographic identification
qstpkeys.h File Reference

Forward declarations for QSTP functions used by UDIF role modules. More...

#include "qstp.h"

Go to the source code of this file.

Functions

QSTP_EXPORT_API void qstp_root_key_generate (qstp_root_signature_key *kset, const char issuer[QSTP_CERTIFICATE_ISSUER_SIZE], uint32_t exp)
QSTP_EXPORT_API void qstp_server_key_generate (qstp_server_signature_key *kset, const char issuer[QSTP_CERTIFICATE_ISSUER_SIZE], uint32_t exp)
QSTP_EXPORT_API qstp_errors qstp_server_start_ipv4 (qsc_socket *source, const qstp_server_signature_key *kset, void(*receive_callback)(qstp_connection_state *, const char *, size_t), void(*disconnect_callback)(qstp_connection_state *))
 Start the IPv4 QSTP multi-threaded server.
QSTP_EXPORT_API qstp_errors qstp_client_connect_ipv4 (const qstp_root_certificate *root, const qstp_server_certificate *cert, const qsc_ipinfo_ipv4_address *address, uint16_t port, void(*send_func)(qstp_connection_state *), void(*receive_callback)(qstp_connection_state *, const char *, size_t))
 Connect to a QSTP server over IPv4.

Detailed Description

Forward declarations for QSTP functions used by UDIF role modules.

qstp_root_key_generate, qstp_server_key_generate, qstp_server_start_ipv4, and qstp_client_connect_ipv4 are defined in the QSTP project (root.h / server.h / client.h). When those headers are on the compiler's include path the guard macros QSTP_ROOT_H / QSTP_SERVER_H / QSTP_CLIENT_H suppress these declarations. When they are not available these externs satisfy the compiler; the linker resolves the symbols from the QSTP lib.

Function Documentation

◆ qstp_client_connect_ipv4()

QSTP_EXPORT_API qstp_errors qstp_client_connect_ipv4 ( const qstp_root_certificate * root,
const qstp_server_certificate * cert,
const qsc_ipinfo_ipv4_address * address,
uint16_t port,
void(* send_func )(qstp_connection_state *),
void(* receive_callback )(qstp_connection_state *, const char *, size_t) )

Connect to a QSTP server over IPv4.

Parameters
rootRoot certificate (trust anchor)
certClient's server certificate
addressServer IPv4 address
portServer port
send_funcSend-loop callback (drives keepalive / ratchet)
receive_callbackCalled when a message arrives
Returns
qstp_errors result code

◆ qstp_root_key_generate()

QSTP_EXPORT_API void qstp_root_key_generate ( qstp_root_signature_key * kset,
const char issuer[QSTP_CERTIFICATE_ISSUER_SIZE],
uint32_t exp )

generate a new QSTP root signing keypair.

◆ qstp_server_key_generate()

QSTP_EXPORT_API void qstp_server_key_generate ( qstp_server_signature_key * kset,
const char issuer[QSTP_CERTIFICATE_ISSUER_SIZE],
uint32_t exp )

Generate a new QSTP server signing keypair.

◆ qstp_server_start_ipv4()

QSTP_EXPORT_API qstp_errors qstp_server_start_ipv4 ( qsc_socket * source,
const qstp_server_signature_key * kset,
void(* receive_callback )(qstp_connection_state *, const char *, size_t),
void(* disconnect_callback )(qstp_connection_state *) )

Start the IPv4 QSTP multi-threaded server.

The function initializes, binds, and listens on the socket internally. Blocks until the server is stopped.

Parameters
sourcePre-zeroed qsc_socket (filled by this function)
ksetServer signature key
receive_callbackCalled when a message arrives
disconnect_callbackCalled when a client disconnects
Returns
qstp_errors result code