3 # gpg-archive - gpg-ized tar using the same format as PGP's PGP Zip.
4 # Copyright (C) 2005 Free Software Foundation, Inc.
6 # This file is part of GnuPG.
8 # GnuPG is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # GnuPG is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 # Despite the name, PGP Zip format is actually an OpenPGP-wrapped tar
23 # file. To be compatible with PGP itself, this must be a USTAR format
24 # tar file. Unclear on whether there is a distinction here between
25 # the GNU or POSIX variant of USTAR.
32 Usage: gpg-zip [--help] [--version] [--encrypt] [--decrypt] [--symmetric]
33 [--list-archive] [--output FILE] [--gpg GPG] [--gpg-args ARGS]
34 [--tar TAR] [--tar-args ARGS] filename1 [filename2, ...]
35 directory1 [directory2, ...]
37 Encrypt or sign files into an archive."
39 while test $# -gt 0 ; do
52 gpg_args
="$gpg_args --encrypt"
59 gpg_args
="$gpg_args --decrypt"
66 gpg_args
="$gpg_args --symmetric"
73 gpg_args
="$gpg_args --sign"
80 gpg_args
="$gpg_args --recipient $2"
85 gpg_args
="$gpg_args --local-user $2"
90 gpg_args
="$gpg_args --output $2"
95 echo "gpg-zip (GnuPG) $VERSION"
103 gpg_args
="$gpg_args $2"
112 tar_args
="$tar_args $2"
130 if test x
$create = xyes
; then
131 # echo "$TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args" 1>&2
132 $TAR -cf - "$@" |
$GPG --set-filename x.
tar $gpg_args
133 elif test x
$list = xyes
; then
134 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -tf -" 1>&2
135 cat "$1" |
$GPG $gpg_args |
$TAR $tar_args -tf -
136 elif test x
$unpack = xyes
; then
137 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -xvf -" 1>&2
138 cat "$1" |
$GPG $gpg_args |
$TAR $tar_args -xvf -