table of contents
PKCS15-PROFILE(5) | OpenSC File Formats | PKCS15-PROFILE(5) |
NAME¶
pkcs15-profile - format of profile for pkcs15-init
DESCRIPTION¶
The pkcs15-init utility for PKCS #15 smart card personalization is controlled via profiles. When starting, it will read two such profiles at the moment, a generic application profile, and a card specific profile. The generic profile must be specified on the command line, while the card-specific file is selected based on the type of card detected.
The generic application profile defines general information about the card layout, such as the path of the application DF, various PKCS #15 files within that directory, and the access conditions on these files. It also defines general information about PIN, key and certificate objects. Currently, there is only one such generic profile, pkcs15.profile.
The card specific profile contains additional information required during card initialization, such as location of PIN files, key references etc. Profiles currently reside in /usr/share/opensc
Basic PKCS#15 terminology:
SYNTAX AND SEMANTICS¶
The block syntax of profile files is in general similar to the configuration file. The profile file, is composed of blocks, which, in general, have the following format:
key [, name...] { block_contents }
block_contents is one or more block_items where a block_item is one of
At the root level, the profile contains several configuration blocks. The block keys are as follows:
Profile file configuration¶
Configuration of Card Information
cardinfo { block_contents }
label = name;
manufacturer = name;
min-pin-length = int;
max-pin-length = int;
pin-encoding = value;
(Default: ascii-numeric).
pin-pad-char = value;
pin-domains = bool;
Configuration of PKCS#15
pkcs15 { block_contents }
direct-certificates = bool;
encode-df-length = bool;
do-last-update = value;
pkcs15-id-style = value;
minidriver-support-style = value;
(Default: none)
Configuration of Profile Option
option name { block_contents } .PP The name specifies profile options to modify the behavior of profile, it can be .PP .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . default: option specifies default settings and this block with option is always processed, .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . onepin: option for using 1 user PIN, creation/deletion/generation is controlled by the user PIN and thus by the user (as a result, only 1 user PIN is possible), .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . small option suitable for cards with small memory. .RE .sp .PP The options are used by pkcs15-init tool by --profile name, -p name: .PP .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . pkcs15+default: the default (not needed to specify it) .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . pkcs15+onepin: for the onepin profile option .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . pkcs15+small for the small profile option .RE .sp .PP The option block can contain following sub-blocks:
macros { block_contents }
pkcs15 { block_contents }
Configuration of PINs
PIN name { block_contents } .PP The name specifies PIN type, it can be .PP .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . pin or user-pin (no need to set file path or reference as it is done dynamically) .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . puk or user-puk .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . sopin or so-pin .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . sopuk or so-puk .RE .sp
attempts = int;
flags = value...;
(Default: local,initialized,needs-padding).
auth-id = value;
min-length = int;
max-length = int;
reference = int;
file = name;
offset = int;
encoding = value;
(Default: value pin-encoding set in cardinfo block).
stored-length = int;
max-unlocks = int;
Values in this block can be set by macros. That allows to specify the particular values with the usage of option.
Configuration of Filesystem
EF name { block_contents } .PP This block defines elementary file in PKCS#15 file hierarchy. The name can be one of: .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-TokenInfo .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-ODF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-UnusedSpace .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-PRKDF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-PUKDF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-PUKDF-TRUSTED .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-SKDF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-CDF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-CDF-TRUSTED .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-CDF-USEFUL .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-DODF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-AODF .RE .sp .PP The EF block can contain:
type = EF;
acl = value;
file-id = EF;
structure = value;
DF name { block_contents } .PP This block defines directory file in PKCS#15 file hierarchy. The name can be one of: .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . MF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . PKCS15-AppDF .RE .sp .RS 4 .ie n • . .el .sp -1 .IP • 2.3 . Special cases for those DFs handled separately by the PKCS15 logic .RE .sp .PP The DF block can contain:
type = DF;
path = value;
file-id = value;
aid = value;
acl = value;
size = int;
EF name { block_contents }
Typically, the root DF is MF.
It is mandatory that profile file contains DF entry for MF (Master File). Otherwise the profile file is incomplete and cannot be used.
The DF can contain other DF or MF blocks. For examples how the filesystem structure may look like, please refer to pkcs15.profile or any other present profile file.
SEE ALSO¶
12/23/2024 | opensc |