other versions
- wheezy 3.0.22-3+really2.12.20-8+deb7u5
- wheezy-backports 3.3.8-6~bpo70+1
- jessie 3.3.8-6+deb8u5
- testing 3.5.8-5
- unstable 3.5.8-6
- experimental 3.5.13-1
p11tool(1) | User Commands | p11tool(1) |
NAME¶
p11tool - GnuTLS PKCS #11 toolSYNOPSIS¶
p11tool [-flag [value]]... [--opt-name[[=| ] value]]... [url] Operands and options may be intermixed. They will be reordered.DESCRIPTION¶
Program that allows operations on PKCS #11 smart cards and security modules.OPTIONS¶
- -d number, --debug=number
- Enable debugging. This option takes an integer number as
its argument. The value of number is constrained to being:
in the range 0 through 9999
- --outfile=string
- Output file.
- --list-tokens
- List all available tokens.
- --export
- Export the object specified by the URL.
- --export-chain
- Export the certificate specified by the URL and its chain
of trust.
- --list-mechanisms
- List all available mechanisms in a token.
- --info
- List information on an available object in a token.
- --list-all
- List all available objects in a token.
- --list-all-certs
- List all available certificates in a token.
- --list-certs
- List all certificates that have an associated private key.
- --list-all-privkeys
- List all available private keys in a token.
- --list-privkeys
- This is an alias for the --list-all-privkeys option.
- --list-keys
- This is an alias for the --list-all-privkeys option.
- --list-all-trusted
- List all available certificates marked as trusted.
- --write
- Writes the loaded objects to a PKCS #11 token.
- --delete
- Deletes the objects matching the PKCS #11 URL.
- --generate-random=number
- Generate random data. This option takes an integer number
as its argument.
- --generate-rsa
- Generate an RSA private-public key pair.
- --generate-dsa
- Generate an RSA private-public key pair.
- --generate-ecc
- Generate an RSA private-public key pair.
- --export-pubkey
- Export the public key for a private key.
- --label=string
- Sets a label for the write operation.
- --mark-wrap, --no-mark-wrap
- Marks the generated key to be a wrapping key. The
no-mark-wrap form will disable the option.
- --mark-trusted, --no-mark-trusted
- Marks the object to be written as trusted. The
no-mark-trusted form will disable the option.
- --mark-ca, --no-mark-ca
- Marks the object to be written as a CA. The
no-mark-ca form will disable the option.
- --mark-private, --no-mark-private
- Marks the object to be written as private. The
no-mark-private form will disable the option. This option is
enabled by default.
- --trusted
- This is an alias for the --mark-trusted option.
- --ca
- This is an alias for the --mark-ca option.
- --private
- This is an alias for the --mark-private option.
- --login, --no-login
- Force (user) login to token. The no-login form will
disable the option.
- --so-login, --no-so-login
- Force security officer login to token. The
no-so-login form will disable the option.
- --admin-login
- This is an alias for the --so-login option.
- --detailed-url, --no-detailed-url
- Print detailed URLs. The no-detailed-url form will
disable the option.
- --secret-key=string
- Provide a hex encoded secret key.
- --load-privkey=file
- Private key file to use.
- --load-pubkey=file
- Public key file to use.
- --load-certificate=file
- Certificate file to use.
- -8, --pkcs8
- Use PKCS #8 format for private keys.
- --bits=number
- Specify the number of bits for key generate. This option
takes an integer number as its argument.
- --curve=string
- Specify the curve used for EC key generation.
- --sec-param=security parameter
- Specify the security level.
- --inder, --no-inder
- Use DER/RAW format for input. The no-inder form will
disable the option.
- --inraw
- This is an alias for the --inder option.
- --outder, --no-outder
- Use DER format for output certificates, private keys, and
DH parameters. The no-outder form will disable the option.
- --outraw
- This is an alias for the --outder option.
- --initialize
- Initializes a PKCS #11 token.
- --set-pin=string
- Specify the PIN to use on token initialization.
- --set-so-pin=string
- Specify the Security Officer's PIN to use on token
initialization.
- --provider=file
- Specify the PKCS #11 provider library.
- --batch
- Disable all interaction with the tool. All parameters need
to be specified on command line..
- -h, --help
- Display usage information and exit.
- -!, --more-help
- Pass the extended usage information through a pager.
- -v [{v|c|n}], --version[={v|c|n}]
- Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice.
EXAMPLES¶
To view all tokens in your system use:$ p11tool --list-tokens
$ p11tool --login --list-all "pkcs11:TOKEN-URL"
$ p11tool --login --write "pkcs11:URL" --load-privkey key.pem --label "Mykey" $ p11tool --login --write "pkcs11:URL" --load-certificate cert.pem --label "Mykey"Note that some tokens require the same label to be used for the certificate and its corresponding private key.
$ p11tool --login --generate-rsa --bits 1024 --label "MyNewKey" --outfile MyNewKey.pub "pkcs11:TOKEN-URL"The bits parameter in the above example is explicitly set because some tokens only support limited choices in the bit length. The output file is the corresponding public key. This key can be used to general a certificate request with certtool.
certtool --generate-request --load-privkey "pkcs11:KEY-URL" --load-pubkey MyNewKey.pub --outfile request.pem
EXIT STATUS¶
One of the following exit values will be returned:- 0 (EXIT_SUCCESS)
- Successful program execution.
- 1 (EXIT_FAILURE)
- The operation failed or the command syntax was not valid.
- 70 (EX_SOFTWARE)
- libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.
SEE ALSO¶
certtool (1)
AUTHORS¶
Nikos Mavrogiannopoulos, Simon Josefsson and others; see /usr/share/doc/gnutls/AUTHORS for a complete list.COPYRIGHT¶
Copyright (C) 2000-2014 Free Software Foundation, and others all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later.BUGS¶
Please send bug reports to: bugs@gnutls.orgNOTES¶
This manual page was AutoGen-erated from the p11tool option definitions.18 Sep 2014 | 3.3.8 |