/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_security_LockstoreFFI_h
#define mozilla_security_LockstoreFFI_h
/* Generated with cbindgen:0.29.1 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen. See RunCbindgen.py */
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
#include "nsStringFwd.h"
#include "nsTArrayForwardDeclare.h"
namespace mozilla {
namespace security {
namespace lockstore {
enum class LockstoreSecurityLevel : uint32_t {
LocalKey = 0,
};
struct LockstoreDatastore;
struct LockstoreKeystoreHandle;
extern "C" {
nsresult lockstore_keystore_open(const nsACString *profile_path,
LockstoreKeystoreHandle **ret_handle);
nsresult lockstore_keystore_create_dek(const LockstoreKeystoreHandle *handle,
const nsACString *collection,
LockstoreSecurityLevel security_level,
bool extractable);
nsresult lockstore_keystore_get_dek(const LockstoreKeystoreHandle *handle,
const nsACString *collection,
LockstoreSecurityLevel security_level,
nsTArray<uint8_t> *ret_dek);
nsresult lockstore_keystore_delete_dek(const LockstoreKeystoreHandle *handle,
const nsACString *collection);
nsresult lockstore_keystore_list_collections(const LockstoreKeystoreHandle *handle,
nsTArray<nsCString> *ret_collections);
nsresult lockstore_keystore_add_security_level(const LockstoreKeystoreHandle *handle,
const nsACString *collection,
LockstoreSecurityLevel from_level,
LockstoreSecurityLevel to_level);
nsresult lockstore_keystore_remove_security_level(const LockstoreKeystoreHandle *handle,
const nsACString *collection,
LockstoreSecurityLevel level);
nsresult lockstore_keystore_close(LockstoreKeystoreHandle *handle);
nsresult lockstore_datastore_open(const LockstoreKeystoreHandle *keystore_handle,
const nsACString *collection,
LockstoreSecurityLevel security_level,
LockstoreDatastore **ret_handle);
nsresult lockstore_datastore_put(const LockstoreDatastore *handle,
const nsACString *entry_name,
const uint8_t *data_ptr,
uintptr_t data_len);
nsresult lockstore_datastore_get(const LockstoreDatastore *handle,
const nsACString *entry_name,
nsTArray<uint8_t> *ret_data);
nsresult lockstore_datastore_delete(const LockstoreDatastore *handle, const nsACString *entry_name);
nsresult lockstore_datastore_keys(const LockstoreDatastore *handle,
nsTArray<nsCString> *ret_entries);
nsresult lockstore_datastore_close(LockstoreDatastore *handle);
} // extern "C"
} // namespace lockstore
} // namespace security
} // namespace mozilla
#endif // mozilla_security_LockstoreFFI_h