aboutsummaryrefslogtreecommitdiff
path: root/gpg-keysend
blob: 3397a6114117c053be4e4cf74e842a25ed415bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#
# Import an OpenPGP pubkey from the current user's keyring to a
# keyring from remote user's keyring via SSH.
#

# Parameters
BASENAME="`basename $0`"
KEY="$1"
REMOTE="$2"

# Usage
if [ -z "$REMOTE" ]; then
  echo "usage: $BASENAME <key> <remote>"
fi

# Export and import remotely
gpg --armor --export $KEY | ssh $REMOTE gpg --import