Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 2.04 KB

README.md

File metadata and controls

62 lines (41 loc) · 2.04 KB

Description

C library to store data or multiple files in an encrypted single-file storage.

API

Example of use of API without error handling for sake of simplicity. For a detailed example, see examples folder.

Create entries

sstorage_entry *first = sstorage_entry_create(<DATA_TYPE_INTEGER>);
sstorage_entry_add_string(first, "Hello world !");

// write first entry
sstorage_entry_destroy(first);

sstorage_entry *second = sstorage_entry_create(<DATA_TYPE_INTEGER>);
sstorage_entry_add_file(second, "data.bin");

// write second entry
sstorage_entry_destroy(second);

Write entries to storage

sstorage *storage = sstorage_open_write("example.sst", <crypto_metadata>);

sstorage_push_entry(storage, first);
sstorage_push_entry(storage, second);

sstorage_close(storage);

Read an entry from storage

sstorage *storage = sstorage_open_read("example.sst", <crypto_metadata>);

if (!sstorage_has_next(storage)) {
    <error_handling>
}

entry = sstorage_next(storage);

sstorage_close(storage);

Dependencies

Cross-plateform

Tested on Windows 64, but it should also work on Windows x86 and Linux.