https://github.com/thang2162/react-native-key-manager
A package for securely generating and mananging keys in React-Native.
https://github.com/thang2162/react-native-key-manager
Last synced: 2 months ago
JSON representation
A package for securely generating and mananging keys in React-Native.
- Host: GitHub
- URL: https://github.com/thang2162/react-native-key-manager
- Owner: thang2162
- License: mit
- Created: 2023-11-23T00:28:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T21:33:57.000Z (over 1 year ago)
- Last Synced: 2025-01-14T02:12:09.150Z (4 months ago)
- Language: Java
- Size: 1.43 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# react-native-key-mamager
A package for securely generating and mananging keys in React-Native.
## Installation
```sh
npm install react-native-key-manager --savecd ios && pod install && cd ..
```or
```sh
yarn add react-native-key-managercd ios && pod install && cd ..
```## Usage
```js
import {
CreateOrGetKey,
GenerateKey,
GetKey,
DeleteKey,
UpdateKey,
SetKey,
} from 'react-native-key-manager';// ...
const result = await GenerateKey();
```## API
1. 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.2. 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.3. 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.4. 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.5. CreateOrGetKey(alias: string, length: number (Optional), characterSet: string (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.6. GenerateKey(length: number (Optional), characterSet: string (Optional)) - Creates a Key.
Returns: String of a random key of desired length.## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT