Skip to content

[WIP] GPG manager made in Rust 🦀 and compiled to WASM

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT
Notifications You must be signed in to change notification settings

EmanuelJr/gpg-manager-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPG Manager WASM

GPG Manager WASM is a library made in Rust to be compiled in WASM to manage GPG keys.

Dependencies

Using

import * as gpg from 'gpg-manager-wasm'; // Package not published yet

const publicKey = '`-----BEGIN PGP PUBLIC KEY BLOCK-----...';
const privateKey = '-----BEGIN PGP PRIVATE KEY BLOCK-----...';
const password = '123456';

// Creating a keyring
const keyring = new gpg.KeyRing();

// Load the public key to keyring
const [fpPublicKey] = keyring.loadKeys(publicKey)
const [fpPrivateKey] = keyring.loadKeys(privateKey);

// Unlock private key to be user
keyring.unlockKey(fpPrivateKey, password);

// Encrypting a payload
const encrypted = keyring.encrypt(fpPrivateKey, 'Hello World!');
// Decrypting a payload
const decrypted = keyring.decrypt(fpPrivateKey, encrypted);

// Signing a payload
const signature = keyring.sign(fpPrivateKey, 'Hello World!');
// Validating a signature, throws if the signature is not valid
keyring.verifySignature(fpPublicKey, signature, 'Hello World!');

// Generating a keypair
const keypair = gpg.generateKey(2048, null, 'John Doe', '[email protected]', password);

Building

wasm-pack build

That's it!

About

[WIP] GPG manager made in Rust 🦀 and compiled to WASM

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages