xref: /netbsd-src/share/man/man3lua/netpgp.3lua (revision 188cf0e1a1f05f9666b50bff7ea00060c7a0c794)
1*188cf0e1Snia.\"     $NetBSD: netpgp.3lua,v 1.4 2023/03/01 21:07:21 nia Exp $
2823aeb53Ssevan.\"
3dd78489dSwiz.\" Copyright (c) 2018 The NetBSD Foundation, Inc.
4823aeb53Ssevan.\" All rights reserved.
5823aeb53Ssevan.\"
6823aeb53Ssevan.\" Redistribution and use in source and binary forms, with or without
7823aeb53Ssevan.\" modification, are permitted provided that the following conditions
8823aeb53Ssevan.\" are met:
9823aeb53Ssevan.\" 1. Redistributions of source code must retain the above copyright
10823aeb53Ssevan.\"    notice, this list of conditions and the following disclaimer.
11823aeb53Ssevan.\" 2. Redistributions in binary form must reproduce the above copyright
12823aeb53Ssevan.\"    notice, this list of conditions and the following disclaimer in the
13823aeb53Ssevan.\"    documentation and/or other materials provided with the distribution.
14823aeb53Ssevan.\"
15823aeb53Ssevan.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16823aeb53Ssevan.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17823aeb53Ssevan.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18823aeb53Ssevan.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19823aeb53Ssevan.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20823aeb53Ssevan.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21823aeb53Ssevan.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22823aeb53Ssevan.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23823aeb53Ssevan.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24823aeb53Ssevan.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25823aeb53Ssevan.\" POSSIBILITY OF SUCH DAMAGE.
26823aeb53Ssevan.\"
27823aeb53Ssevan.Dd April 30, 2018
28823aeb53Ssevan.Dt NETPGP 3lua
29823aeb53Ssevan.Os
30823aeb53Ssevan.Sh NAME
31823aeb53Ssevan.Nm netpgp
32823aeb53Ssevan.Nd provides access to
33823aeb53Ssevan.Xr libnetpgp 3
34823aeb53Ssevanfunctionality from Lua
35823aeb53Ssevan.Sh SYNOPSIS
36823aeb53Ssevan.Cd "local netpgp = require 'netpgp'"
37823aeb53Ssevan.Pp
38823aeb53Ssevan.Bl -tag -width XXXX -compact
39823aeb53Ssevan.It Dv instance = netpgp.new()
40823aeb53Ssevan.It Dv netpgp.homedir(instance, homedir)
41823aeb53Ssevan.It Dv netpgp.init(instance)
42823aeb53Ssevan.It Dv netpgp.encrypt_file(instance, file, output, armour)
43823aeb53Ssevan.It Dv netpgp.decrypt_file(instance, file, output, armour)
44823aeb53Ssevan.It Dv netpgp.sign_file(instance, file, output, armour, detached)
45823aeb53Ssevan.It Dv netpgp.clearsign_file(instance, file, output, armour, detached)
46823aeb53Ssevan.It Dv netpgp.verify_file(instance, file, armour)
47823aeb53Ssevan.It Dv netpgp.verify_cat_file(instance, file, output, armour)
48823aeb53Ssevan.It Dv netpgp.list_packets(instance, file, armour)
49823aeb53Ssevan.It Dv netpgp.setvar(instance, name, value)
50823aeb53Ssevan.It Dv netpgp.getvar(instance, name, value)
51823aeb53Ssevan.El
52823aeb53Ssevan.Sh DESCRIPTION
53823aeb53SsevanThe
54823aeb53Ssevan.Nm
556c259f39SrilligLua binding provides access to functionality available in
56823aeb53Ssevan.Xr libnetpgp 3 .
57823aeb53Ssevan.Sh EXAMPLES
58823aeb53SsevanThe following example code demonstrates the process of encrypting, decrypting,
59823aeb53Ssevansigning, and verifying a file, in a single script.
60823aeb53Ssevan.Bd -literal
61823aeb53Ssevanlocal netpgp = require 'netpgp'
62823aeb53Ssevanbtc = netpgp.new()
63823aeb53Ssevannetpgp.setvar(btc, "need seckey", 1)
64823aeb53Ssevannetpgp.init(btc)
65823aeb53Ssevan
66823aeb53Ssevannetpgp.encrypt_file(btc, "scratch", "scratch.gpg", "armoured")
67823aeb53Ssevannetpgp.decrypt_file(btc, "scratch.gpg", "itch", "armoured")
68823aeb53Ssevannetpgp.sign_file(btc, "scratch", "scratch.asc", "armoured", "detached")
69823aeb53Ssevannetpgp.verify_file(btc, "scratch.asc", "armoured")
70823aeb53Ssevan.Ed
71823aeb53Ssevan.Sh SEE ALSO
72823aeb53Ssevan.Xr lua 1 ,
73823aeb53Ssevan.Xr luac 1 ,
74823aeb53Ssevan.Xr libnetpgp 3 ,
75823aeb53Ssevan.Xr intro 3lua
76823aeb53Ssevan.Sh HISTORY
77823aeb53Ssevan.Nm
78823aeb53SsevanLua binding first appeared in
79823aeb53Ssevan.Nx 9.0 .
80823aeb53Ssevan.Sh AUTHORS
81823aeb53Ssevan.An -nosplit
82823aeb53SsevanThe
83823aeb53Ssevan.Nm
84823aeb53SsevanLua binding was written by
85823aeb53Ssevan.An Alistair Crooks .
86823aeb53Ssevan.Sh BUGS
87823aeb53SsevanThis binding currently only provides a subset of the functionality available in
88823aeb53Ssevan.Xr libnetpgp 3 .
89dd78489dSwizThis manual needs more description of the available functionality.
90