#!/bin/bash # create a PGP50 keyring and a PGP 2.6.x keyring. # Only keys of the participating users are included. # The list of participating KeyID's has to be in the file filterkeys. # sig50 is a keyring of PGP 5.x # signed.pgp is a keyring of PGP 2.6.x # the filtered keyrings are sig50_filtered (PGP 5.0) and # signed_filtered.pgp (PGP 2.6.x) # ----- Add all keys in signed.pgp to sig50 pgpk -K sig50 -a signed.pgp # ----- Extract the keys from the Keyring sig50 and include it # to signed.pgp rm bla50t for i in `cat filterkeys`; do echo ----- exporting and importing key 0x$i ; pgpk -xa 0x$i -K sig50 >bla50t ; pgp -ka bla50t signed.pgp ; done # ----- filter all keys from sig50 to sig50_filtered rm bla50 for i in `cat filterkeys`; do echo $i; pgpk -xa 0x$i -K sig50 >>bla50 ; done pgpk -a bla50 -K sig50_filtered pgpk -c sig50_filtered # ----- filter all keys from signed.pgp to signed_filtered.pgp rm bla for i in `cat filterkeys`; do pgp -kxaf 0x$i signed.pgp >>bla ; done pgp +batchmode -ka bla signed_filtered.pgp # important to remove PGP 5.x signatures from the keyring: pgp +batchmode -kc signed_filtered.pgp