Sync usage with man page.
[netbsd-mini2440.git] / crypto / external / bsd / netpgp / dist / bindings / perl / netpgp.pl
blob849e9e9401d26582e0a92a8308f3f3ed2705c3bd
1 #! /usr/pkg/bin/perl -w
3 # netpgp bindings for perl
5 use lib "/usr/src/crypto/external/bsd/netpgp/dist/bindings/perl";
7 use netpgpperl;
9 # initializations
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) {
19 # set up file names
20 my $in = $ARGV[$i];
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);