This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs = require("fs"); | |
import openpgp = require('openpgp'); | |
import { Readable } from "stream"; | |
(async () => { | |
const { privateKey, publicKey } = await openpgp.generateKey({ | |
type: 'rsa', // Type of the key | |
rsaBits: 4096, // RSA key size (defaults to 4096 bits) | |
userIDs: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs |