react-native-key-mamager
A package for securely generating and mananging keys in React-Native.
Installation
npm install react-native-key-manager --save
cd ios && pod install && cd ..
or
yarn add react-native-key-manager
cd ios && pod install && cd ..
Usage
import {
CreateOrGetKey,
GenerateKey,
GetKey,
DeleteKey,
UpdateKey,
SetKey,
} from 'react-native-key-manager';
const result = await GenerateKey();
API
-
SetKey(alias: string, key: string) - Save the key.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
-
UpdateUser(alias: string, key: string) - Update the key.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
-
GetKey(alias: string) - Gets the key.
Returns: Promise that resolves with object {success: true, alias: "alias", key: "key"} if success or rejects with message if fail.
-
DeleteUser(alias: string) - Deletes the alias.
Returns: Promise that resolves with object {success: true, message: response_text} if success or rejects with message if fail.
-
CreateOrGetKey(alias: string, length: number (Optional)) - Creates or Rertives a Key.
Returns: Promise that resolves with object {success: true, alias: "alias", key: "key"} if success or rejects with message if fail.
-
GenerateKey(length: number (Optional)) - Creates a Key.
Returns: String of a random key of desired length.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT