table of contents
| PKCS15-INIT(1) | OpenSC tools | PKCS15-INIT(1) |
NAME¶
pkcs15-init - smart card personalization utilityDESCRIPTION¶
The pkcs15-init utility can be used to create a PKCS #15 structure on a smart card, and add key or certificate objects. Details of the structure that will be created are controlled via profiles. The profile used by default is pkcs15. Alternative profiles can be specified via the -p switch.PIN USAGE¶
MODES OF OPERATION¶
Initialization¶
This is the first step during card personalization, and will create the basic files on the card. To create the initial PKCS #15 structure, invoke the utility asUser PIN Installation¶
Before installing any user objects such as private keys, you need at least one PIN to protect these objects. you can do this usingKey generation¶
Private Key Download¶
You can use a private key generated by other means and download it to the card. For instance, to download a private key contained in a file named okir.pem, which is in PEM format, you would usePublic Key Download¶
You can also download individual public keys to the card using the --store-public-key option, which takes a filename as an argument. This file is supposed to contain the public key. If you don't specify a key file format using the --format option, pkcs15-init will assume PEM format. The only other supported public key file format is DER. Since the corresponding public keys are always downloaded automatically when generating a new key, or when downloading a private key, you will probably use this option only very rarely.Certificate Download¶
You can download certificates to the card using the --store-certificate option, which takes a filename as an argument. This file is supposed to contain the PEM encoded X.509 certificate.Downloading PKCS #12 bags¶
Most browsers nowadays use PKCS #12 format files when you ask them to export your key and certificate to a file. pkcs15-init is capable of parsing these files, and storing their contents on the card in a single operation. This works just like storing a private key, except that you need to specify the file format:OPTIONS¶
--profile name, -p nameTells pkcs15-init to load the specified
general profile. Currently, the only application profile defined is
pkcs15, but you can write your own profiles and specify them using this
option.
The profile name can be combined with one or more profile options, which
slightly modify the profile's behavior. For instance, the default OpenSC
profile supports the openpin option, which installs a single PIN during
card initialization. This PIN is then used both as the SO PIN as well as the
user PIN for all keys stored on the card.
Profile name and options are separated by a + character, as in
pkcs15+onepin.
--card-profile name, -c name
Tells pkcs15-init to load the specified
card profile option. You will rarely need this option.
--create-pkcs15, -C
This tells pkcs15-init to create a PKCS
#15 structure on the card, and initialize any PINs.
--erase-card, -E
This will erase the card prior to creating the
PKCS #15 structure, if the card supports it. If the card does not support
erasing, pkcs15-init will fail.
--generate-key keyspec, -G keyspec
Tells the card to generate new key and store
it on the card. keyspec consists of an algorithm name (currently, the
only supported name is RSA), optionally followed by a slash and the
length of the key in bits. It is a good idea to specify the key ID along with
this command, using the id option, otherwise an intrinsic ID will be
calculated from the key material. Look the description of the
'pkcs15-id-style' attribut in the 'pkcs15.profile' for the details about the
algorithm used to calculate intrinsic ID. For the multi-application cards the
target PKCS#15 application can be specified by the hexadecimal AID value of
the aid option.
--store-private-key filename, -S filename
Tells pkcs15-init to download the
specified private key to the card. This command will also create a public key
object containing the public key portion. By default, the file is assumed to
contain the key in PEM format. Alternative formats can be specified using
--format. It is a good idea to specify the key ID along with this
command, using the --id option, otherwise an intrinsic ID will be
calculated from the key material. Look the description of the
'pkcs15-id-style' attribut in the 'pkcs15.profile' for the details about the
algorithm used to calculate intrinsic ID. For the multi-application cards the
target PKCS#15 application can be specified by the hexadecimal AID value of
the aid option.
--store-public-key filename
Tells pkcs15-init to download the
specified public key to the card and create a public key object with the key
ID specified via the --id. By default, the file is assumed to contain
the key in PEM format. Alternative formats can be specified using
--format.
--store-certificate filename, -X filename
Tells pkcs15-init to store the
certificate given in filename on the card, creating a certificate
object with the ID specified via the --id option. Without supplied ID
an intrisic ID will be calculated from the certificate's public key. Look the
description of the 'pkcs15-id-style' attribut in the 'pkcs15.profile' for the
details about the algorithm used to calculate intrinsic ID. The file is
assumed to contain the PEM encoded certificate. For the multi-application
cards the target application can be specified by the hexadecimal AID value of
the aid option.
--update-certificate filename, -U filename
Tells pkcs15-init to update the
certificate object with the ID specified via the --id option with the
certificate in filename. The file is assumed to contain a PEM encoded
certificate.
Pay extra attention when updating mail decryption certificates, as missing
certificates can render e-mail messages unreadable!
--use-default-transport-keys, -T
Tells pkcs15-init to not ask for the
transport keys and use default keys, as known by the card driver.
--so-pin, --so-puk, --pin, --puk
These options can be used to specify PIN/PUK
values on the command line. Note that on most operation systems, any user can
display the command line of any process on the system using utilities such as
ps(1). Therefore, you should use these options only on a secured
system, or in an options file specified with --options-file.
--options-file filename
Tells pkcs15-init to read additional
options from filename. The file is supposed to contain one long option
per line, without the leading dashes, for instance:
You can specify --options-file several times.
--verbose, -v
pin frank puk zappa
Causes pkcs15-init to be more verbose.
Specify this flag several times to enable debug output in the OpenSC
library.
SEE ALSO¶
pkcs15-profile(5)| 06/03/2012 | opensc |