Blame doc/invoke-p11tool.texi

Packit Service 4684c1
@node p11tool Invocation
Packit Service 4684c1
@subsection Invoking p11tool
Packit Service 4684c1
@pindex p11tool
Packit Service 4684c1
@ignore
Packit Service 4684c1
#  -*- buffer-read-only: t -*- vi: set ro:
Packit Service 4684c1
#
Packit Service 4684c1
# DO NOT EDIT THIS FILE   (invoke-p11tool.texi)
Packit Service 4684c1
#
Packit Service 4684c1
# It has been AutoGen-ed
Packit Service 4684c1
# From the definitions    ../src/p11tool-args.def
Packit Service 4684c1
# and the template file   agtexi-cmd.tpl
Packit Service 4684c1
@end ignore
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Program that allows operations on PKCS #11 smart cards
Packit Service 4684c1
and security modules. 
Packit Service 4684c1
Packit Service 4684c1
To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to be setup.
Packit Service 4684c1
That is create a .module file in /etc/pkcs11/modules with the contents 'module: /path/to/pkcs11.so'.
Packit Service 4684c1
Alternatively the configuration file /etc/gnutls/pkcs11.conf has to exist and contain a number
Packit Service 4684c1
of lines of the form 'load=/usr/lib/opensc-pkcs11.so'.
Packit Service 4684c1
Packit Service 4684c1
You can provide the PIN to be used for the PKCS #11 operations with the environment variables
Packit Service 4684c1
GNUTLS_PIN and GNUTLS_SO_PIN.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
This section was generated by @strong{AutoGen},
Packit Service 4684c1
using the @code{agtexi-cmd} template and the option descriptions for the @code{p11tool} program.
Packit Service 4684c1
This software is released under the GNU General Public License, version 3 or later.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
@anchor{p11tool usage}
Packit Service 4684c1
@subheading p11tool help/usage (@option{--help})
Packit Service 4684c1
@cindex p11tool help
Packit Service 4684c1
Packit Service 4684c1
This is the automatically generated usage text for p11tool.
Packit Service 4684c1
Packit Service 4684c1
The text printed is the same whether selected with the @code{help} option
Packit Service 4684c1
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
Packit Service 4684c1
the usage text by passing it through a pager program.
Packit Service 4684c1
@code{more-help} is disabled on platforms without a working
Packit Service 4684c1
@code{fork(2)} function.  The @code{PAGER} environment variable is
Packit Service 4684c1
used to select the program, defaulting to @file{more}.  Both will exit
Packit Service 4684c1
with a status code of 0.
Packit Service 4684c1
Packit Service 4684c1
@exampleindent 0
Packit Service 4684c1
@example
Packit Service 4684c1
p11tool - GnuTLS PKCS #11 tool
Packit Service 4684c1
Usage:  p11tool [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [url]
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Tokens:
Packit Service 4684c1
Packit Service 4684c1
       --list-tokens          List all available tokens
Packit Service 4684c1
       --list-token-urls      List the URLs available tokens
Packit Service 4684c1
       --list-mechanisms      List all available mechanisms in a token
Packit Service 4684c1
       --initialize           Initializes a PKCS #11 token
Packit Service 4684c1
       --initialize-pin       Initializes/Resets a PKCS #11 token user PIN
Packit Service 4684c1
       --initialize-so-pin    Initializes/Resets a PKCS #11 token security officer PIN.
Packit Service 4684c1
       --set-pin=str          Specify the PIN to use on token operations
Packit Service 4684c1
       --set-so-pin=str       Specify the Security Officer's PIN to use on token initialization
Packit Service 4684c1
Packit Service 4684c1
Object listing:
Packit Service 4684c1
Packit Service 4684c1
       --list-all             List all available objects in a token
Packit Service 4684c1
       --list-all-certs       List all available certificates in a token
Packit Service 4684c1
       --list-certs           List all certificates that have an associated private key
Packit Service 4684c1
       --list-all-privkeys    List all available private keys in a token
Packit Service 4684c1
       --list-privkeys        an alias for the 'list-all-privkeys' option
Packit Service 4684c1
       --list-keys            an alias for the 'list-all-privkeys' option
Packit Service 4684c1
       --list-all-trusted     List all available certificates marked as trusted
Packit Service 4684c1
       --export               Export the object specified by the URL
Packit Service 4684c1
                                - prohibits these options:
Packit Service 4684c1
                                export-stapled
Packit Service 4684c1
                                export-chain
Packit Service 4684c1
                                export-pubkey
Packit Service 4684c1
       --export-stapled       Export the certificate object specified by the URL
Packit Service 4684c1
                                - prohibits these options:
Packit Service 4684c1
                                export
Packit Service 4684c1
                                export-chain
Packit Service 4684c1
                                export-pubkey
Packit Service 4684c1
       --export-chain         Export the certificate specified by the URL and its chain of trust
Packit Service 4684c1
                                - prohibits these options:
Packit Service 4684c1
                                export-stapled
Packit Service 4684c1
                                export
Packit Service 4684c1
                                export-pubkey
Packit Service 4684c1
       --export-pubkey        Export the public key for a private key
Packit Service 4684c1
                                - prohibits these options:
Packit Service 4684c1
                                export-stapled
Packit Service 4684c1
                                export
Packit Service 4684c1
                                export-chain
Packit Service 4684c1
       --info                 List information on an available object in a token
Packit Service 4684c1
       --trusted              an alias for the 'mark-trusted' option
Packit Service 4684c1
       --distrusted           an alias for the 'mark-distrusted' option
Packit Service 4684c1
Packit Service 4684c1
Key generation:
Packit Service 4684c1
Packit Service 4684c1
       --generate-privkey=str Generate private-public key pair of given type
Packit Service 4684c1
       --bits=num             Specify the number of bits for the key generate
Packit Service 4684c1
       --curve=str            Specify the curve used for EC key generation
Packit Service 4684c1
       --sec-param=str        Specify the security level
Packit Service 4684c1
Packit Service 4684c1
Writing objects:
Packit Service 4684c1
Packit Service 4684c1
       --set-id=str           Set the CKA_ID (in hex) for the specified by the URL object
Packit Service 4684c1
                                - prohibits the option 'write'
Packit Service 4684c1
       --set-label=str        Set the CKA_LABEL for the specified by the URL object
Packit Service 4684c1
                                - prohibits these options:
Packit Service 4684c1
                                write
Packit Service 4684c1
                                set-id
Packit Service 4684c1
       --write                Writes the loaded objects to a PKCS #11 token
Packit Service 4684c1
       --delete               Deletes the objects matching the given PKCS #11 URL
Packit Service 4684c1
       --label=str            Sets a label for the write operation
Packit Service 4684c1
       --id=str               Sets an ID for the write operation
Packit Service 4684c1
       --mark-wrap            Marks the generated key to be a wrapping key
Packit Service 4684c1
                                - disabled as '--no-mark-wrap'
Packit Service 4684c1
       --mark-trusted         Marks the object to be written as trusted
Packit Service 4684c1
                                - prohibits the option 'mark-distrusted'
Packit Service 4684c1
                                - disabled as '--no-mark-trusted'
Packit Service 4684c1
       --mark-distrusted      When retrieving objects, it requires the objects to be distrusted
Packit Service 4684c1
(blacklisted)
Packit Service 4684c1
                                - prohibits the option 'mark-trusted'
Packit Service 4684c1
       --mark-decrypt         Marks the object to be written for decryption
Packit Service 4684c1
                                - disabled as '--no-mark-decrypt'
Packit Service 4684c1
       --mark-sign            Marks the object to be written for signature generation
Packit Service 4684c1
                                - disabled as '--no-mark-sign'
Packit Service 4684c1
       --mark-ca              Marks the object to be written as a CA
Packit Service 4684c1
                                - disabled as '--no-mark-ca'
Packit Service 4684c1
       --mark-private         Marks the object to be written as private
Packit Service 4684c1
                                - disabled as '--no-mark-private'
Packit Service 4684c1
       --ca                   an alias for the 'mark-ca' option
Packit Service 4684c1
       --private              an alias for the 'mark-private' option
Packit Service 4684c1
       --secret-key=str       Provide a hex encoded secret key
Packit Service 4684c1
       --load-privkey=file    Private key file to use
Packit Service 4684c1
                                - file must pre-exist
Packit Service 4684c1
       --load-pubkey=file     Public key file to use
Packit Service 4684c1
                                - file must pre-exist
Packit Service 4684c1
       --load-certificate=file Certificate file to use
Packit Service 4684c1
                                - file must pre-exist
Packit Service 4684c1
Packit Service 4684c1
Other options:
Packit Service 4684c1
Packit Service 4684c1
   -d, --debug=num            Enable debugging
Packit Service 4684c1
                                - it must be in the range:
Packit Service 4684c1
                                  0 to 9999
Packit Service 4684c1
       --outfile=str          Output file
Packit Service 4684c1
       --login                Force (user) login to token
Packit Service 4684c1
                                - disabled as '--no-login'
Packit Service 4684c1
       --so-login             Force security officer login to token
Packit Service 4684c1
                                - disabled as '--no-so-login'
Packit Service 4684c1
       --admin-login          an alias for the 'so-login' option
Packit Service 4684c1
       --test-sign            Tests the signature operation of the provided object
Packit Service 4684c1
       --sign-params=str      Sign with a specific signature algorithm
Packit Service 4684c1
       --hash=str             Hash algorithm to use for signing
Packit Service 4684c1
       --generate-random=num  Generate random data
Packit Service 4684c1
   -8, --pkcs8                Use PKCS #8 format for private keys
Packit Service 4684c1
       --inder                Use DER/RAW format for input
Packit Service 4684c1
                                - disabled as '--no-inder'
Packit Service 4684c1
       --inraw                an alias for the 'inder' option
Packit Service 4684c1
       --outder               Use DER format for output certificates, private keys, and DH parameters
Packit Service 4684c1
                                - disabled as '--no-outder'
Packit Service 4684c1
       --outraw               an alias for the 'outder' option
Packit Service 4684c1
       --provider=file        Specify the PKCS #11 provider library
Packit Service 4684c1
       --detailed-url         Print detailed URLs
Packit Service 4684c1
                                - disabled as '--no-detailed-url'
Packit Service 4684c1
       --only-urls            Print a compact listing using only the URLs
Packit Service 4684c1
       --batch                Disable all interaction with the tool
Packit Service 4684c1
Packit Service 4684c1
Version, usage and configuration options:
Packit Service 4684c1
Packit Service 4684c1
   -v, --version[=arg]        output version information and exit
Packit Service 4684c1
   -h, --help                 display extended usage information and exit
Packit Service 4684c1
   -!, --more-help            extended usage information passed thru pager
Packit Service 4684c1
Packit Service 4684c1
Options are specified by doubled hyphens and their name or by a single
Packit Service 4684c1
hyphen and the flag character.
Packit Service 4684c1
Operands and options may be intermixed.  They will be reordered.
Packit Service 4684c1
Packit Service 4684c1
Program that allows operations on PKCS #11 smart cards and security
Packit Service 4684c1
modules.
Packit Service 4684c1
Packit Service 4684c1
To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to
Packit Service 4684c1
be setup.  That is create a .module file in /etc/pkcs11/modules with the
Packit Service 4684c1
contents 'module: /path/to/pkcs11.so'.  Alternatively the configuration
Packit Service 4684c1
file /etc/gnutls/pkcs11.conf has to exist and contain a number of lines of
Packit Service 4684c1
the form 'load=/usr/lib/opensc-pkcs11.so'.
Packit Service 4684c1
Packit Service 4684c1
You can provide the PIN to be used for the PKCS #11 operations with the
Packit Service 4684c1
environment variables GNUTLS_PIN and GNUTLS_SO_PIN.
Packit Service 4684c1
Packit Service 4684c1
@end example
Packit Service 4684c1
@exampleindent 4
Packit Service 4684c1
Packit Service 4684c1
@anchor{p11tool token-related-options}
Packit Service 4684c1
@subheading token-related-options options
Packit Service 4684c1
Tokens.
Packit Service 4684c1
@subsubheading list-token-urls option.
Packit Service 4684c1
@anchor{p11tool list-token-urls}
Packit Service 4684c1
Packit Service 4684c1
This is the ``list the urls available tokens'' option.
Packit Service 4684c1
This is a more compact version of --list-tokens.
Packit Service 4684c1
@subsubheading initialize-so-pin option.
Packit Service 4684c1
@anchor{p11tool initialize-so-pin}
Packit Service 4684c1
Packit Service 4684c1
This is the ``initializes/resets a pkcs #11 token security officer pin.'' option.
Packit Service 4684c1
This initializes the security officer's PIN. When used non-interactively use the GNUTLS_NEW_SO_PIN
Packit Service 4684c1
environment variables to initialize SO's PIN.
Packit Service 4684c1
@subsubheading set-pin option.
Packit Service 4684c1
@anchor{p11tool set-pin}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the pin to use on token operations'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Alternatively the GNUTLS_PIN environment variable may be used.
Packit Service 4684c1
@subsubheading set-so-pin option.
Packit Service 4684c1
@anchor{p11tool set-so-pin}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the security officer's pin to use on token initialization'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Alternatively the GNUTLS_SO_PIN environment variable may be used.
Packit Service 4684c1
@anchor{p11tool object-list-related-options}
Packit Service 4684c1
@subheading object-list-related-options options
Packit Service 4684c1
Object listing.
Packit Service 4684c1
@subsubheading list-all option.
Packit Service 4684c1
@anchor{p11tool list-all}
Packit Service 4684c1
Packit Service 4684c1
This is the ``list all available objects in a token'' option.
Packit Service 4684c1
All objects available in the token will be listed. That includes
Packit Service 4684c1
objects which are potentially unaccessible using this tool.
Packit Service 4684c1
@subsubheading list-all-certs option.
Packit Service 4684c1
@anchor{p11tool list-all-certs}
Packit Service 4684c1
Packit Service 4684c1
This is the ``list all available certificates in a token'' option.
Packit Service 4684c1
That option will also provide more information on the
Packit Service 4684c1
certificates, for example, expand the attached extensions in a trust
Packit Service 4684c1
token (like p11-kit-trust).
Packit Service 4684c1
@subsubheading list-certs option.
Packit Service 4684c1
@anchor{p11tool list-certs}
Packit Service 4684c1
Packit Service 4684c1
This is the ``list all certificates that have an associated private key'' option.
Packit Service 4684c1
That option will only display certificates which have a private
Packit Service 4684c1
key associated with them (share the same ID).
Packit Service 4684c1
@subsubheading list-all-privkeys option.
Packit Service 4684c1
@anchor{p11tool list-all-privkeys}
Packit Service 4684c1
Packit Service 4684c1
This is the ``list all available private keys in a token'' option.
Packit Service 4684c1
Lists all the private keys in a token that match the specified URL.
Packit Service 4684c1
@subsubheading list-privkeys option.
Packit Service 4684c1
@anchor{p11tool list-privkeys}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{list-all-privkeys} option,
Packit Service 4684c1
@pxref{p11tool list-all-privkeys, the list-all-privkeys option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading list-keys option.
Packit Service 4684c1
@anchor{p11tool list-keys}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{list-all-privkeys} option,
Packit Service 4684c1
@pxref{p11tool list-all-privkeys, the list-all-privkeys option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading export-stapled option.
Packit Service 4684c1
@anchor{p11tool export-stapled}
Packit Service 4684c1
Packit Service 4684c1
This is the ``export the certificate object specified by the url'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
export, export-chain, export-pubkey.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Exports the certificate specified by the URL while including any attached extensions to it.
Packit Service 4684c1
Since attached extensions are a p11-kit extension, this option is only
Packit Service 4684c1
available on p11-kit registered trust modules.
Packit Service 4684c1
@subsubheading export-chain option.
Packit Service 4684c1
@anchor{p11tool export-chain}
Packit Service 4684c1
Packit Service 4684c1
This is the ``export the certificate specified by the url and its chain of trust'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
export-stapled, export, export-pubkey.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Exports the certificate specified by the URL and generates its chain of trust based on the stored certificates in the module.
Packit Service 4684c1
@subsubheading export-pubkey option.
Packit Service 4684c1
@anchor{p11tool export-pubkey}
Packit Service 4684c1
Packit Service 4684c1
This is the ``export the public key for a private key'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
export-stapled, export, export-chain.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Exports the public key for the specified private key
Packit Service 4684c1
@subsubheading trusted option.
Packit Service 4684c1
@anchor{p11tool trusted}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{mark-trusted} option,
Packit Service 4684c1
@pxref{p11tool mark-trusted, the mark-trusted option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading distrusted option.
Packit Service 4684c1
@anchor{p11tool distrusted}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{mark-distrusted} option,
Packit Service 4684c1
@pxref{p11tool mark-distrusted, the mark-distrusted option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@anchor{p11tool keygen-related-options}
Packit Service 4684c1
@subheading keygen-related-options options
Packit Service 4684c1
Key generation.
Packit Service 4684c1
@subsubheading generate-privkey option.
Packit Service 4684c1
@anchor{p11tool generate-privkey}
Packit Service 4684c1
Packit Service 4684c1
This is the ``generate private-public key pair of given type'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Generates a private-public key pair in the specified token.
Packit Service 4684c1
Acceptable types are RSA, ECDSA, Ed25519, and DSA. Should be combined with --sec-param or --bits.
Packit Service 4684c1
@subsubheading generate-rsa option.
Packit Service 4684c1
@anchor{p11tool generate-rsa}
Packit Service 4684c1
Packit Service 4684c1
This is the ``generate an rsa private-public key pair'' option.
Packit Service 4684c1
Generates an RSA private-public key pair on the specified token.
Packit Service 4684c1
Should be combined with --sec-param or --bits.
Packit Service 4684c1
Packit Service 4684c1
@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
Packit Service 4684c1
@subsubheading generate-dsa option.
Packit Service 4684c1
@anchor{p11tool generate-dsa}
Packit Service 4684c1
Packit Service 4684c1
This is the ``generate a dsa private-public key pair'' option.
Packit Service 4684c1
Generates a DSA private-public key pair on the specified token.
Packit Service 4684c1
Should be combined with --sec-param or --bits.
Packit Service 4684c1
Packit Service 4684c1
@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
Packit Service 4684c1
@subsubheading generate-ecc option.
Packit Service 4684c1
@anchor{p11tool generate-ecc}
Packit Service 4684c1
Packit Service 4684c1
This is the ``generate an ecdsa private-public key pair'' option.
Packit Service 4684c1
Generates an ECDSA private-public key pair on the specified token.
Packit Service 4684c1
Should be combined with --curve, --sec-param or --bits.
Packit Service 4684c1
Packit Service 4684c1
@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
Packit Service 4684c1
@subsubheading bits option.
Packit Service 4684c1
@anchor{p11tool bits}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the number of bits for the key generate'' option.
Packit Service 4684c1
This option takes a number argument.
Packit Service 4684c1
For applications which have no key-size restrictions the
Packit Service 4684c1
--sec-param option is recommended, as the sec-param levels will adapt
Packit Service 4684c1
to the acceptable security levels with the new versions of gnutls.
Packit Service 4684c1
@subsubheading curve option.
Packit Service 4684c1
@anchor{p11tool curve}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the curve used for ec key generation'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Supported values are secp192r1, secp224r1, secp256r1, secp384r1 and secp521r1.
Packit Service 4684c1
@subsubheading sec-param option.
Packit Service 4684c1
@anchor{p11tool sec-param}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the security level'' option.
Packit Service 4684c1
This option takes a string argument @file{Security parameter}.
Packit Service 4684c1
This is alternative to the bits option. Available options are [low, legacy, medium, high, ultra].
Packit Service 4684c1
@anchor{p11tool write-object-related-options}
Packit Service 4684c1
@subheading write-object-related-options options
Packit Service 4684c1
Writing objects.
Packit Service 4684c1
@subsubheading set-id option.
Packit Service 4684c1
@anchor{p11tool set-id}
Packit Service 4684c1
Packit Service 4684c1
This is the ``set the cka_id (in hex) for the specified by the url object'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
write.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
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.
Packit Service 4684c1
@subsubheading set-label option.
Packit Service 4684c1
@anchor{p11tool set-label}
Packit Service 4684c1
Packit Service 4684c1
This is the ``set the cka_label for the specified by the url object'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
write, set-id.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Modifies or sets the CKA_LABEL in the specified by the URL object
Packit Service 4684c1
@subsubheading write option.
Packit Service 4684c1
@anchor{p11tool write}
Packit Service 4684c1
Packit Service 4684c1
This is the ``writes the loaded objects to a pkcs #11 token'' option.
Packit Service 4684c1
It can be used to write private, public keys, certificates or secret keys to a token. Must be combined with
Packit Service 4684c1
    one of --load-privkey, --load-pubkey, --load-certificate option.
Packit Service 4684c1
@subsubheading id option.
Packit Service 4684c1
@anchor{p11tool id}
Packit Service 4684c1
Packit Service 4684c1
This is the ``sets an id for the write operation'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
Sets the CKA_ID to be set by the write operation. The ID should be specified in hexadecimal format without a '0x' prefix.
Packit Service 4684c1
@subsubheading mark-wrap option.
Packit Service 4684c1
@anchor{p11tool mark-wrap}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the generated key to be a wrapping key'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-wrap.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the generated key with the CKA_WRAP flag.
Packit Service 4684c1
@subsubheading mark-trusted option.
Packit Service 4684c1
@anchor{p11tool mark-trusted}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the object to be written as trusted'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-trusted.
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
mark-distrusted.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the object to be generated/written with the CKA_TRUST flag.
Packit Service 4684c1
@subsubheading mark-distrusted option.
Packit Service 4684c1
@anchor{p11tool mark-distrusted}
Packit Service 4684c1
Packit Service 4684c1
This is the ``when retrieving objects, it requires the objects to be distrusted (blacklisted)'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
must not appear in combination with any of the following options:
Packit Service 4684c1
mark-trusted.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Ensures that the objects retrieved have the CKA_X_TRUST flag.
Packit Service 4684c1
This is p11-kit trust module extension, thus this flag is only valid with
Packit Service 4684c1
p11-kit registered trust modules.
Packit Service 4684c1
@subsubheading mark-decrypt option.
Packit Service 4684c1
@anchor{p11tool mark-decrypt}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the object to be written for decryption'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-decrypt.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the object to be generated/written with the CKA_DECRYPT flag set to true.
Packit Service 4684c1
@subsubheading mark-sign option.
Packit Service 4684c1
@anchor{p11tool mark-sign}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the object to be written for signature generation'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-sign.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the object to be generated/written with the CKA_SIGN flag set to true.
Packit Service 4684c1
@subsubheading mark-ca option.
Packit Service 4684c1
@anchor{p11tool mark-ca}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the object to be written as a ca'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-ca.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the object to be generated/written with the CKA_CERTIFICATE_CATEGORY as CA.
Packit Service 4684c1
@subsubheading mark-private option.
Packit Service 4684c1
@anchor{p11tool mark-private}
Packit Service 4684c1
Packit Service 4684c1
This is the ``marks the object to be written as private'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-mark-private.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Marks the object to be generated/written with the CKA_PRIVATE flag. The written object will require a PIN to be used.
Packit Service 4684c1
@subsubheading ca option.
Packit Service 4684c1
@anchor{p11tool ca}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{mark-ca} option,
Packit Service 4684c1
@pxref{p11tool mark-ca, the mark-ca option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading private option.
Packit Service 4684c1
@anchor{p11tool private}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{mark-private} option,
Packit Service 4684c1
@pxref{p11tool mark-private, the mark-private option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading secret-key option.
Packit Service 4684c1
@anchor{p11tool secret-key}
Packit Service 4684c1
Packit Service 4684c1
This is the ``provide a hex encoded secret key'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
This secret key will be written to the module if --write is specified.
Packit Service 4684c1
@anchor{p11tool other-options}
Packit Service 4684c1
@subheading other-options options
Packit Service 4684c1
Other options.
Packit Service 4684c1
@subsubheading debug option (-d).
Packit Service 4684c1
@anchor{p11tool debug}
Packit Service 4684c1
Packit Service 4684c1
This is the ``enable debugging'' option.
Packit Service 4684c1
This option takes a number argument.
Packit Service 4684c1
Specifies the debug level.
Packit Service 4684c1
@subsubheading so-login option.
Packit Service 4684c1
@anchor{p11tool so-login}
Packit Service 4684c1
Packit Service 4684c1
This is the ``force security officer login to token'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-so-login.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Forces login to the token as security officer (admin).
Packit Service 4684c1
@subsubheading admin-login option.
Packit Service 4684c1
@anchor{p11tool admin-login}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{so-login} option,
Packit Service 4684c1
@pxref{p11tool so-login, the so-login option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading test-sign option.
Packit Service 4684c1
@anchor{p11tool test-sign}
Packit Service 4684c1
Packit Service 4684c1
This is the ``tests the signature operation of the provided object'' option.
Packit Service 4684c1
It can be used to test the correct operation of the signature operation.
Packit Service 4684c1
If both a private and a public key are available this operation will sign and verify
Packit Service 4684c1
the signed data.
Packit Service 4684c1
@subsubheading sign-params option.
Packit Service 4684c1
@anchor{p11tool sign-params}
Packit Service 4684c1
Packit Service 4684c1
This is the ``sign with a specific signature algorithm'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
This option can be combined with --test-sign, to sign with
Packit Service 4684c1
a specific signature algorithm variant. The only option supported is 'RSA-PSS', and should be
Packit Service 4684c1
specified in order to use RSA-PSS signature on RSA keys.
Packit Service 4684c1
@subsubheading hash option.
Packit Service 4684c1
@anchor{p11tool hash}
Packit Service 4684c1
Packit Service 4684c1
This is the ``hash algorithm to use for signing'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
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.
Packit Service 4684c1
@subsubheading generate-random option.
Packit Service 4684c1
@anchor{p11tool generate-random}
Packit Service 4684c1
Packit Service 4684c1
This is the ``generate random data'' option.
Packit Service 4684c1
This option takes a number argument.
Packit Service 4684c1
Asks the token to generate a number of bytes of random bytes.
Packit Service 4684c1
@subsubheading inder option.
Packit Service 4684c1
@anchor{p11tool inder}
Packit Service 4684c1
Packit Service 4684c1
This is the ``use der/raw format for input'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-inder.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Use DER/RAW format for input certificates and private keys.
Packit Service 4684c1
@subsubheading inraw option.
Packit Service 4684c1
@anchor{p11tool inraw}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{inder} option,
Packit Service 4684c1
@pxref{p11tool inder, the inder option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading outder option.
Packit Service 4684c1
@anchor{p11tool outder}
Packit Service 4684c1
Packit Service 4684c1
This is the ``use der format for output certificates, private keys, and dh parameters'' option.
Packit Service 4684c1
Packit Service 4684c1
@noindent
Packit Service 4684c1
This option has some usage constraints.  It:
Packit Service 4684c1
@itemize @bullet
Packit Service 4684c1
@item
Packit Service 4684c1
can be disabled with --no-outder.
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
The output will be in DER or RAW format.
Packit Service 4684c1
@subsubheading outraw option.
Packit Service 4684c1
@anchor{p11tool outraw}
Packit Service 4684c1
Packit Service 4684c1
This is an alias for the @code{outder} option,
Packit Service 4684c1
@pxref{p11tool outder, the outder option documentation}.
Packit Service 4684c1
Packit Service 4684c1
@subsubheading provider option.
Packit Service 4684c1
@anchor{p11tool provider}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify the pkcs #11 provider library'' option.
Packit Service 4684c1
This option takes a file argument.
Packit Service 4684c1
This will override the default options in /etc/gnutls/pkcs11.conf
Packit Service 4684c1
@subsubheading provider-opts option.
Packit Service 4684c1
@anchor{p11tool provider-opts}
Packit Service 4684c1
Packit Service 4684c1
This is the ``specify parameters for the pkcs #11 provider library'' option.
Packit Service 4684c1
This option takes a string argument.
Packit Service 4684c1
This is a PKCS#11 internal option used by few modules.
Packit Service 4684c1
    Mainly for testing PKCS#11 modules.
Packit Service 4684c1
Packit Service 4684c1
@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
Packit Service 4684c1
@subsubheading batch option.
Packit Service 4684c1
@anchor{p11tool batch}
Packit Service 4684c1
Packit Service 4684c1
This is the ``disable all interaction with the tool'' option.
Packit Service 4684c1
In batch mode there will be no prompts, all parameters need to be specified on command line.
Packit Service 4684c1
@anchor{p11tool exit status}
Packit Service 4684c1
@subheading p11tool exit status
Packit Service 4684c1
Packit Service 4684c1
One of the following exit values will be returned:
Packit Service 4684c1
@table @samp
Packit Service 4684c1
@item 0 (EXIT_SUCCESS)
Packit Service 4684c1
Successful program execution.
Packit Service 4684c1
@item 1 (EXIT_FAILURE)
Packit Service 4684c1
The operation failed or the command syntax was not valid.
Packit Service 4684c1
@end table
Packit Service 4684c1
@anchor{p11tool See Also}
Packit Service 4684c1
@subheading p11tool See Also
Packit Service 4684c1
    certtool (1)
Packit Service 4684c1
@anchor{p11tool Examples}
Packit Service 4684c1
@subheading p11tool Examples
Packit Service 4684c1
To view all tokens in your system use:
Packit Service 4684c1
@example
Packit Service 4684c1
$ p11tool --list-tokens
Packit Service 4684c1
@end example
Packit Service 4684c1
Packit Service 4684c1
To view all objects in a token use:
Packit Service 4684c1
@example
Packit Service 4684c1
$ p11tool --login --list-all "pkcs11:TOKEN-URL"
Packit Service 4684c1
@end example
Packit Service 4684c1
Packit Service 4684c1
To store a private key and a certificate in a token run:
Packit Service 4684c1
@example
Packit Service 4684c1
$ p11tool --login --write "pkcs11:URL" --load-privkey key.pem \
Packit Service 4684c1
          --label "Mykey"
Packit Service 4684c1
$ p11tool --login --write "pkcs11:URL" --load-certificate cert.pem \
Packit Service 4684c1
          --label "Mykey"
Packit Service 4684c1
@end example
Packit Service 4684c1
Note that some tokens require the same label to be used for the certificate
Packit Service 4684c1
and its corresponding private key.
Packit Service 4684c1
Packit Service 4684c1
To generate an RSA private key inside the token use:
Packit Service 4684c1
@example
Packit Service 4684c1
$ p11tool --login --generate-privkey rsa --bits 1024 --label "MyNewKey" \
Packit Service 4684c1
          --outfile MyNewKey.pub "pkcs11:TOKEN-URL"
Packit Service 4684c1
@end example
Packit Service 4684c1
The bits parameter in the above example is explicitly set because some
Packit Service 4684c1
tokens only support limited choices in the bit length. The output file is the
Packit Service 4684c1
corresponding public key. This key can be used to general a certificate
Packit Service 4684c1
request with certtool.
Packit Service 4684c1
@example
Packit Service 4684c1
certtool --generate-request --load-privkey "pkcs11:KEY-URL" \
Packit Service 4684c1
   --load-pubkey MyNewKey.pub --outfile request.pem
Packit Service 4684c1
@end example