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 3 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, see <http://www.gnu.org/licenses/>.
20 # Despite the name, PGP Zip format is actually an OpenPGP-wrapped tar
21 # file. To be compatible with PGP itself, this must be a USTAR format
22 # tar file. Unclear on whether there is a distinction here between
23 # the GNU or POSIX variant of USTAR.
30 Usage: gpg-zip [--help] [--version] [--encrypt] [--decrypt] [--symmetric]
31 [--list-archive] [--output FILE] [--gpg GPG] [--gpg-args ARGS]
32 [--tar TAR] [--tar-args ARGS] filename1 [filename2, ...]
33 directory1 [directory2, ...]
35 Encrypt or sign files into an archive."
37 while test $# -gt 0 ; do
50 gpg_args
="$gpg_args --encrypt"
57 gpg_args
="$gpg_args --decrypt"
64 gpg_args
="$gpg_args --symmetric"
71 gpg_args
="$gpg_args --sign"
78 gpg_args
="$gpg_args --recipient $2"
83 gpg_args
="$gpg_args --local-user $2"
88 gpg_args
="$gpg_args --output $2"
93 echo "gpg-zip (GnuPG) $VERSION"
101 gpg_args
="$gpg_args $2"
110 tar_args
="$tar_args $2"
128 if test x
$create = xyes
; then
129 # echo "$TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args" 1>&2
130 $TAR -cf - "$@" |
$GPG --set-filename x.
tar $gpg_args
131 elif test x
$list = xyes
; then
132 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -tf -" 1>&2
133 cat "$1" |
$GPG $gpg_args |
$TAR $tar_args -tf -
134 elif test x
$unpack = xyes
; then
135 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -xvf -" 1>&2
136 cat "$1" |
$GPG $gpg_args |
$TAR $tar_args -xvf -