ytls_new_secure_filter()
#
ytls_new_secure_filter()
creates a new secure filter for handling encrypted communication using a TLS context.
Prototype
hsskt ytls_new_secure_filter(
hytls ytls,
int (*on_handshake_done_cb)(void *user_data, int error),
int (*on_clear_data_cb)(
void *user_data,
gbuffer_t *gbuf // must be decref
),
int (*on_encrypted_data_cb)(
void *user_data,
gbuffer_t *gbuf // must be decref
),
void *user_data
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The TLS context used to create the secure filter. |
|
|
Callback function invoked when the handshake process completes. The |
|
|
Callback function invoked when decrypted data is available. The |
|
|
Callback function invoked when encrypted data is available. The |
|
|
User-defined data passed to the callback functions. |
Return Value
Returns an hsskt
handle representing the newly created secure filter, or NULL
on failure.
Notes
The secure filter manages encrypted communication and invokes the provided callbacks for handshake completion, clear data reception, and encrypted data transmission.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples