VLink  2.0.0
A high-performance communication middleware
vlink_security_config_s结构体 参考

Configuration aggregate for vlink_security_create() and the vlink_create_secure_*() entry points. 更多...

#include <c_api.h>

vlink_security_config_s 的协作图:

Public 属性

const char * key
 
const char * passphrase
 
const uint8_t * pbkdf2_salt
 
size_t pbkdf2_salt_size
 
uint32_t pbkdf2_iterations
 
const char * public_key_pem
 
const char * private_key_pem
 
vlink_security_callback_t encrypt_callback
 
vlink_security_callback_t decrypt_callback
 
void * callback_user_data
 
vlink_security_advanced_config_t advanced
 

详细描述

Configuration aggregate for vlink_security_create() and the vlink_create_secure_*() entry points.

Each field maps onto the field of the same name on vlink::Security::Config. String fields are null-terminated; NULL or empty strings disable the matching explicit field. When every explicit cryptographic field is empty, the configuration maps to the built-in default symmetric slot, provided built-in algorithms are enabled. A zero-initialised aggregate leaves advanced.replay_window at 0, so replay checks are disabled until the caller sets the field or calls vlink_security_config_init(). pbkdf2_salt is a raw byte buffer of pbkdf2_salt_size bytes; pass NULL / 0 to leave it empty. Setting pbkdf2_iterations to 0 selects the default (200000).

Mode Selection
  • When both encrypt_callback and decrypt_callback are non-NULL the custom-callback path overrides every other slot.
  • When public_key_pem / private_key_pem are installed the RSA hybrid path drives outbound / inbound messages.
  • Otherwise the symmetric path is used with a key derived from key, passphrase + pbkdf2_salt, or the built-in default.
注解
key / passphrase are the symmetric key sources. advanced holds low-frequency options such as AAD, replay protection, and signing.

类成员变量说明

◆ advanced

vlink_security_advanced_config_t vlink_security_config_s::advanced

Low-frequency security options.

◆ callback_user_data

void* vlink_security_config_s::callback_user_data

Opaque pointer forwarded to both callbacks.

◆ decrypt_callback

vlink_security_callback_t vlink_security_config_s::decrypt_callback

Custom decrypt callback, or NULL.

◆ encrypt_callback

vlink_security_callback_t vlink_security_config_s::encrypt_callback

Custom encrypt callback, or NULL.

◆ key

const char* vlink_security_config_s::key

Raw symmetric seed (SHA-256 truncated), or NULL.

◆ passphrase

const char* vlink_security_config_s::passphrase

Low-entropy passphrase fed into PBKDF2-HMAC-SHA256, or NULL.

◆ pbkdf2_iterations

uint32_t vlink_security_config_s::pbkdf2_iterations

PBKDF2 iteration count; 0 means default (200000).

◆ pbkdf2_salt

const uint8_t* vlink_security_config_s::pbkdf2_salt

PBKDF2 salt (>=16 bytes), or NULL.

◆ pbkdf2_salt_size

size_t vlink_security_config_s::pbkdf2_salt_size

Byte count of pbkdf2_salt.

◆ private_key_pem

const char* vlink_security_config_s::private_key_pem

Local RSA private key (PEM) for inbound decryption, or NULL.

◆ public_key_pem

const char* vlink_security_config_s::public_key_pem

Peer RSA public key (PEM) for outbound encryption, or NULL.


该结构体的文档由以下文件生成: