summaryrefslogtreecommitdiff
path: root/src/p11tool-options.json
blob: 22be3edde0ad992b468a5aa0f01f801c12964749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
[
  {
    "meta": {
      "explain": "",
      "short-usage": "p11tool [options] [url]\np11tool --help for usage instructions.\n",
      "desc": "",
      "prog-name": "p11tool",
      "prog-desc": "Program to handle PKCS #11 smart cards and security modules.\n",
      "detail": "Program that allows operations on PKCS #11 smart cards\nand security modules. \n\nTo use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to be setup.\nThat is create a .module file in /etc/pkcs11/modules with the contents 'module: /path/to/pkcs11.so'.\nAlternatively the configuration file /etc/gnutls/pkcs11.conf has to exist and contain a number\nof lines of the form 'load=/usr/lib/opensc-pkcs11.so'.\n\nYou can provide the PIN to be used for the PKCS #11 operations with the environment variables\nGNUTLS_PIN and GNUTLS_SO_PIN.\n",
      "reorder-args": "",
      "argument": "[url]",
      "prog-title": "GnuTLS PKCS #11 tool"
    },
    "options": []
  },
  {
    "meta": {
      "desc": "Tokens",
      "id": "token-related-options"
    },
    "options": [
      {
        "long-option": "list-tokens",
        "detail": "",
        "desc": "List all available tokens"
      },
      {
        "desc": "List the URLs available tokens",
        "detail": "This is a more compact version of --list-tokens.",
        "long-option": "list-token-urls"
      },
      {
        "detail": "",
        "desc": "List all available mechanisms in a token",
        "long-option": "list-mechanisms"
      },
      {
        "long-option": "initialize",
        "desc": "Initializes a PKCS #11 token",
        "detail": ""
      },
      {
        "desc": "Initializes/Resets a PKCS #11 token user PIN",
        "detail": "",
        "long-option": "initialize-pin"
      },
      {
        "long-option": "initialize-so-pin",
        "detail": "This initializes the security officer's PIN. When used non-interactively use the GNUTLS_NEW_SO_PIN\nenvironment variables to initialize SO's PIN.",
        "desc": "Initializes/Resets a PKCS #11 token security officer PIN."
      },
      {
        "arg-type": "string",
        "detail": "Alternatively the GNUTLS_PIN environment variable may be used.",
        "desc": "Specify the PIN to use on token operations",
        "long-option": "set-pin"
      },
      {
        "desc": "Specify the Security Officer's PIN to use on token initialization",
        "detail": "Alternatively the GNUTLS_SO_PIN environment variable may be used.",
        "long-option": "set-so-pin",
        "arg-type": "string"
      }
    ]
  },
  {
    "meta": {
      "desc": "Object listing",
      "id": "object-list-related-options"
    },
    "options": [
      {
        "long-option": "list-all",
        "detail": "All objects available in the token will be listed. That includes\nobjects which are potentially unaccessible using this tool.",
        "desc": "List all available objects in a token"
      },
      {
        "detail": "That option will also provide more information on the\ncertificates, for example, expand the attached extensions in a trust\ntoken (like p11-kit-trust).",
        "desc": "List all available certificates in a token",
        "long-option": "list-all-certs"
      },
      {
        "detail": "That option will only display certificates which have a private\nkey associated with them (share the same ID).",
        "long-option": "list-certs",
        "desc": "List all certificates that have an associated private key"
      },
      {
        "long-option": "list-all-privkeys",
        "detail": "Lists all the private keys in a token that match the specified URL.",
        "desc": "List all available private keys in a token"
      },
      {
        "aliases": "list-all-privkeys",
        "long-option": "list-privkeys"
      },
      {
        "aliases": "list-all-privkeys",
        "long-option": "list-keys"
      },
      {
        "detail": "",
        "desc": "List all available certificates marked as trusted",
        "long-option": "list-all-trusted"
      },
      {
        "detail": "",
        "conflicts": "export-stapled export-chain export-pubkey",
        "long-option": "export",
        "desc": "Export the object specified by the URL"
      },
      {
        "desc": "Export the certificate object specified by the URL",
        "detail": "Exports the certificate specified by the URL while including any attached extensions to it.\nSince attached extensions are a p11-kit extension, this option is only\navailable on p11-kit registered trust modules.",
        "conflicts": "export export-chain export-pubkey",
        "long-option": "export-stapled"
      },
      {
        "conflicts": "export-stapled export export-pubkey",
        "desc": "Export the certificate specified by the URL and its chain of trust",
        "detail": "Exports the certificate specified by the URL and generates its chain of trust based on the stored certificates in the module.",
        "long-option": "export-chain"
      },
      {
        "desc": "Export the public key for a private key",
        "conflicts": "export-stapled export export-chain",
        "long-option": "export-pubkey",
        "detail": "Exports the public key for the specified private key"
      },
      {
        "long-option": "info",
        "detail": "",
        "desc": "List information on an available object in a token"
      },
      {
        "aliases": "mark-trusted",
        "long-option": "trusted"
      },
      {
        "aliases": "mark-distrusted",
        "long-option": "distrusted"
      }
    ]
  },
  {
    "meta": {
      "desc": "Key generation",
      "id": "keygen-related-options"
    },
    "options": [
      {
        "desc": "Generate private-public key pair of given type",
        "arg-type": "string",
        "detail": "Generates a private-public key pair in the specified token.\nAcceptable types are RSA, ECDSA, Ed25519, and DSA. Should be combined with --sec-param or --bits.",
        "long-option": "generate-privkey"
      },
      {
        "desc": "Generate an RSA private-public key pair",
        "long-option": "generate-rsa",
        "detail": "Generates an RSA private-public key pair on the specified token.\nShould be combined with --sec-param or --bits.",
        "deprecated": ""
      },
      {
        "deprecated": "",
        "desc": "Generate a DSA private-public key pair",
        "detail": "Generates a DSA private-public key pair on the specified token.\nShould be combined with --sec-param or --bits.",
        "long-option": "generate-dsa"
      },
      {
        "deprecated": "",
        "desc": "Generate an ECDSA private-public key pair",
        "long-option": "generate-ecc",
        "detail": "Generates an ECDSA private-public key pair on the specified token.\nShould be combined with --curve, --sec-param or --bits."
      },
      {
        "desc": "Specify the number of bits for the key generate",
        "detail": "For applications which have no key-size restrictions the\n--sec-param option is recommended, as the sec-param levels will adapt\nto the acceptable security levels with the new versions of gnutls.",
        "long-option": "bits",
        "arg-type": "number"
      },
      {
        "detail": "Supported values are secp192r1, secp224r1, secp256r1, secp384r1 and secp521r1.",
        "long-option": "curve",
        "arg-type": "string",
        "desc": "Specify the curve used for EC key generation"
      },
      {
        "long-option": "sec-param",
        "desc": "Specify the security level",
        "detail": "This is alternative to the bits option. Available options are [low, legacy, medium, high, ultra].",
        "arg-name": "Security parameter",
        "arg-type": "string"
      }
    ]
  },
  {
    "meta": {
      "desc": "Writing objects",
      "id": "write-object-related-options"
    },
    "options": [
      {
        "conflicts": "write",
        "arg-type": "string",
        "long-option": "set-id",
        "desc": "Set the CKA_ID (in hex) for the specified by the URL object",
        "detail": "Modifies or sets the CKA_ID in the specified by the URL object. The ID should be specified in hexadecimal format without a '0x' prefix."
      },
      {
        "long-option": "set-label",
        "desc": "Set the CKA_LABEL for the specified by the URL object",
        "detail": "Modifies or sets the CKA_LABEL in the specified by the URL object",
        "conflicts": "write set-id",
        "arg-type": "string"
      },
      {
        "long-option": "write",
        "desc": "Writes the loaded objects to a PKCS #11 token",
        "detail": "It can be used to write private, public keys, certificates or secret keys to a token. Must be combined with one of --load-privkey, --load-pubkey, --load-certificate option.\n\nWhen writing a certificate object, its CKA_ID is set to the same CKA_ID of the corresponding public key, if it exists on the token; otherwise it will be derived from the X.509 Subject Key Identifier of the certificate. If this behavior is undesired, write the public key to the token beforehand."
      },
      {
        "long-option": "delete",
        "desc": "Deletes the objects matching the given PKCS #11 URL",
        "detail": ""
      },
      {
        "arg-type": "string",
        "detail": "",
        "long-option": "label",
        "desc": "Sets a label for the write operation"
      },
      {
        "desc": "Sets an ID for the write operation",
        "detail": "Sets the CKA_ID to be set by the write operation. The ID should be specified in hexadecimal format without a '0x' prefix.",
        "arg-type": "string",
        "long-option": "id"
      },
      {
        "detail": "Marks the generated key with the CKA_WRAP flag.",
        "long-option": "mark-wrap",
        "disabled": "",
        "disable-prefix": "no-",
        "desc": "Marks the generated key to be a wrapping key"
      },
      {
        "disabled": "",
        "long-option": "mark-trusted",
        "disable-prefix": "no-",
        "conflicts": "mark-distrusted",
        "desc": "Marks the object to be written as trusted",
        "detail": "Marks the object to be generated/written with the CKA_TRUST flag."
      },
      {
        "detail": "Ensures that the objects retrieved have the CKA_X_TRUST flag.\nThis is p11-kit trust module extension, thus this flag is only valid with\np11-kit registered trust modules.",
        "desc": "When retrieving objects, it requires the objects to be distrusted (blacklisted)",
        "conflicts": "mark-trusted",
        "long-option": "mark-distrusted"
      },
      {
        "disable-prefix": "no-",
        "desc": "Marks the object to be written for decryption",
        "detail": "Marks the object to be generated/written with the CKA_DECRYPT flag set to true.",
        "disabled": "",
        "long-option": "mark-decrypt"
      },
      {
        "disable-prefix": "no-",
        "detail": "Marks the object to be generated/written with the CKA_SIGN flag set to true.",
        "disabled": "",
        "long-option": "mark-sign",
        "desc": "Marks the object to be written for signature generation"
      },
      {
        "disable-prefix": "no-",
        "desc": "Marks the object to be written as a CA",
        "long-option": "mark-ca",
        "disabled": "",
        "detail": "Marks the object to be generated/written with the CKA_CERTIFICATE_CATEGORY as CA."
      },
      {
        "disable-prefix": "no-",
        "long-option": "mark-private",
        "desc": "Marks the object to be written as private",
        "detail": "Marks the object to be generated/written with the CKA_PRIVATE flag. The written object will require a PIN to be used.",
        "disabled": ""
      },
      {
        "long-option": "ca",
        "aliases": "mark-ca"
      },
      {
        "aliases": "mark-private",
        "long-option": "private"
      },
      {
        "disabled": "",
        "desc": "Marks the object to be written as always authenticate",
        "long-option": "mark-always-authenticate",
        "disable-prefix": "no-",
        "detail": "Marks the object to be generated/written with the CKA_ALWAYS_AUTHENTICATE flag. The written object will Mark the object as requiring authentication (pin entry) before every operation."
      },
      {
        "detail": "This secret key will be written to the module if --write is specified.",
        "arg-type": "string",
        "desc": "Provide a hex encoded secret key",
        "long-option": "secret-key"
      },
      {
        "arg-type": "file",
        "file-exists": "yes",
        "long-option": "load-privkey",
        "desc": "Private key file to use",
        "detail": ""
      },
      {
        "arg-type": "file",
        "file-exists": "yes",
        "desc": "Public key file to use",
        "long-option": "load-pubkey",
        "detail": ""
      },
      {
        "arg-type": "file",
        "desc": "Certificate file to use",
        "detail": "",
        "long-option": "load-certificate",
        "file-exists": "yes"
      }
    ]
  },
  {
    "meta": {
      "desc": "Other options",
      "id": "other-options"
    },
    "options": [
      {
        "desc": "Enable debugging",
        "arg-max": " 9999",
        "short-option": "d",
        "arg-type": "number",
        "detail": "Specifies the debug level.",
        "arg-min": "0 ",
        "long-option": "debug"
      },
      {
        "arg-type": "string",
        "detail": "",
        "long-option": "outfile",
        "desc": "Output file"
      },
      {
        "desc": "Force (user) login to token",
        "detail": "",
        "long-option": "login",
        "disable-prefix": "no-",
        "disabled": ""
      },
      {
        "long-option": "so-login",
        "disabled": "",
        "disable-prefix": "no-",
        "desc": "Force security officer login to token",
        "detail": "Forces login to the token as security officer (admin)."
      },
      {
        "long-option": "admin-login",
        "aliases": "so-login"
      },
      {
        "desc": "Tests the signature operation of the provided object",
        "long-option": "test-sign",
        "detail": "It can be used to test the correct operation of the signature operation.\nIf both a private and a public key are available this operation will sign and verify\nthe signed data."
      },
      {
        "detail": "This option can be combined with --test-sign, to sign with\na specific signature algorithm variant. The only option supported is 'RSA-PSS', and should be\nspecified in order to use RSA-PSS signature on RSA keys.",
        "arg-type": "string",
        "long-option": "sign-params",
        "desc": "Sign with a specific signature algorithm"
      },
      {
        "long-option": "hash",
        "detail": "This option can be combined with test-sign. Available hash functions are SHA1, RMD160, SHA256, SHA384, SHA512, SHA3-224, SHA3-256, SHA3-384, SHA3-512.",
        "desc": "Hash algorithm to use for signing",
        "arg-type": "string"
      },
      {
        "desc": "Generate random data",
        "detail": "Asks the token to generate a number of bytes of random bytes.",
        "arg-type": "number",
        "long-option": "generate-random"
      },
      {
        "detail": "",
        "short-option": "8",
        "long-option": "pkcs8",
        "desc": "Use PKCS #8 format for private keys"
      },
      {
        "long-option": "inder",
        "desc": "Use DER/RAW format for input",
        "disable-prefix": "no-",
        "detail": "Use DER/RAW format for input certificates and private keys.",
        "disabled": ""
      },
      {
        "long-option": "inraw",
        "aliases": "inder"
      },
      {
        "disable-prefix": "no-",
        "detail": "The output will be in DER or RAW format.",
        "long-option": "outder",
        "desc": "Use DER format for output certificates, private keys, and DH parameters",
        "disabled": ""
      },
      {
        "long-option": "outraw",
        "aliases": "outder"
      },
      {
        "long-option": "provider",
        "arg-type": "file",
        "desc": "Specify the PKCS #11 provider library",
        "detail": "This will override the default options in /etc/gnutls/pkcs11.conf"
      },
      {
        "arg-type": "string",
        "desc": "Specify parameters for the PKCS #11 provider library",
        "deprecated": "",
        "detail": "This is a PKCS#11 internal option used by few modules.\n    Mainly for testing PKCS#11 modules.",
        "long-option": "provider-opts"
      },
      {
        "disable-prefix": "no-",
        "long-option": "detailed-url",
        "disabled": "",
        "desc": "Print detailed URLs",
        "detail": ""
      },
      {
        "desc": "Print a compact listing using only the URLs",
        "long-option": "only-urls",
        "detail": ""
      },
      {
        "detail": "In batch mode there will be no prompts, all parameters need to be specified on command line.",
        "long-option": "batch",
        "desc": "Disable all interaction with the tool"
      }
    ]
  }
]