|
2 years ago | |
---|---|---|
test | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
example.png | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago |
For backing up cryptographic keys on paper. Takes a array of keys with names and creates a PDF.
const paperKeys = require('.')
const crypto = require('crypto')
const keys = [
{
name: 'My important key',
data: crypto.randomBytes(32)
},
{
name: 'Another important key',
data: crypto.randomBytes(32)
}
]
paperKeys.createPdf('./key-backup.pdf', keys, (err) => {
if (err) throw err
})
createPdf (outputFile, keys, callback)
creates a pdf outputFile
.
keys
should be an array of objects of the form:
name
- a string describing the key (may contain markdown formatting).data
- the key as a buffer or hex encoded string.comment
- an optional comment string to include (may contain markdown formatting).removePdf (filePath)
Securely removes the given file. Returns a promise.
mnemonicToKey (mnemonic)
Turn a mnemonic back into a key. Takes a string, returns a buffer.