netpgp(3lua) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
NETPGP(3lua)                         LOCAL                        NETPGP(3lua)

netpgp -- provides access to libnetpgp(3) functionality from Lua
local netpgp = require 'netpgp' instance = netpgp.homedir(instance, homedir) netpgp.init(instance) netpgp.encrypt_file(instance, file, output, armour) netpgp.decrypt_file(instance, file, output, armour) netpgp.sign_file(instance, file, output, armour, detached) netpgp.clearsign_file(instance, file, output, armour, detached) netpgp.verify_file(instance, file, armour) netpgp.verify_cat_file(instance, file, output, armour) netpgp.list_packets(instance, file, armour) netpgp.setvar(instance, name, value) netpgp.getvar(instance, name, value)
The netpgp Lua binding provides access to functionality availabile in libnetpgp(3).
The following example code demonstrates the process of encrypting, decrypting, signing, and verifying a file, in a single script. local netpgp = require 'netpgp' btc = netpgp.setvar(btc, "need seckey", 1) netpgp.init(btc) netpgp.encrypt_file(btc, "scratch", "scratch.gpg", "armoured") netpgp.decrypt_file(btc, "scratch.gpg", "itch", "armoured") netpgp.sign_file(btc, "scratch", "scratch.asc", "armoured", "detached") netpgp.verify_file(btc, "scratch.asc", "armoured")
lua(1), luac(1), libnetpgp(3), intro(3lua)
netpgp Lua binding first appeared in NetBSD 9.0.
The netpgp Lua binding was written by Alistair Crooks. This manual was written by Sevan Janiyan <>.
This binding currently only provides a subset of the functionality avail- able in libnetpgp(3). This manual needs more description of the avail- able functionality. NetBSD 9.99 April 30, 2018 NetBSD 9.99
Powered by man-cgi (2020-09-24). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.