ytls_encrypt_data()

ytls_encrypt_data()#

The ytls_encrypt_data() function encrypts the given clear data in gbuf and triggers the on_encrypted_data_cb callback with the encrypted result.

Prototype

int ytls_encrypt_data(
    hytls       ytls,
    hsskt       sskt,
    gbuffer_t  *gbuf  // owned
);

Parameters

Key

Type

Description

ytls

hytls

TLS context handle.

sskt

hsskt

Secure socket handle.

gbuf

gbuffer_t *

Buffer containing the clear data to be encrypted. Ownership is transferred.


Return Value

Returns 0 on success, or a negative value on failure.

Notes

The encrypted data is delivered asynchronously via the on_encrypted_data_cb callback.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples