@react-native-gpui/openpgp
v0.0.1
Published
OpenPGP key generation, encryption and decryption for React Native GPUI apps on rPGP
Readme
@react-native-gpui/openpgp
OpenPGP key generation, encryption and decryption for react-native-gpui apps, on the rPGP Rust library. The API has the shape of the react-native-openpgp module used by mobile apps: generate, encrypt and decrypt.
About
This is our own module. It builds on rPGP (MIT or Apache-2.0) and has no upstream React Native library.
Install
npm install @react-native-gpui/openpgpThe module is autolinked on desktop.
Usage
import OpenPGP from '@react-native-gpui/openpgp';
const { publicKey, privateKey } = await OpenPGP.generate({
name: 'Ada',
email: '[email protected]',
});
const encrypted = await OpenPGP.encrypt('hello', publicKey);
const message = await OpenPGP.decrypt(encrypted, privateKey, 'passphrase');Platforms
macOS is tested. Windows and Linux are not tested yet.
Limitations
Key generation, encryption and decryption of messages with a public or private key; no signing, key import or key management beyond that.
License
MIT. See LICENSE.
