NETPGP(3lua) | LUA Library Manual | NETPGP(3lua)

# NAME

`netpgp` —
provides access to libnetpgp(3) functionality from Lua

# SYNOPSIS

`local netpgp = require 'netpgp'`

`instance = netpgp.new()`
`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)`

# DESCRIPTION

The `netpgp` Lua binding provides access to functionality availabile in libnetpgp(3).

# EXAMPLES

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.new()
    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")

# SEE ALSO

lua(1), luac(1), libnetpgp(3), intro(3lua)

# HISTORY

`netpgp` Lua binding first appeared in NetBSD 9.0.

# AUTHORS

The `netpgp` Lua binding was written by Alistair Crooks. This manual was written by Sevan Janiyan <sevan@NetBSD.org>.

# BUGS

This binding currently only provides a subset of the functionality available in libnetpgp(3). This manual needs more description of the available functionality.

April 30, 2018 | NetBSD 9.2