1 .\" $NetBSD: netpgpkeys.1,v 1.3 2009/12/05 07:35:30 agc Exp $
3 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This manual page is derived from software contributed to
7 .\" The NetBSD Foundation by Alistair Crooks (agc@NetBSD.org).
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd PGP key management utility
60 where the options for all commands are:
64 .Op Fl Fl homedir Ns = Ns Ar home-directory
66 .Op Fl Fl keyring Ns = Ns Ar keyring
70 .Op Fl Fl userid Ns = Ns Ar userid
74 At the present time, the
76 utility is still under development.
77 Whilst the signing and verification, encryption and
80 are considered mature,
83 Other key management utilities should be used in preference
88 command is used for all forms of PGP key management,
89 from generation of new keys to propagation of public
90 keys to key servers, and import of new public
91 keys from other identities.
95 utility should be used for file management and transformation - encryption,
97 signing and verification of files.
99 For signing and encryption, a unique identity is needed.
100 This identity is made up of a private and public key.
101 The public key part is made available and known to everyone.
102 The private key is kept secret, and known only to the user
103 who created the identity.
104 The secret key is protected with a passphrase.
106 In rough terms, a digital signature
107 is a digest of a file's contents,
108 encrypted with the user's private key.
109 Since together, the private and public keys identify the user
110 uniquely, the signature can be used to identify the exact version
111 of the file, and any changes made to the file will mean that the
112 signature no longer matches.
114 As a corollary, the file can be transformed using a user's public key,
115 into text such that the contents can only be viewed by someone
116 with the corresponding private key.
117 This is called encryption.
121 utility can be used to generate a new key-pair for a user.
123 this key is in two parts, the public key (which is known
124 by other people) and the private key.
128 is to maintain keyrings.
129 Key and keyring management commands available are:
132 .Fl Fl generate-key ,
136 Keyrings are collections of public keys belonging to other users.
137 By using other means of identification, it is possible to establish
138 the bona fides of other users.
139 Once trust has been established, the public key of the other
141 The other user's public key can be added to our keyring.
142 The other user will add our public key to their keyring.
144 Keys can be listed, exported (i.e. made available to others),
145 and imported (i.e. users who have signed our public key).
147 Key and keyring management can be done with the
151 Display the current public key in a format suitable for export.
152 This can be used to place the keyring on one of the
153 public key servers, for example.
155 Find the appropriate public key from the current keyring.
156 If no keyring is provided, the user's public keyring is used.
157 .It Fl Fl generate-key
158 This command is used to generate a new public and private key pair.
159 The user id is taken from the command line, and the user will be
160 prompted to provide a suitable pass phrase.
162 Import a public key as retrieved from one of the public key servers.
163 This is in the form of a file which has previously been
164 retrieved from elsewhere.
166 List all the public keys in the current keyring.
167 If no keyring is provided, the user's public keyring is used.
169 Print the version information from the
174 In addition to one of the preceding commands, a number of qualifiers
175 or options may be given.
177 .It Fl Fl homedir Ar home-directory
178 Keyrings are normally located, for historical reasons, within
179 the user's home directory in a subdirectory called
181 and this option specifies an alternative location in which to
182 find that sub-directory.
183 .It Fl Fl keyring Ar keyring
184 This option specifies an alternative keyring to be used.
185 All keyring operations will be relative to this alternative keyring.
186 .It Fl Fl numbits Ar numbits
187 specifies the number of bits to be used when generating a key.
188 The default number of bits is 2048.
189 This is considered the absolute
190 minimum which should be chosen at the time of writing (2009).
191 Due to advances in computing power every year, this number should
192 be reviewed, and increased when it becomes easier to factor 2048
194 .It Fl Fl userid Ar userid
195 This option specifies the user identity to be used for all operations.
196 This identity can either be in the form of the full name, or as an
198 Care should be exercised with these ways of specifying the user identity,
201 utility has no way of verifying that an email address is valid, or
202 that a key belongs to a certain individual.
203 The trust for a signed key is given by the other signers of that key.
204 The 16 hexadecimal digit user identity should be used when specifying
205 user identities - email addresses and names are provided as aliases.
206 .It Fl Fl pass-fd Ns = Ns Ar fd
207 This option is intended for the use of external programs which may
212 interface, but have their own ways of retrieving and caching
213 the passphrase for the secret key.
216 utility will read a line of text from the file descriptor
217 passed to it in the command line argument, rather than
218 using its own methods of retrieving the passphrase from
221 This option can be used to view information during
226 specifies that the public and private keys should be taken
229 host key files, usually found in
230 .Pa /etc/ssh/ssh_host_rsa_key
232 .Pa /etc/ssh/ssh_host_rsa_key.pub
233 for the private and public host keys.
235 in normal processing,
236 if an error occurs, the contents of memory are saved to disk, and can
237 be read using tools to analyse behaviour.
238 Unfortunately this can disclose information to people viewing
239 the core dump, such as secret keys, and passphrases protecting
243 will turn off the ability to save core dumps on persistent storage,
244 but selecting this option will allow core dumps to be written to disk.
245 This option should be used wisely, and any core dumps should
246 be deleted in a secure manner when no longer needed.
249 The pass phrase cannot be changed by
251 once it has been chosen, and will
252 be used for the life of the key, so a wise choice is advised.
253 The pass phrase should not be an easily guessable word or phrase,
254 or related to information that can be gained through
255 .Dq social engineering
256 using search engines, or other public information retrieval methods.
259 will be used to obtain the pass phrase from the user if it is
261 such as during signing or encryption, or key generation,
262 so that any secret information cannot be viewed by other users
267 commands, or by looking over the shoulder at the screen.
269 Since the public and private key pair can be used to verify
270 a person's identity, and since identity theft can have
271 far-reaching consequences, users are strongly encouraged to
272 enter their pass phrases only when prompted by the application.
276 utility will return 0 for success,
277 1 if the file's signature does not match what was expected,
278 or 2 if any other error occurs.
290 utility is designed to conform to IETF RFC 4880.
294 command first appeared in
300 and overhauled and rewritten by
301 .An Alistair Crooks Aq agc@NetBSD.org .
302 This manual page was also written by
303 .An Alistair Crooks .