summaryrefslogtreecommitdiffstats
path: root/src/p11tool-options.json
blob: 28ef2fc441076cc7b582df3930f512238ffe7a0e (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
{
  "format-version": "0.1.0",
  "tool": {
    "name": "p11tool",
    "title": "GnuTLS PKCS #11 tool",
    "description": "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",
    "short-usage": "p11tool [options] [url]\np11tool --help for usage instructions.\n",
    "argument": "[url]",
    "reorder-arguments": true
  },
  "sections": [
    {
      "options": []
    },
    {
      "ref": "token-related-options",
      "description": "Tokens",
      "options": [
        {
          "long-option": "list-tokens",
          "description": "List all available tokens"
        },
        {
          "long-option": "list-token-urls",
          "description": "List the URLs available tokens",
          "detail": "This is a more compact version of --list-tokens."
        },
        {
          "long-option": "list-mechanisms",
          "description": "List all available mechanisms in a token"
        },
        {
          "long-option": "initialize",
          "description": "Initializes a PKCS #11 token"
        },
        {
          "long-option": "initialize-pin",
          "description": "Initializes/Resets a PKCS #11 token user PIN"
        },
        {
          "long-option": "initialize-so-pin",
          "description": "Initializes/Resets a PKCS #11 token security officer 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."
        },
        {
          "long-option": "set-pin",
          "description": "Specify the PIN to use on token operations",
          "detail": "Alternatively the GNUTLS_PIN environment variable may be used.",
          "argument-type": "string"
        },
        {
          "long-option": "set-so-pin",
          "description": "Specify the Security Officer's PIN to use on token initialization",
          "detail": "Alternatively the GNUTLS_SO_PIN environment variable may be used.",
          "argument-type": "string"
        }
      ]
    },
    {
      "ref": "object-list-related-options",
      "description": "Object listing",
      "options": [
        {
          "long-option": "list-all",
          "description": "List all available objects in a token",
          "detail": "All objects available in the token will be listed. That includes\nobjects which are potentially unaccessible using this tool."
        },
        {
          "long-option": "list-all-certs",
          "description": "List all available certificates 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)."
        },
        {
          "long-option": "list-certs",
          "description": "List all certificates that have an associated private key",
          "detail": "That option will only display certificates which have a private\nkey associated with them (share the same ID)."
        },
        {
          "long-option": "list-all-privkeys",
          "description": "List all available private keys in a token",
          "detail": "Lists all the private keys in a token that match the specified URL."
        },
        {
          "long-option": "list-privkeys",
          "aliases": "list-all-privkeys"
        },
        {
          "long-option": "list-keys",
          "aliases": "list-all-privkeys"
        },
        {
          "long-option": "list-all-trusted",
          "description": "List all available certificates marked as trusted"
        },
        {
          "long-option": "export",
          "description": "Export the object specified by the URL",
          "conflicts": [
            "export-stapled",
            "export-chain",
            "export-pubkey"
          ]
        },
        {
          "long-option": "export-stapled",
          "description": "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-chain",
          "description": "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.",
          "conflicts": [
            "export-stapled",
            "export",
            "export-pubkey"
          ]
        },
        {
          "long-option": "export-pubkey",
          "description": "Export the public key for a private key",
          "detail": "Exports the public key for the specified private key",
          "conflicts": [
            "export-stapled",
            "export",
            "export-chain"
          ]
        },
        {
          "long-option": "info",
          "description": "List information on an available object in a token"
        },
        {
          "long-option": "trusted",
          "aliases": "mark-trusted"
        },
        {
          "long-option": "distrusted",
          "aliases": "mark-distrusted"
        }
      ]
    },
    {
      "ref": "keygen-related-options",
      "description": "Key generation",
      "options": [
        {
          "long-option": "generate-privkey",
          "description": "Generate private-public key pair of given type",
          "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.",
          "argument-type": "string"
        },
        {
          "long-option": "generate-rsa",
          "description": "Generate an RSA private-public key pair",
          "detail": "Generates an RSA private-public key pair on the specified token.\nShould be combined with --sec-param or --bits.",
          "deprecated": true
        },
        {
          "long-option": "generate-dsa",
          "description": "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.",
          "deprecated": true
        },
        {
          "long-option": "generate-ecc",
          "description": "Generate an ECDSA private-public key pair",
          "detail": "Generates an ECDSA private-public key pair on the specified token.\nShould be combined with --curve, --sec-param or --bits.",
          "deprecated": true
        },
        {
          "long-option": "bits",
          "description": "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.",
          "argument-type": "number"
        },
        {
          "long-option": "curve",
          "description": "Specify the curve used for EC key generation",
          "detail": "Supported values are secp192r1, secp224r1, secp256r1, secp384r1 and secp521r1.",
          "argument-type": "string"
        },
        {
          "long-option": "sec-param",
          "description": "Specify the security level",
          "detail": "This is alternative to the bits option. Available options are [low, legacy, medium, high, ultra].",
          "argument-type": "string",
          "argument-name": "Security parameter"
        }
      ]
    },
    {
      "ref": "write-object-related-options",
      "description": "Writing objects",
      "options": [
        {
          "long-option": "set-id",
          "description": "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.",
          "conflicts": [
            "write"
          ],
          "argument-type": "string"
        },
        {
          "long-option": "set-label",
          "description": "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"
          ],
          "argument-type": "string"
        },
        {
          "long-option": "write",
          "description": "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",
          "description": "Deletes the objects matching the given PKCS #11 URL"
        },
        {
          "long-option": "label",
          "description": "Sets a label for the write operation",
          "argument-type": "string"
        },
        {
          "long-option": "id",
          "description": "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.",
          "argument-type": "string"
        },
        {
          "long-option": "mark-wrap",
          "description": "Marks the generated key to be a wrapping key",
          "detail": "Marks the generated key with the CKA_WRAP flag.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "mark-trusted",
          "description": "Marks the object to be written as trusted",
          "detail": "Marks the object to be generated/written with the CKA_TRUST flag.",
          "conflicts": [
            "mark-distrusted"
          ],
          "disable-prefix": "no-"
        },
        {
          "long-option": "mark-distrusted",
          "description": "When retrieving objects, it requires the objects to be distrusted (blacklisted)",
          "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.",
          "conflicts": [
            "mark-trusted"
          ]
        },
        {
          "long-option": "mark-decrypt",
          "description": "Marks the object to be written for decryption",
          "detail": "Marks the object to be generated/written with the CKA_DECRYPT flag set to true.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "mark-sign",
          "description": "Marks the object to be written for signature generation",
          "detail": "Marks the object to be generated/written with the CKA_SIGN flag set to true.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "mark-ca",
          "description": "Marks the object to be written as a CA",
          "detail": "Marks the object to be generated/written with the CKA_CERTIFICATE_CATEGORY as CA.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "mark-private",
          "description": "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.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "ca",
          "aliases": "mark-ca"
        },
        {
          "long-option": "private",
          "aliases": "mark-private"
        },
        {
          "long-option": "mark-always-authenticate",
          "description": "Marks the object to be written as always authenticate",
          "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.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "secret-key",
          "description": "Provide a hex encoded secret key",
          "detail": "This secret key will be written to the module if --write is specified.",
          "argument-type": "string"
        },
        {
          "long-option": "load-privkey",
          "description": "Private key file to use",
          "file-exists": true,
          "argument-type": "file"
        },
        {
          "long-option": "load-pubkey",
          "description": "Public key file to use",
          "file-exists": true,
          "argument-type": "file"
        },
        {
          "long-option": "load-certificate",
          "description": "Certificate file to use",
          "file-exists": true,
          "argument-type": "file"
        }
      ]
    },
    {
      "ref": "other-options",
      "description": "Other options",
      "options": [
        {
          "long-option": "debug",
          "short-option": "d",
          "description": "Enable debugging",
          "detail": "Specifies the debug level.",
          "argument-range": {
            "min": 0,
            "max": 9999
          },
          "argument-type": "number"
        },
        {
          "long-option": "outfile",
          "description": "Output file",
          "argument-type": "string"
        },
        {
          "long-option": "login",
          "description": "Force (user) login to token",
          "disable-prefix": "no-"
        },
        {
          "long-option": "so-login",
          "description": "Force security officer login to token",
          "detail": "Forces login to the token as security officer (admin).",
          "disable-prefix": "no-"
        },
        {
          "long-option": "admin-login",
          "aliases": "so-login"
        },
        {
          "long-option": "test-sign",
          "description": "Tests the signature operation of the provided object",
          "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."
        },
        {
          "long-option": "sign-params",
          "description": "Sign with a specific signature algorithm",
          "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.",
          "argument-type": "string"
        },
        {
          "long-option": "hash",
          "description": "Hash algorithm to use for signing",
          "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.",
          "argument-type": "string"
        },
        {
          "long-option": "generate-random",
          "description": "Generate random data",
          "detail": "Asks the token to generate a number of bytes of random bytes.",
          "argument-type": "number"
        },
        {
          "long-option": "pkcs8",
          "short-option": "8",
          "description": "Use PKCS #8 format for private keys"
        },
        {
          "long-option": "inder",
          "description": "Use DER/RAW format for input",
          "detail": "Use DER/RAW format for input certificates and private keys.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "inraw",
          "aliases": "inder"
        },
        {
          "long-option": "outder",
          "description": "Use DER format for output certificates, private keys, and DH parameters",
          "detail": "The output will be in DER or RAW format.",
          "disable-prefix": "no-"
        },
        {
          "long-option": "outraw",
          "aliases": "outder"
        },
        {
          "long-option": "provider",
          "description": "Specify the PKCS #11 provider library",
          "detail": "This will override the default options in /etc/gnutls/pkcs11.conf",
          "argument-type": "file"
        },
        {
          "long-option": "provider-opts",
          "description": "Specify parameters for the PKCS #11 provider library",
          "detail": "This is a PKCS#11 internal option used by few modules.\n    Mainly for testing PKCS#11 modules.",
          "deprecated": true,
          "argument-type": "string"
        },
        {
          "long-option": "detailed-url",
          "description": "Print detailed URLs",
          "disable-prefix": "no-"
        },
        {
          "long-option": "only-urls",
          "description": "Print a compact listing using only the URLs"
        },
        {
          "long-option": "batch",
          "description": "Disable all interaction with the tool",
          "detail": "In batch mode there will be no prompts, all parameters need to be specified on command line."
        }
      ]
    }
  ]
}