Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / apps / gdp-create.8 @ master

History | View | Annotate | Download (9.31 KB)

1
.Dd August 2, 2015
2
.Dt GDP-CREATE 8
3
.Os Swarm-GDP
4
.Sh NAME
5
.Nm gdp-create
6
.Nd create new GDP log
7
.Sh SYNOPSIS
8
.Nm gdp-create
9
.Op Fl C Ar creator-name
10
.Op Fl D Ar debug-spec
11
.Op Fl e Ar key-crypto
12
.Op Fl G Ar router-ip
13
.Op Fl h Ar hash-alg
14
.Op Fl k Ar key-type
15
.Op Fl K Ar owner-key-location
16
.Op Fl b Ar key-bits
17
.Op Fl c Ar curve-name
18
.Op Fl q
19
.Op Fl s Ar logd-gdp-addr
20
.Op Fl S
21
.Op Fl w
22
.Op Fl W Ar writer-key-location
23
.Op Ar mdid=metadata ...
24
.Op Ar external-name
25
.Sh DESCRIPTION
26
.Nm gdp-create
27
creates a new GDP object,
28
a.k.a.
29
.Ql "Data Capsule"
30
(sometimes called a
31
.Ql "log"
32
mostly for historic reasons)
33
on a given log server.
34
In its default mode it also creates a public/secret
35
.Ql "owner"
36
keypair associated with this object,
37
with the public key stored in the object metadata.
38
Additional (text-based) metadata can be added
39
(arguably this should allow binary metadata as well).
40
Optionally the log can be given a human-understandable name;
41
if not specified a seemingly random name is made up.
42
.
43
.Pp
44
The human-oriented name has certain requirements:
45
.Bl -bullet
46
.
47
.It
48
It may not look like the base64-encoded internal name of any log.
49
.
50
.It
51
It may not already be listed in the Human-Oriented to GDPname Directory (HONGD).
52
.
53
.It
54
It may not have an equal sign in it.
55
.El
56
.
57
.Pp
58
Also, if the human-oriented name has no dots but the
59
.Ev GDP_NAME_ROOT
60
environment variable is set,
61
the two will be appended in the same way as described in
62
.Xr gdp 7 .
63
.
64
.Ss "Metadata"
65
User-specified metadata may be added when a log is created.
66
The metadata name is stored as a 32-bit number and is generally represented
67
by four characters.
68
.Pp
69
In addition to user metadata,
70
.Nm gdp-create
71
adds metadata for the log creation time,
72
the public half of the signing key in DER format,
73
and the human-readable name.
74
.Pp
75
Metadata is immutable; there is no way to add, delete, or change metadata
76
after the log is created.
77
.
78
.Ss "Key Management"
79
GDP objects may have two secret keys associated with them:
80
the
81
.Ql owner
82
key allows administrative control over the object and the
83
.Ql writer
84
key allows write access to the object.
85
If the writer key is not specifies it defaults to the same as the owner key.
86
.
87
.Ss "Warning"
88
This implementation will change in the future,
89
and the command will probably be subsumed into a swarm service.
90
.Sh OPTIONS
91
.Bl -tag
92
.
93
.It Fl C
94
Sets the name of the creator in the log metadata.
95
If this is not specified it will be derived from system data.
96
It should be in the form of an email address.
97
.
98
.It Fl D Ar debug-spec
99
Turns on debugging flags using the libep-style format.
100
Useful only with the code in hand.
101
.
102
.It Fl e Ar key-crypto
103
Specifies symmetric encryption algorithm to use for storing the secret key.
104
If
105
.Ar key-crypto
106
is
107
.Li none
108
then the key is stored unencrypted on disk.
109
Defaults to
110
.Va swarm.gdp.crypto.keyenc.alg .
111
.
112
.It Fl G Ar router-ip
113
Contact the given IP address (which may be a DNS name)
114
to get a connection to the GDP routing layer.
115
This will be replaced by automatic discovery
116
(for example, using Zeroconf)
117
soon.
118
The address may have an optional port number after a colon.
119
If this is not specified,
120
the names listed in the
121
.Va swarm.gdp.routers
122
runtime administrative parameter
123
are searched.
124
.
125
.It Fl h Ar hash-alg
126
Selects the hash (message digest) algorithm used when
127
generating and checking signatures.
128
When data is appended to the log,
129
the log name, log metadata, record number, and record data
130
is hashed using this algorithm and then that hash is signed.
131
.
132
.It Fl k Ar key-type
133
Selects the type of the creator key to be created for this log.
134
It can be one of
135
.Li rsa ,
136
.Li dsa ,
137
or
138
.Li ec .
139
As a special case, the type
140
.Li none
141
suppresses creation of the keypair.
142
The creator key has both administrative and write access to the log.
143
.
144
.It Fl K Ar owner-key-location
145
This option has two purposes.
146
First, if you want to use an existing keypair
147
(formatted as a PEM file)
148
as the owner key
149
you can use the
150
.Fl K
151
flag to name an existing PEM file.
152
If you want
153
.Nm
154
to create a keypair for you,
155
.Fl K
156
can name a directory into which the secret key will be written;
157
the file will be named with the internal name of the log with
158
.Va \&-owner.pem
159
appended.
160
If
161
.Fl K
162
is not specified, the value of the
163
.Va swarm.gdp.crypto.key.dir
164
administrative parameter will be used;
165
it defaults to
166
.Pa ./KEYS ,
167
or to the current directory if the
168
.Pa KEYS
169
directory does not exist.
170
.
171
.It Fl b Ar key-bits
172
If the key type is RSA or DSA,
173
this parameter specifies the number of bits in the key.
174
If this is omitted and the key type is RSA,
175
this defaults to the value of
176
.Va swarm.gdp.crypto.rsa.keylen .
177
DSA keys use
178
.Va swarm.gdp.crypto.dsa.keylen .
179
Additionally, RSA keys use the
180
.Va swarm.gdp.crypto.rsa.keyexp
181
parameter to set the exponent.
182
This parameter is ignored when creating EC key pairs.
183
.
184
.It Fl c Ar curve-name
185
Sets the name of the curve to use for Elliptic Cryptography keys.
186
This overrides the
187
.Va swarm.gdp.crypto.ec.curve
188
parameter.
189
Ignored when creating RSA or DSA key pairs.
190
.
191
.It Fl q
192
If set,
193
.Nm
194
does not show errors or informational message.
195
In particular, using
196
.Fl q
197
is a way to ensure that a log exists without give an error if it already exists.
198
.
199
.It Fl s Ar logd-gdp-addr
200
The name of the log daemon on which to create the physical instantiation
201
of the log.
202
If not specified, the value of the
203
.Va swarm.gdp.creation-service.name
204
administrative will be used.
205
If that is not set,
206
it will default to one of the servers at Berkeley.
207
If you want a specific server at your site,
208
either use the
209
.Fl s
210
flag or set that administrative parameter.
211
.
212
.It Fl S
213
Skips the test to see if the log already exists before creating it.
214
Used for debugging.
215
.It Fl w
216
Create a separate writer key.
217
The writer key does not convey administrative access to the log.
218
The owner key conveys write access to the log even if a separate
219
writer key is created.
220
.
221
.It Fl W Ar writer-key-location
222
Similar to
223
.Fl K ,
224
but for the writer key.
225
.El
226
.Sh EXIT STATUS
227
.Bl -tag
228
.It Li EX_OK No (0)
229
Success
230
.It Li EX_CANTCREAT No (73)
231
The log already exists.
232
.It Li EX_DATAERR No (65)
233
A command-line key file could not be parsed.
234
.It Li EX_IOERR No (74)
235
A secret key file could not be created.
236
.It Li EX_NOHOST No (68)
237
The log server name was not valid.
238
.It Li EX_NOINPUT No (67)
239
A command-line key file could not be opened.
240
.It Li EX_SOFTWARE No (70)
241
A successfully created public key could not be converted to external (DER) form
242
for storage in new log metadata,
243
or severe internal error.
244
.It Li EX_USAGE No (64)
245
Command line parameters are incorrect.
246
.It Li EX_UNAVAILABLE No (69)
247
A specified key length was insecure.
248
It was impossible to create a new key.
249
Other unspecified error.
250
.El
251
.Sh ADMINISTRATIVE PARAMETERS
252
.Bl -tag
253
.It swarm.gdp.crypto.dsa.keylen
254
The DSA key length.
255
Defaults to 2048.
256
Overridden by
257
.Fl b .
258
.It swarm.gdp.crypto.ec.curve
259
The EC curve.
260
Defaults to
261
.Li sect283r1
262
(also known as
263
.Li B-283 ) .
264
Overridden by
265
.Fl c .
266
.It swarm.gdp.crypto.hash.alg
267
The hash algorithm.
268
Defaults to
269
.Li sha256 .
270
Overridden by
271
.Fl h .
272
.It swarm.gdp.crypto.key.dir
273
The directory in which to store secret keys.
274
Defaults to
275
.Pa KEYS
276
(in the current working directory).
277
If that subdirectory does not exist,
278
the keys are written to the current directory.
279
Overridden by
280
.Fl K .
281
.It swarm.gdp.crypto.keyenc.alg
282
The secret key (symmetric) encryption algorithm.
283
Defaults to
284
.Li aes192 .
285
Overridden by
286
.Fl e .
287
.It swarm.gdp.crypto.rsa.keyexp
288
The exponent to be used in the RSA algorithm.
289
Defaults to 3.
290
.It swarm.gdp.crypto.rsa.keylen
291
The key length for the RSA algorithm.
292
Defaults to 2048.
293
Overridden by
294
.Fl b .
295
.It swarm.gdp.crypto.sign.alg
296
The signing algorithm.
297
Defaults to
298
.Li ec .
299
Overridden by
300
.Fl k .
301
.
302
.It swarm.gdp.creation-service.name
303
The GDPname of the creation service.
304
Overridden by
305
.Fl s .
306
.El
307
.Sh ENVIRONMENT
308
.Bl -tag
309
.
310
.It GDP_NAME_ROOT
311
If set, this is prepended to any human-oriented names
312
that do not already have dots in them.
313
This is an easy way to make your log names unique.
314
See
315
.Xr gdp 7
316
for details.
317
.\".Sh FILES
318
.Sh SEE ALSO
319
.Xr gdp 7 ,
320
.Xr gdplogd 8
321
.Sh EXAMPLES
322
.Bl -bullet
323
.It
324
To create a GDP log on a default server:
325
.Dl newlog=edu.berkeley.cs.eric.example
326
.Dl gdp-create $newlog
327
The secret key will be written into a a file named
328
.Pa KEYS/<something>.pem ,
329
where
330
.Va <something>
331
is the base-64-encoded internal name of the log, e.g.,
332
.Li 1KZy5jy1QpghTe8QBmDQGqdz3a_9tVP3qp6uxlOeJdk.pem .
333
The password for encrypting this key will be read from the standard input.
334
.It
335
To create a GDP log named
336
.Li $newlog
337
on log server named edu.berkeley.eecs.gdp-01 using defaults:
338
.Dl logd=edu.berkeley.eecs.gdp-01.gdplogd
339
.Dl gdp-create -s $logd $newlog
340
.It
341
To create a log on the server named
342
.Li $logd
343
encrypted with a 1024-bit RSA key,
344
leaving the unencrypted key in a file named
345
.Pa mykey.pem :
346
.Dl gdp-create -k RSA -b 1024 -e none -K mykey.pem $newlog
347
.It
348
To create a log with user-specified metadata:
349
.Dl gdp-create Qo "MYMD=My special metadata" Qc $newlog
350
.It
351
To create a log without a human-friendly name using sha-224
352
as the hash (message digest) algorithm:
353
.Dl gdp-create -h sha224
354
.Nm gdp-create
355
will print the base-64-encoded name of the new log.
356
You should be careful to record that,
357
since it is your only way to access the log.
358
.El
359
.
360
.Sh BUGS
361
There should be some way to provide the key password
362
other than reading it from the standard input.
363
.Pp
364
It should not be necessary to name the server on which the log will be created.
365
This command will be replaced by a smart service
366
that chooses placement based on locality and capacity.