@react-native-ohos/react-native-mmkv-storage
Version:
This library aims to provide a fast & reliable solution for you data storage needs in react-native apps. It uses [MMKV](https://github.com/Tencent/MMKV) by Tencent under the hood on Android and iOS both that is used by their WeChat app(more than 1 Billion
40 lines • 1.92 kB
TypeScript
export default class encryption {
instanceID: string;
alias: string | null;
aliasPrefix: string;
key: string | null;
accessibleMode: string;
initialized: boolean;
constructor(id: string);
/**
* You can encrypt an MMKV instance anytime, even after it is created.
*
* Calling this without a key will generate a key itself & store it in secure storage.
* If no parameters are provided, a key is generated and securely stored in the storage with the default alias for later use.
*
* Note that you don't need to use this method if you use `withEncryption()` at initialization.
* This is only used for encrypting an unencrypted instance at runtime.
*
* @param key; Provide a custom key to encrypt the storage.
* @param secureKeyStorage Store the key in secure storage.
* @param alias Provide a custom alias to store the key with in secure storage
* @param accessibleMode Set accessible mode for secure storage on ios devices
* @returns An object with alias and key
*/
encrypt(key?: string, secureKeyStorage?: boolean, alias?: string, accessibleMode?: string): boolean;
/**
* You can decrypt an encrypted MMKV instance anytime, even after it is created.
* Decrypting the storage will delete the key you encrypted it with
*
*/
decrypt(): boolean;
/**
* Change the encryption key incase the old one has been compromised.
* @param key; Provide a custom key to encrypt the storage.
* @param secureKeyStorage Store the key in secure storage.
* @param alias Provide a custom alias to store the key with in secure storage
* @param accessibleMode Set accessible mode for secure storage on ios devices
*/
changeEncryptionKey(key: string, secureKeyStorage?: boolean, alias?: string, accessibleMode?: string): boolean;
}
//# sourceMappingURL=encryption.d.ts.map