1 #! /usr/pkg/bin/perl -w
3 # netpgp bindings for perl
5 use lib
"/usr/src/crypto/external/bsd/netpgp/dist/bindings/perl";
10 $n = netpgpperlc
::new_netpgp_t
();
11 netpgpperlc
::netpgp_setvar
($n, "homedir", $ENV{'HOME'}."/.gnupg");
12 netpgpperlc
::netpgp_setvar
($n, "hash", "SHA256");
13 netpgpperlc
::netpgp_init
($n);
15 # get the default userid
16 $userid = netpgpperlc
::netpgp_getvar
($n, "userid");
18 foreach $i (0 .. $#ARGV) {
21 my $out = $in . ".gpg";
23 # sign the file, output is in $out
24 netpgpperlc
::netpgp_sign_file
($n, $userid, $in, $out, 0, 0, 0);
26 # verify the signed file $out
27 netpgpperlc
::netpgp_verify_file
($n, $out, "/dev/null", 0);