lotus

previous page: 4.2. Why does PGP take so long to add new keys to my key ring?
  
page up: PGP FAQ
  
next page: 4.4. I tried encrypting the same message to the same address two different times and got completely different outputs. Why is this? (PGP)

4.3. How can I extract multiple keys into a single armored file? (PGP)




Description

This article is from the PGP FAQ, by Jeff Licquia jalicqui@prairienet.org with numerous contributions by others.

4.3. How can I extract multiple keys into a single armored file? (PGP)

A number of people have more than one public key that they would like
to make available. One way of doing this is executing the "-kxa"
command for each key you wish to extract from the key ring into
separate armored files, then appending all the individual files into a
single long file with multiple armored blocks. This is not as
convenient as having all of your keys in a single armored block.

Unfortunately, the present version of PGP does not allow you to do
this directly. Fortunately, there is an indirect way to do it.

I would like to thank Robert Joop <rj@rainbow.in-berlin.de> for
supplying the following method which is simpler than the method that I
had previously given.

solution 1:

pgp -kxaf uid1 > extract
pgp -kxaf uid2 >> extract
pgp -kxaf uid3 >> extract

Someone who does a `pgp extract` processes the individual keys, one by
one. that's inconvinient.

solution 2:

pgp -kx uid1 extract
pgp -kx uid2 extract
pgp -kx uid3 extract

This puts all three keys into extract.pgp. To get an ascii amored
file, call:

pgp -a extract.pgp

You get an extract.asc. Someone who does a `pgp extract` and has
either file processes all three keys simultaneously.

A Unix script to perform the extraction with a single command would be
as follows:

  #!/bin/csh
  foreach name (name1 name2 name3 ...)
  pgp -kx $name /tmp/keys.pgp <keyring>
  end
  
or:
  
  #!/bin/sh
  for name in name1 name2 name3 ... ; do
  pgp -kx $name /tmp/keys.pgp <keyring>
  end

An equivalent DOS command would be:

for %a in (name1 name2 name3 ...) do pgp -kx %a keys.pgp <keyring>

 

Continue to:













TOP
previous page: 4.2. Why does PGP take so long to add new keys to my key ring?
  
page up: PGP FAQ
  
next page: 4.4. I tried encrypting the same message to the same address two different times and got completely different outputs. Why is this? (PGP)