summaryrefslogtreecommitdiffstats
path: root/debian/tests/simple-tests
blob: 97d4ab4510bda024fe160d9ee3a73df6e250ff49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

set -e
set -x

DIR=$(mktemp -d)
GPG_HOME=$DIR/gnupg
gpg="gpg --homedir $GPG_HOME"

mkdir $GPG_HOME
chmod 700 $GPG_HOME

#trap "cd $HOME && rm -rf $DIR" EXIT

cd $DIR

cat > key-batch << EOF
Key-Type: default
Subkey-Type: default
Name-Real: test case
Name-Email: example@example.com
Expire-Date: 0
%no-protection
%commit
EOF

$gpg --batch --generate-key key-batch
$gpg -abs < $GPG_HOME/pubring.kbx > pubring.kbx.asc
$gpg --verify pubring.kbx.asc $GPG_HOME/pubring.kbx
gpgv --keyring $GPG_HOME/pubring.kbx pubring.kbx.asc $GPG_HOME/pubring.kbx

# Encrypt
$gpg -e -r example@example.com < $GPG_HOME/pubring.kbx > pubring.kbx.gpg
$gpg -d -r example@example.com < pubring.kbx.gpg > pubring.kbx.gpg.dec