Skip to main content

fs_create_network

Function fs_create_network 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn fs_create_network( addr: *const c_char, server_name: *const c_char, ca_cert_path: *const c_char, cache_blocks: u32, master_key: *const u8, master_key_len: usize, ) -> *mut FsHandle
Expand description

Create a filesystem handle backed by a remote doublecrypt-server over TLS.

The connection uses key-derived authentication (HKDF from the master key) and wraps the network store in a write-back LRU cache.

addr: null-terminated server address, e.g. "10.0.0.5:9100". server_name: null-terminated TLS SNI hostname, e.g. "dc-server". ca_cert_path: null-terminated path to the CA certificate PEM file. cache_blocks: number of blocks to cache locally (0 = default 256). master_key: pointer to the master encryption key bytes. master_key_len: length of master_key in bytes (should be 32).

Returns a pointer to an opaque handle, or null on failure (connection refused, TLS error, authentication failure, etc.).

ยงSafety

  • addr, server_name, and ca_cert_path must be valid null-terminated C strings.
  • master_key must point to master_key_len valid bytes.