2006-09-08 19:02:06 +02:00
|
|
|
@c Include file to allow for different placements in man pages and the manual
|
|
|
|
|
|
|
|
There are different ways to specify a user ID to GnuPG. Some of them
|
|
|
|
are only valid for @command{gpg} others are only good for
|
|
|
|
@command{gpgsm}. Here is the entire list of ways to specify a key:
|
|
|
|
|
|
|
|
@itemize @bullet
|
|
|
|
|
2012-01-06 13:33:10 +01:00
|
|
|
@item By key Id.
|
2006-09-08 19:02:06 +02:00
|
|
|
This format is deduced from the length of the string and its content or
|
|
|
|
@code{0x} prefix. The key Id of an X.509 certificate are the low 64 bits
|
|
|
|
of its SHA-1 fingerprint. The use of key Ids is just a shortcut, for
|
|
|
|
all automated processing the fingerprint should be used.
|
|
|
|
|
2007-01-18 19:52:24 +01:00
|
|
|
When using @command{gpg} an exclamation mark (!) may be appended to
|
|
|
|
force using the specified primary or secondary key and not to try and
|
2006-09-08 19:02:06 +02:00
|
|
|
calculate which primary or secondary key to use.
|
|
|
|
|
|
|
|
The last four lines of the example give the key ID in their long form as
|
|
|
|
internally used by the OpenPGP protocol. You can see the long key ID
|
|
|
|
using the option @option{--with-colons}.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
234567C4
|
|
|
|
0F34E556E
|
|
|
|
01347A56A
|
|
|
|
0xAB123456
|
|
|
|
|
|
|
|
234AABBCC34567C4
|
|
|
|
0F323456784E56EAB
|
|
|
|
01AB3FED1347A5612
|
|
|
|
0x234AABBCC34567C4
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@item By fingerprint.
|
|
|
|
This format is deduced from the length of the string and its content or
|
|
|
|
the @code{0x} prefix. Note, that only the 20 byte version fingerprint
|
2023-10-05 07:00:46 +02:00
|
|
|
is available with @command{gpgsm} (i.e., the SHA-1 hash of the
|
2006-09-08 19:02:06 +02:00
|
|
|
certificate).
|
|
|
|
|
2007-01-18 19:52:24 +01:00
|
|
|
When using @command{gpg} an exclamation mark (!) may be appended to
|
|
|
|
force using the specified primary or secondary key and not to try and
|
2006-09-08 19:02:06 +02:00
|
|
|
calculate which primary or secondary key to use.
|
|
|
|
|
|
|
|
The best way to specify a key Id is by using the fingerprint. This
|
|
|
|
avoids any ambiguities in case that there are duplicated key IDs.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
1234343434343434C434343434343434
|
|
|
|
123434343434343C3434343434343734349A3434
|
|
|
|
0E12343434343434343434EAB3484343434343434
|
|
|
|
0xE12343434343434343434EAB3484343434343434
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
@noindent
|
2012-01-06 13:33:10 +01:00
|
|
|
@command{gpgsm} also accepts colons between each pair of hexadecimal
|
2006-09-08 19:02:06 +02:00
|
|
|
digits because this is the de-facto standard on how to present X.509
|
2012-01-06 13:33:10 +01:00
|
|
|
fingerprints. @command{gpg} also allows the use of the space
|
|
|
|
separated SHA-1 fingerprint as printed by the key listing commands.
|
2006-09-08 19:02:06 +02:00
|
|
|
|
|
|
|
@item By exact match on OpenPGP user ID.
|
|
|
|
This is denoted by a leading equal sign. It does not make sense for
|
|
|
|
X.509 certificates.
|
|
|
|
|
|
|
|
@cartouche
|
2012-01-06 13:33:10 +01:00
|
|
|
@example
|
2006-09-08 19:02:06 +02:00
|
|
|
=Heinrich Heine <heinrichh@@uni-duesseldorf.de>
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
@item By exact match on an email address.
|
|
|
|
This is indicated by enclosing the email address in the usual way
|
|
|
|
with left and right angles.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
<heinrichh@@uni-duesseldorf.de>
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
|
2014-11-07 18:42:37 +01:00
|
|
|
@item By partial match on an email address.
|
|
|
|
This is indicated by prefixing the search string with an @code{@@}.
|
|
|
|
This uses a substring search but considers only the mail address
|
2023-10-05 07:00:46 +02:00
|
|
|
(i.e., inside the angle brackets).
|
2006-09-08 19:02:06 +02:00
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
2014-11-07 18:42:37 +01:00
|
|
|
@@heinrichh
|
2006-09-08 19:02:06 +02:00
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
@item By exact match on the subject's DN.
|
|
|
|
This is indicated by a leading slash, directly followed by the RFC-2253
|
|
|
|
encoded DN of the subject. Note that you can't use the string printed
|
2016-03-04 17:38:09 +01:00
|
|
|
by @code{gpgsm --list-keys} because that one has been reordered and modified
|
|
|
|
for better readability; use @option{--with-colons} to print the raw
|
2016-03-04 17:13:14 +01:00
|
|
|
(but standard escaped) RFC-2253 string.
|
2006-09-08 19:02:06 +02:00
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
/CN=Heinrich Heine,O=Poets,L=Paris,C=FR
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
@item By exact match on the issuer's DN.
|
|
|
|
This is indicated by a leading hash mark, directly followed by a slash
|
2016-03-04 17:34:23 +01:00
|
|
|
and then directly followed by the RFC-2253 encoded DN of the issuer.
|
2006-09-08 19:02:06 +02:00
|
|
|
This should return the Root cert of the issuer. See note above.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
#/CN=Root Cert,O=Poets,L=Paris,C=FR
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
|
|
|
|
|
|
|
@item By exact match on serial number and issuer's DN.
|
2007-12-13 16:45:40 +01:00
|
|
|
This is indicated by a hash mark, followed by the hexadecimal
|
2007-08-10 18:52:05 +02:00
|
|
|
representation of the serial number, then followed by a slash and the
|
2006-09-08 19:02:06 +02:00
|
|
|
RFC-2253 encoded DN of the issuer. See note above.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
#4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
2016-03-04 17:13:14 +01:00
|
|
|
@item By keygrip.
|
2006-10-20 13:38:48 +02:00
|
|
|
This is indicated by an ampersand followed by the 40 hex digits of a
|
|
|
|
keygrip. @command{gpgsm} prints the keygrip when using the command
|
2019-01-29 19:52:08 +01:00
|
|
|
@option{--dump-cert}.
|
2006-10-20 13:38:48 +02:00
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
&D75F22C3F86E355877348498CDC92BD21010A480
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
2006-09-08 19:02:06 +02:00
|
|
|
|
|
|
|
@item By substring match.
|
|
|
|
This is the default mode but applications may want to explicitly
|
|
|
|
indicate this by putting the asterisk in front. Match is not case
|
|
|
|
sensitive.
|
|
|
|
|
|
|
|
@cartouche
|
|
|
|
@example
|
|
|
|
Heine
|
|
|
|
*Heine
|
|
|
|
@end example
|
|
|
|
@end cartouche
|
|
|
|
|
2014-11-07 18:42:37 +01:00
|
|
|
@item . and + prefixes
|
|
|
|
These prefixes are reserved for looking up mails anchored at the end
|
|
|
|
and for a word search mode. They are not yet implemented and using
|
|
|
|
them is undefined.
|
2006-09-08 19:02:06 +02:00
|
|
|
|
2014-11-07 18:42:37 +01:00
|
|
|
@end itemize
|
2006-09-08 19:02:06 +02:00
|
|
|
|
|
|
|
Please note that we have reused the hash mark identifier which was used
|
|
|
|
in old GnuPG versions to indicate the so called local-id. It is not
|
|
|
|
anymore used and there should be no conflict when used with X.509 stuff.
|
|
|
|
|
|
|
|
Using the RFC-2253 format of DNs has the drawback that it is not
|
|
|
|
possible to map them back to the original encoding, however we don't
|
|
|
|
have to do this because our key database stores this encoding as meta
|
|
|
|
data.
|