/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/security/lockstore/nsILockstore.idl
*/
#ifndef __gen_nsILockstore_h__
#define __gen_nsILockstore_h__
#include "nsISupports.h"
#include "nsTArray.h"
#include "js/Value.h"
#include "js/GCAnnotations.h"
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsILockstore */
#define NS_ILOCKSTORE_IID_STR "a83f5d62-7b1c-4d2e-9f0a-3c5e8b6a1d4e"
#define NS_ILOCKSTORE_IID \
{0xa83f5d62, 0x7b1c, 0x4d2e, \
{ 0x9f, 0x0a, 0x3c, 0x5e, 0x8b, 0x6a, 0x1d, 0x4e }}
class NS_NO_VTABLE nsILockstore : public nsISupports {
public:
NS_INLINE_DECL_STATIC_IID(NS_ILOCKSTORE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsILockstore;
/* readonly attribute boolean hasPrimaryPassword; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetHasPrimaryPassword(bool *aHasPrimaryPassword) = 0;
/* [implicit_jscontext] Promise setPrimaryPassword (in ACString oldPassword, in ACString newPassword); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetPrimaryPassword(const nsACString& oldPassword, const nsACString& newPassword, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise unlockKek (in AUTF8String kekRef, in ACString secret, in uint32_t timeoutMs); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD UnlockKek(const nsACString& kekRef, const nsACString& secret, uint32_t timeoutMs, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise lockKek (in AUTF8String kekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD LockKek(const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* boolean isKekUnlocked (in AUTF8String kekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD IsKekUnlocked(const nsACString& kekRef, bool *_retval) = 0;
/* [implicit_jscontext] Promise lock (); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Lock(JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise createDek (in AUTF8String collection, in AUTF8String kekRef, in boolean extractable); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CreateDek(const nsACString& collection, const nsACString& kekRef, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise importDek (in AUTF8String collection, in AUTF8String kekRef, in Array<octet> dekBytes, in boolean extractable); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ImportDek(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& dekBytes, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise isDekExtractable (in AUTF8String collection); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD IsDekExtractable(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise deleteDek (in AUTF8String collection); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteDek(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise listCollections (); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ListCollections(JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise listKeks (in AUTF8String collection); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ListKeks(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise addKek (in AUTF8String collection, in AUTF8String fromKekRef, in AUTF8String toKekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD AddKek(const nsACString& collection, const nsACString& fromKekRef, const nsACString& toKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise removeKek (in AUTF8String collection, in AUTF8String kekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveKek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise switchKek (in AUTF8String collection, in AUTF8String oldKekRef, in AUTF8String newKekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SwitchKek(const nsACString& collection, const nsACString& oldKekRef, const nsACString& newKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise encrypt (in AUTF8String collection, in AUTF8String kekRef, in Array<octet> plaintext); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Encrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& plaintext, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise decrypt (in AUTF8String collection, in AUTF8String kekRef, in Array<octet> ciphertext); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Decrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& ciphertext, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
/* [implicit_jscontext] Promise getDek (in AUTF8String collection, in AUTF8String kekRef); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSILOCKSTORE \
NS_IMETHOD GetHasPrimaryPassword(bool *aHasPrimaryPassword) override; \
NS_IMETHOD SetPrimaryPassword(const nsACString& oldPassword, const nsACString& newPassword, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD UnlockKek(const nsACString& kekRef, const nsACString& secret, uint32_t timeoutMs, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD LockKek(const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD IsKekUnlocked(const nsACString& kekRef, bool *_retval) override; \
NS_IMETHOD Lock(JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD CreateDek(const nsACString& collection, const nsACString& kekRef, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD ImportDek(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& dekBytes, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD IsDekExtractable(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD DeleteDek(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD ListCollections(JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD ListKeks(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD AddKek(const nsACString& collection, const nsACString& fromKekRef, const nsACString& toKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD RemoveKek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD SwitchKek(const nsACString& collection, const nsACString& oldKekRef, const nsACString& newKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD Encrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& plaintext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD Decrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& ciphertext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \
NS_IMETHOD GetDek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSILOCKSTORE \
nsresult GetHasPrimaryPassword(bool *aHasPrimaryPassword); \
nsresult SetPrimaryPassword(const nsACString& oldPassword, const nsACString& newPassword, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult UnlockKek(const nsACString& kekRef, const nsACString& secret, uint32_t timeoutMs, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult LockKek(const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult IsKekUnlocked(const nsACString& kekRef, bool *_retval); \
nsresult Lock(JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult CreateDek(const nsACString& collection, const nsACString& kekRef, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult ImportDek(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& dekBytes, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult IsDekExtractable(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult DeleteDek(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult ListCollections(JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult ListKeks(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult AddKek(const nsACString& collection, const nsACString& fromKekRef, const nsACString& toKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult RemoveKek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult SwitchKek(const nsACString& collection, const nsACString& oldKekRef, const nsACString& newKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult Encrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& plaintext, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult Decrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& ciphertext, JSContext* cx, ::mozilla::dom::Promise * * _retval); \
nsresult GetDek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSILOCKSTORE(_to) \
NS_IMETHOD GetHasPrimaryPassword(bool *aHasPrimaryPassword) override { return _to GetHasPrimaryPassword(aHasPrimaryPassword); } \
NS_IMETHOD SetPrimaryPassword(const nsACString& oldPassword, const nsACString& newPassword, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to SetPrimaryPassword(oldPassword, newPassword, cx, _retval); } \
NS_IMETHOD UnlockKek(const nsACString& kekRef, const nsACString& secret, uint32_t timeoutMs, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to UnlockKek(kekRef, secret, timeoutMs, cx, _retval); } \
NS_IMETHOD LockKek(const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to LockKek(kekRef, cx, _retval); } \
NS_IMETHOD IsKekUnlocked(const nsACString& kekRef, bool *_retval) override { return _to IsKekUnlocked(kekRef, _retval); } \
NS_IMETHOD Lock(JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to Lock(cx, _retval); } \
NS_IMETHOD CreateDek(const nsACString& collection, const nsACString& kekRef, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to CreateDek(collection, kekRef, extractable, cx, _retval); } \
NS_IMETHOD ImportDek(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& dekBytes, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to ImportDek(collection, kekRef, dekBytes, extractable, cx, _retval); } \
NS_IMETHOD IsDekExtractable(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to IsDekExtractable(collection, cx, _retval); } \
NS_IMETHOD DeleteDek(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to DeleteDek(collection, cx, _retval); } \
NS_IMETHOD ListCollections(JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to ListCollections(cx, _retval); } \
NS_IMETHOD ListKeks(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to ListKeks(collection, cx, _retval); } \
NS_IMETHOD AddKek(const nsACString& collection, const nsACString& fromKekRef, const nsACString& toKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to AddKek(collection, fromKekRef, toKekRef, cx, _retval); } \
NS_IMETHOD RemoveKek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to RemoveKek(collection, kekRef, cx, _retval); } \
NS_IMETHOD SwitchKek(const nsACString& collection, const nsACString& oldKekRef, const nsACString& newKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to SwitchKek(collection, oldKekRef, newKekRef, cx, _retval); } \
NS_IMETHOD Encrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& plaintext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to Encrypt(collection, kekRef, plaintext, cx, _retval); } \
NS_IMETHOD Decrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& ciphertext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to Decrypt(collection, kekRef, ciphertext, cx, _retval); } \
NS_IMETHOD GetDek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to GetDek(collection, kekRef, cx, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSILOCKSTORE(_to) \
NS_IMETHOD GetHasPrimaryPassword(bool *aHasPrimaryPassword) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasPrimaryPassword(aHasPrimaryPassword); } \
NS_IMETHOD SetPrimaryPassword(const nsACString& oldPassword, const nsACString& newPassword, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPrimaryPassword(oldPassword, newPassword, cx, _retval); } \
NS_IMETHOD UnlockKek(const nsACString& kekRef, const nsACString& secret, uint32_t timeoutMs, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UnlockKek(kekRef, secret, timeoutMs, cx, _retval); } \
NS_IMETHOD LockKek(const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LockKek(kekRef, cx, _retval); } \
NS_IMETHOD IsKekUnlocked(const nsACString& kekRef, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsKekUnlocked(kekRef, _retval); } \
NS_IMETHOD Lock(JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Lock(cx, _retval); } \
NS_IMETHOD CreateDek(const nsACString& collection, const nsACString& kekRef, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateDek(collection, kekRef, extractable, cx, _retval); } \
NS_IMETHOD ImportDek(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& dekBytes, bool extractable, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportDek(collection, kekRef, dekBytes, extractable, cx, _retval); } \
NS_IMETHOD IsDekExtractable(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsDekExtractable(collection, cx, _retval); } \
NS_IMETHOD DeleteDek(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteDek(collection, cx, _retval); } \
NS_IMETHOD ListCollections(JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ListCollections(cx, _retval); } \
NS_IMETHOD ListKeks(const nsACString& collection, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ListKeks(collection, cx, _retval); } \
NS_IMETHOD AddKek(const nsACString& collection, const nsACString& fromKekRef, const nsACString& toKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddKek(collection, fromKekRef, toKekRef, cx, _retval); } \
NS_IMETHOD RemoveKek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveKek(collection, kekRef, cx, _retval); } \
NS_IMETHOD SwitchKek(const nsACString& collection, const nsACString& oldKekRef, const nsACString& newKekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SwitchKek(collection, oldKekRef, newKekRef, cx, _retval); } \
NS_IMETHOD Encrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& plaintext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Encrypt(collection, kekRef, plaintext, cx, _retval); } \
NS_IMETHOD Decrypt(const nsACString& collection, const nsACString& kekRef, const nsTArray<uint8_t >& ciphertext, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Decrypt(collection, kekRef, ciphertext, cx, _retval); } \
NS_IMETHOD GetDek(const nsACString& collection, const nsACString& kekRef, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDek(collection, kekRef, cx, _retval); }
#endif /* __gen_nsILockstore_h__ */