OPENSC.CONF(5)

๐ŸŒธ NAME ๐ŸŒธ

Bestie, this is the manual page for opensc.conf(5) โ€” aka opensc.conf, the configuration file for OpenSC. Thatโ€™s the whole name section, but make it cute: itโ€™s the config file that tells OpenSC how to behave. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so OpenSC gets its configuration data from these sources, in this exact order:

  1. command-line options
  2. environment variables
  3. Windows registry key in HKEY_CURRENT_USER (if available)
  4. Windows registry key in HKEY_LOCAL_MACHINE (if available)
  5. system-wide configuration file (/etc/opensc.conf)

The configuration file, opensc.conf, is composed of blocks, which, in general, have this format:

key [, name...] {
     block_contents
}

block_contents is one or more block_items, where a block_item is one of:

  • # comment string
  • key[, name...] = value;
  • block

At the root level, opensc.conf should contain one or more application-specific configuration blocks:

app application {
     block_contents
}

application specifies one of:

  • filename: Configuration block for the application with specified file path.
  • default: The fall-back configuration block for all applications.
  • opensc-pkcs11: Configuration block for the PKCS#11 module (opensc-pkcs11.so).
  • onepin-opensc-pkcs11: Configuration block for the PKCS#11 one-PIN-module (onepin-opensc-pkcs11.so).
  • cardmod: Configuration block for Windows' minidriver (opensc-minidriver.dll).
  • cardos-tool, cryptoflex-tool, dnie-tool, egk-tool, eidenv, gids-tool, iasecc-tool, netkey-tool, npa-tool, openpgp-tool, opensc-asn1, opensc-explorer, opensc-notify, opensc-tool, piv-tool, pkcs11-tool, pkcs15-crypt, pkcs15-init, pkcs15-tool, sc-hsm-tool, westcos-tool: Configuration block for OpenSC tools.

โœจ CONFIGURATION OPTIONS โœจ

  • debug = num; โ€” Amount of debug info to print (Default: 0). A greater value means more debug info.

The environment variable OPENSC_DEBUG overwrites this setting.

  • debug_file = filename; โ€” The file to which debug output will be written (Default: stderr). Special values stdout and stderr are recognized.
  • profile_dir = filename; โ€” PKCS#15 initialization/personalization profiles directory for pkcs15-init(1) (Default: /usr/share/opensc).

If this configuration value is not found on Windows, the registry key Software\OpenSC Project\OpenSC\ProfileDir is checked.

  • disable_colors = bool; โ€” Disable colors of log messages (Default: false if attached to a console, true otherwise).
  • disable_popups = bool; โ€” Disable pop-ups of built-in GUI (Default: false).
  • enable_default_driver = bool; โ€” Enable default card driver (Default: false). Default card driver is explicitly enabled for opensc-explorer(1) and opensc-tool(1).
  • card_drivers = name...; โ€” Allowlist of card drivers to load at start-up. The special value internal (the default) will load all statically linked drivers.

If an unknown (i.e. not internal or old) driver is supplied, a separate configuration block has to be written for the driver. A special value old will load all statically linked drivers that may be removed in the future.

The list of supported card driver names can be retrieved from the output of opensc-tool --list-drivers.

The environment variable OPENSC_DRIVER overwrites this setting.

  • ignored_readers = name...; โ€” List of readers to ignore (Default: empty). If any of the comma separated strings listed is matched in a reader name (case sensitive, partial matching possible), the reader is ignored by OpenSC. Use opensc-tool --list-readers to see all currently connected readers.
  • reader_driver name { block_contents } โ€” Configuration of the smart card reader driver, where name is one of:
    • ctapi: See the section called โ€œConfiguration of CT-API Readersโ€.
    • pcsc: See the section called โ€œConfiguration of PC/SC Readersโ€.
    • openct: See the section called โ€œConfiguration of OpenCT Readersโ€.
    • cryptotokenkit: Configuration block for CryptoTokenKit readers.

See the section called โ€œConfiguration of Smart Card Reader Driverโ€.

  • card_driver name { block_contents } โ€” Configuration of the card driver, where name is one of:
    • npa: See the section called โ€œConfiguration Options for German ID Cardโ€.
    • dnie: See the section called โ€œConfiguration Options for DNIeโ€.
    • edo: See the section called โ€œConfiguration Options for Polish eID Cardโ€.
    • eoi: See the section called โ€œConfiguration Options for Slovenian eID Cardโ€.
    • myeid: See the section called โ€œConfiguration Options for MyEID Cardโ€.
    • dtrust: See the section called โ€œConfiguration Options for D-Trust Signature Cardsโ€.
    • Any other value: Configuration block for an externally loaded card driver.
  • card_atr hexstring { block_contents } โ€” In addition to the built-in list of known cards in the card driver, you can configure a new card for the driver using the card_atr block.

For details see the section called โ€œConfiguration based on ATRโ€.

  • disable_hw_pkcs1_padding = value; โ€” Disabling PKCS#1 v1.5 padding in HW when card supports doing raw RSA operations. Known parameters:
    • no: PKCS#1 v1.5 padding is enabled in HW when card supports it.
    • sign: PKCS#1 v1.5 padding is disabled only for signatures (PKCS#1 v1.5 type 1).
    • decipher: PKCS#1 v1.5 padding is disabled only for decryption (PKCS#1 v1.5 type 2).
    • both: PKCS#1 v1.5 padding is disabled both for signatures and decryption (PKCS#1 v1.5 type 1 and 2).

(Default: decipher).

  • openssl_config = path; โ€” Specify a OpenSSL configuration file to be loaded into the OpenSC's library context. This should not be needed for general operation, but is needed if you need to configure some specifics of OpenSSL, without the need to rebuild OpenSC (for example configure and load a FIPS provider). For more information about configuring OpenSSL, see config(5) and fips_config(5). (Default: empty).
  • secure_messaging name { block_contents } โ€” Configuration options for the secure messaging profile name:
    • module_name = filename; โ€” Name of external SM module (Default: libsmm-local.so).
    • module_path = filename; โ€” Directory with external SM module (Default: /usr/lib).

If this configuration value is not found on Windows, the registry key Software\OpenSC Project\OpenSC\SmDir is checked.

  • module_data = value; โ€” Specific data to tune the module initialization.
  • mode = value; โ€” Secure messaging mode. Known parameters:
    • transmit: In this mode the procedure to securize an APDU is called by the OpenSC general APDU transmit procedure. In this mode all APDUs, except the ones filtered by the card specific procedure, are securized.
    • acl: In this mode APDU are securized only if needed by the ACLs of the command to be executed.
  • flags = value; โ€” Secure messaging type specific flags.
  • kmc = hexstring; โ€” Default KMC of the GP Card Manager for the Oberthur's Java cards.
  • ifd_serial = hexstring; โ€” a hexstring value.
  • keyset[_aid]_num_enc = value; keyset[_aid]_num_mac = value; โ€” Keyset values from IAM profiles of the Gemalto IAS/ECC cards with an optional application identifier.
  • framework name { block_contents } โ€” Internal configuration options where name is one of:
    • pkcs15: See the section called โ€œConfiguration of PKCS#15 Frameworkโ€.
  • pkcs11 { block_contents } โ€” Parameters for the OpenSC PKCS11 module.

For details see the section called โ€œConfiguration of PKCS#11โ€.

๐Ÿ› ๏ธ Configuration of Smart Card Reader Driver ๐Ÿ› ๏ธ

๐Ÿ’ซ Configuration Options for all Reader Drivers ๐Ÿ’ซ

  • max_send_size = num; max_recv_size = num; โ€” Limit command and response sizes (Default: max_send_size = 255, max_recv_size = 256). Some Readers don't propagate their transceive capabilities correctly. max_send_size and max_recv_size allow setting the limits manually, for example to enable extended length capabilities.
  • enable_escape bool; โ€” Detect reader capabilities with escape commands (wrapped APDUs with CLA=0xFF as defined by PC/SC pt. 3 and BSI TR-03119, e.g. for getting the UID, escaped PIN commands and the reader's firmware version, Default: false).

๐Ÿ”Œ Configuration of CT-API Readers ๐Ÿ”Œ

  • module filename { ports = nums; } โ€” Load the specified CT-API module with the specified number of ports.

๐Ÿ’ณ Configuration of PC/SC Readers ๐Ÿ’ณ

  • connect_exclusive = bool; โ€” Connect to reader in exclusive mode (Default: false)? This option has no effect in Windows' minidriver.
  • disconnect_action = action; โ€” What to do when disconnecting from a card (SCardDisconnect). Valid values are leave, reset, unpower (Default: leave). This option has no effect in Windows' minidriver.
  • transaction_end_action = action; โ€” What to do at the end of a transaction (SCardEndTransaction). Valid values are leave, reset, unpower (Default: leave). This option has no effect in Windows' minidriver.
  • reconnect_action = action; โ€” What to do when reconnection to a card (SCardReconnect). Valid values are leave, reset, unpower (Default: leave). This option has no effect in Windows' minidriver.
  • enable_pinpad = bool; โ€” Enable pinpad if detected (PC/SC v2.0.2 Part 10, Default: true).
  • fixed_pinlength = num; โ€” Some pinpad readers can only handle one exact length of the PIN. fixed_pinlength sets this value so that OpenSC expands the padding to this length (Default: 0, i.e. not fixed).
  • provider_library = filename; โ€” Use specific PC/SC provider (Default: libpcsclite.so.1).

๐ŸŒ Configuration of OpenCT Readers ๐ŸŒ

  • readers = num; โ€” Virtual readers to allocate (Default: 2).

๐Ÿ’– Configuration Options for MyEID Card ๐Ÿ’–

  • disable_hw_pkcs1_padding = bool; โ€” okay so listen, the MyEID card is lowkey smart enough to wrap the data (that's the hash code, bestie) into a DigestInfo ASN.1 structure all by itself, following whichever hash algorithm you picked (rn it's only doing this for SHA1 tho). That DigestInfo then gets padded up to the RSA key modulus length per PKCS#1 v1.5, block type 01h. Important bit: the size of the DigestInfo must not exceed 40% of the RSA key modulus length. If that limit is giving you problems (like, someone out here needs RSA 1024 with SHA512 ๐Ÿ˜ญ), you can just turn this feature off. When it's off, the card driver does literally everything necessary before sending the data (hash code) over to the card. Slay.
Heads up: PKCS#1 v1.5 padding in HW can be globally disabled with the option disable_hw_pkcs1_padding. And when the global option kills the padding, it stays killed โ€” even if the MyEID-specific option doesn't turn it off. Yeah. That's the vibe. ๐Ÿ™ˆ

๐ŸŽ€ Configuration Options for German ID Card ๐ŸŽ€

  • can = value; โ€” the German ID card needs the CAN verified before the QES PIN. The catch? That's not part of the PKCS#15 profile of the card. So for verifying the QES PIN we genuinely need both. You can drop the CAN here. If you don't, it'll get prompted on the command line or on the reader (depends on what your reader can actually do โœจ).
  • st_dv_certificate = filename; st_certificate = filename; st_key = filename; โ€” QES is only possible with a Comfort Reader (CAT-K), because that reader holds a cryptographic key so it can authenticate itself as a signature terminal (ST). Normally we just use the reader's own capability to sign the data. BUT โ€” during development you may specify soft certificates and keys for a ST. ๐Ÿงš

An example PKI can be found in the example data for the German ID card emulator[1].


๐Ÿฆ‹ Configuration Options for DNIe ๐Ÿฆ‹

  • user_consent_enabled = bool; โ€” configures the warning message that shows up when you do a signature operation with the DNIe. Only used if compiled with --enable-dnie-ui ๐Ÿ‘€
  • user_consent_app = filename; โ€” sets the pinentry application to use if the warning is configured to be displayed using pinentry (Default: /usr/bin/pinentry). Only used if compiled with --enable-dnie-ui.

๐ŸŒธ Configuration Options for Polish eID Card ๐ŸŒธ

  • can = value; โ€” the CAN (Card Access Number โ€“ that 6 digit number printed on the right bottom corner of the front side of the document, iykyk) is required to establish a connection with the card. It might be overwritten by the EDO_CAN environment variable. Currently, it is not possible to set it in any other way. That's the whole story, bestie. ๐Ÿ’…

โญ Configuration Options for Slovenian eID Card โญ

  • can = value; โ€” CAN (Card Access Number โ€“ 6 digit number printed on the right bottom corner of the front side of the document) is required to establish that connection. It might be overwritten by the EOI_CAN environment variable. And here's the cute part: since the CAN is also stored on the card (in encrypted form), it can be used to automatically establish a secure connection โ€” but only if the card is accessed over the contact interface. Magnetic. ๐Ÿงฒ

๐Ÿ‘‘ Configuration Options for D-Trust Signature Cards ๐Ÿ‘‘

  • can = value; โ€” CAN (Card Access Number โ€“ 6 digit number printed on the front side of the card) is required to establish connection with the card. It might be overwritten by the DTRUST_CAN environment variable. If you don't specify it here, the CAN gets read from a card specific cache, prompted on the card reader's PIN pad, or prompted interactively โ€” in exactly this order:
    1. Environment variable DTRUST_CAN
    2. This configuration file option
    3. PKCS#15 card-specific cache
    4. Pin pad of a PACE-capable card reader
  • can_use_cache = bool; โ€” caches the CAN number of a card once the user has provided it, in the directory file_cache_dir. That cached CAN gets used later so you don't have to sit there interactively typing it in again (we love efficiency ๐Ÿซถ). This feature is enabled by default.

๐ŸŒˆ Configuration Options for PIV Card ๐ŸŒˆ

๐Ÿ”ฅ Configuration based on ATR ๐Ÿ”ฅ

  • atrmask = hexstring; โ€” this mask gets logically AND'd with a card ATR before it's compared with the ATR reference value above. Using the mask lets you identify and configure multiple ATRs as the same card model. Iconic multitasking behavior tbh.
  • driver = name; โ€” when enabled, overrides all possible settings from the card driver's built-in card configuration list. Yeah, all of them. ๐Ÿ˜ค
  • name = name; โ€” sets the card name, for the card drivers that allow it.
  • type = num; โ€” lets you set the exact type of the card, internally used by the card driver. Allowed values can be found in the source code of cards.h.
  • flags = value...; โ€” card flags as a hex value. Multiple values get OR'd together. Depending on the card driver, this lets you fine-tune the capabilities in the card driver for your card. โœจ

Optionally, some known parameters can be specified as strings:

  • rng: on-board random number source
  • keep_alive: request the card driver to send a "keep alive" command before each transaction, to make sure the required applet is still selected
  • pkcs15emu = name; โ€” when using PKCS#15 emulation, forces the emulation driver for specific cards. Required for external drivers, but can be used with built-in drivers too. No gatekeeping here ๐Ÿ’œ
  • force_protocol = value; โ€” forces protocol selection for specific cards. Known parameters:
    • t0
    • t1
    • raw
  • read_only = bool; โ€” marks the card as a read/only card in the PKCS#11/Minidriver/BaseCSP interface (Default: false).
  • md_supports_X509_enrollment = bool; โ€” indicates X509 enrollment support at the Minidriver/BaseCSP interface (Default: false).
  • md_guid_as_id = bool; โ€” uses the GUID generated for the key as id in the PKCS#15 structure (Default: false, i.e. auto generated).
  • md_guid_as_label = bool; โ€” uses the GUID generated for the key as label in the PKCS#15 structure (Default: false, i.e. no label set).
  • md_supports_container_key_gen = bool; โ€” card allows generating key pairs on the card (Default: false).
  • md_supports_container_key_import = bool; โ€” card allows importing private keys (Default: false).
  • md_pinpad_dlg_title = value; โ€” window title of the PIN pad dialog (Default: "Windows Security").
  • md_pinpad_dlg_icon = filename; โ€” filename of the icon for the PIN pad dialog; use "" for no icon (Default: built-in smart card icon).
  • md_pinpad_dlg_main = value; โ€” main instruction of the PIN pad dialog (Default: "OpenSC Smart Card Provider").
  • md_pinpad_dlg_content_user = value; โ€” content of the PIN pad dialog for role "user" (Default: "Please enter your PIN on the PIN pad.").
  • md_pinpad_dlg_content_user_sign = value; โ€” content of the PIN pad dialog for role "user+signature" (Default: "Please enter your digital signature PIN on the PIN pad.").
  • md_pinpad_dlg_content_admin = value; โ€” content of the PIN pad dialog for role "admin" (Default: "Please enter your PIN to unblock the user PIN on the PIN pad.")
  • md_pinpad_dlg_expanded = value; โ€” expanded information of the PIN pad dialog (Default: "This window will be closed automatically after the PIN has been submitted on the PIN pad (timeout typically after 30 seconds).")
  • md_pinpad_dlg_enable_cancel = bool; โ€” allows the user to cancel the PIN pad dialog (Default: false). If this value is set to true, the user needs to click "OK" to start the PIN verification on the PIN pad. The user can choose the default behavior by enabling or disabling the checkbox of the dialog. The setting is saved by the program's full path (program_path) that uses OpenSC.
Okay this part is very specific so pay attention ๐Ÿ’€ โ€” the registry key HKCU\Software\OpenSC Project\OpenSC\md_pinpad_dlg_enable_cancel\program_path overwrites this setting with a DWORD set to either 1 (enabled) or 0 (disabled).
  • md_pinpad_dlg_timeout = num; โ€” time in seconds for the progress bar of the PIN pad dialog to tick. 0 removes the progress bar (Default: 30).
  • notify_card_inserted = value; notify_card_inserted_text = value; โ€” notification title and text when the card was inserted (Default: "Smart card detected", ATR of the card).
  • notify_card_removed = value; notify_card_removed_text = value; โ€” notification title and text when the card was removed (Default: "Smart card removed", name of smart card reader).
  • notify_pin_good = value; notify_pin_good_text = value; โ€” notification title and text when the PIN was verified (Default: "PIN verified", "Smart card is unlocked").
  • notify_pin_bad = value; notify_pin_bad_text = value; โ€” notification title and text when the PIN was wrong (Default: "PIN not verified", "Smart card is locked").

๐Ÿ’œ Configuration of PKCS#15 Framework ๐Ÿ’œ

  • use_file_caching = value; โ€” whether to cache the card's files (like certificates, bestie) on disk in file_cache_dir. Possible parameters:
    • yes: cache all files (public and private).
    • public: cache only public files.
    • no: file caching disabled.

(Default: public for the following card drivers: atrust-acos (deactivated driver), belpic, cac1, cac, coolkey, dnie, edo, esteid2018, esteid2025, flex (deactivated driver), cyberflex (deactivated driver), gemsafeV1, idprime, itacns, jpki, MaskTech, mcrd (deactivated driver), npa, nqapplet, tcos, dtrust โ€” and otherwise no).

โš ๏ธ Real talk: if caching is done by a system process, the cached files may be placed inaccessible from the user account. So use a globally readable and writable location if you wish to share the cached information. And note that the cached files may contain personal data such as name and mail address. Privacy check, always. ๐Ÿ™ˆ
  • file_cache_dir = filename; โ€” where to cache the card's files. The default values are:
    • $XDG_CACHE_HOME/opensc/ (if $XDG_CACHE_HOME is defined)
    • $HOME/.cache/opensc/ (Unix)
    • $USERPROFILE\.eid-cache\ (Windows)
โš ๏ธ Same warning as above, fr fr: if caching is done by a system process, the cached files may be placed inaccessible from a user account. Use a globally readable and writable location if you wish to share the cached information. Note that the cached files may contain personal data such as name and mail address. ๐Ÿ“

The PIV-II card driver supports the history object's list of retired keys and certificates if they are readable in the file cache directory. If the specified object's URL is "http://"DNS name"/"ASCII-HEX OffCardKeyHistoryFile, then the searches for the file name OffCardKeyHistoryFile in the cache directory. (Yes, that's exactly how it's written, don't come for me ๐Ÿ‘‘)

  • use_pin_caching = bool; โ€” use PIN caching (Default: true)? Your call, bestie.
  • pin_cache_counter = num; โ€” how many times to use a PIN from the cache before re-authenticating it (Default: 10)?
  • pin_cache_ignore_user_consent = bool; โ€” okay so older PKCS#11 apps that don't support CKA_ALWAYS_AUTHENTICATE may need this set to get signatures working with some cards. Default: false. It's recommended to also enable PIN caching using the use_pin_caching option so OpenSC can provide the PIN for the card when needed. ๐Ÿ’–
  • pin_protected_certificate = value; โ€” how to handle a PIN-protected certificate. Known parameters (default: protect):
    • protect โ€” the certificate stays PIN-protected.
    • declassify โ€” allow reading the certificate without enforcing verification of the PIN.
    • ignore โ€” ignore PIN-protected certificates.
  • enable_pkcs15_emulation = bool; โ€” enable pkcs15 emulation. Default: true. โœจ
  • try_emulation_first = bool; โ€” prefer the pkcs15 emulation code before the normal pkcs15 processing. Default: no. Some cards work in emu-only mode, and do not depend on this option.
  • enable_builtin_emulation = bool; โ€” enable builtin emulators. Default: true.
  • builtin_emulators = emulators; โ€” list of the builtin pkcs15 emulators to test. Default: internal.
    • Special value internal will try all not disabled builtin pkcs15 emulators.
    • Special value old will try all disabled pkcs15 emulators.
  • pkcs11_enable_InitToken = bool; โ€” enable initialization and card recognition. Default: false.
  • emulate name { block_contents } โ€” configuration options for a PKCS#15 emulator, where name is a short name for an external card driver.
    • module = filename; โ€” for pkcs15 emulators loaded from an external shared library/DLL, you need to specify the path name of the module and customize the card_atr example above correctly.
    • function = name; โ€” get the init function name of the emulator. Default: sc_pkcs15_init_func_ex.
  • application hexstring { block_contents } โ€” configuration of the on-card-application, where hexstring is the application identifier (AID).
    • type = name; โ€” type of application, where name is one of generic or protected. Used to distinguish the common access application and application for which authentication to perform some operation cannot be obtained with the common procedures (ex. object creation protected by secure messaging). Used by PKCS#11 module configured to expose restricted number of slots. (for ex. configured to expose only User PIN slot, User and Sign PINs slots, ...)
    • model = name;
    • disable = bool; โ€” do not expose application in PKCS#15 framework. Default: false.
    • user_pin = name; โ€” name of the User PIN object that will be used as the main PIN.
    • sign_pin = name; โ€” name of the PIN object that will be used for signing.

๐Ÿ’ณ Configuration of PKCS#11 ๐Ÿ’ณ

  • max_virtual_slots = num; โ€” maximum Number of virtual slots. Default: 16. If there are more slots than defined here, the remaining slots will be hidden from PKCS#11.
  • slots_per_card = num; โ€” maximum number of PIN slots per smart card. Default: 4. If the card has fewer PINs than defined here, the remaining number of slots will be empty. For Firefox, Chrome and Chromium, the slots_per_card is set to 1, to avoid prompting for unrelated PINs. Typically, this effectively disables signature PINs and keys.
  • lock_login = bool; โ€” by default, the OpenSC PKCS#11 module will not lock your card once you authenticate to the card via C_Login. Default: false. Thus other users or other applications are not prevented from connecting to the card and performing crypto operations (which may be possible because you have already authenticated with the card). โš ๏ธ This setting is not very secure.

Also, if your card is not locked, you can enconter problems due to limitation of the OpenSC framework, that still is not thoroughly tested in the multi threads environment.

Your settings will be more secure if you choose to lock your card. Nevertheless this behavior is a known violation of PKCS#11 specification. Now once one application has started using your card with C_Login, no other application can use it, until the first is done and calls C_Logout or C_Finalize. In the case of many PKCS#11 application this does not happen until you exit the application.

Thus it is impossible to use several smart card aware applications at the same time, e.g. you cannot run both Firefox and Thunderbird at the same time, if both are configured to use your smart card. ๐Ÿ˜ญ

  • atomic = bool; โ€” by default, interacting with the OpenSC PKCS#11 module may change the state of the token, e.g. whether a user is logged in or not. Default: false.

Thus other users or other applications may change or use the state of the token unknowingly. Other applications may create signatures abusing an existing login or they may logout unnoticed.

With this setting enabled the login state of the token is tracked and cached (including the PIN). Every transaction is preceded by restoring the login state. After every transaction a logout is performed. This setting by default also enables lock_login to disable access for other applications during the atomic transactions.

Please note that any PIN-pad should be disabled (see enable_pinpad), because the user would have to input his PIN for every transaction. ๐Ÿซถ

  • init_sloppy = bool; โ€” with this setting disabled, the OpenSC PKCS#11 module will initialize the slots available when the application calls C_GetSlotList. With this setting enabled, the slots will also get initialized when C_GetSlotInfo is called. Default: true.

This setting is a workaround for Java which does not call C_GetSlotList when configured with a static slot instead of slotListIndex.

  • user_pin_unblock_style = mode; โ€” User PIN unblock style mode is one of:
    • none (Default): PIN unblock is not possible with PKCS#11 API.
    • set_pin_in_unlogged_session: C_SetPIN in unlogged session: PUK is passed as the OldPin argument of the C_SetPIN call.
    • set_pin_in_specific_context: C_SetPIN in the CKU_SPECIFIC_CONTEXT logged session: PUK is passed as the OldPin argument of the C_SetPIN call.
    • init_pin_in_so_session: C_InitPIN in CKU_SO logged session: User PIN 'UNBLOCK' is protected by SOPIN. (PUK == SOPIN).
  • create_puk_slot = bool; โ€” create slot for unblocking PIN with PUK. Default: false. This way PKCS#11 API can be used to login with PUK and change a PIN. May cause problems with some applications like Firefox and Thunderbird.
  • create_slots_for_pins = mode...; โ€” symbolic names of PINs for which slots are created, where mode is a list of:
    • all (Default): All non-SO-PIN, non-unblocking PINs.
    • user: The first global or first local PIN.
    • sign: The second PIN (first local, second global or second local).

A card can contain more than one PIN or more than one on-card application with its own PINs. Normally, to access all of them with the PKCS#11 API a slot has to be created for all of them. Many slots could be annoying for some of widely used application, like FireFox. This configuration parameter allows to select the PIN(s) for which PKCS#11 slot will be created.

Only PINs initialised, non-SO-PIN, non-unblocking are associated with symbolic name.

For the module to simulate the opensc-onepin module behavior the following option create_slots_for_pins = "user";


๐ŸŒธ ENVIRONMENT ๐ŸŒธ

  • OPENSC_CONF โ€” filename for a user defined configuration file. If this environment variable is not found on Windows, the registry key Software\OpenSC Project\OpenSC\ConfigFile is checked.
  • OPENSC_DEBUG โ€” see debug = num;.
  • OPENSC_DRIVER โ€” see card_drivers = name...;.
  • CARDMOD_LOW_LEVEL_DEBUG โ€” write minidriver debug information to C:\tmp\md.log, if set to 1. If this environment variable is not found on Windows, the registry key Software\OpenSC Project\OpenSC\MiniDriverDebug is checked.
  • PIV_EXT_AUTH_KEY, PIV_9A_KEY, PIV_9C_KEY, PIV_9D_KEY, PIV_9E_KEY โ€” PIV configuration during initialization with piv-tool.
  • PIV_USE_SM, PIV_PAIRING_CODE โ€” PIV configuration during initialization. See Configuration Options for PIV Card.

๐ŸŽ€ FILES ๐ŸŽ€

  • /etc/opensc.conf โ€” system-wide configuration file.
  • /usr/share/doc/opensc/opensc.conf โ€” extended example configuration file.

๐Ÿ’€ NOTES ๐Ÿ’€

  1. German ID card emulator โ€” https://github.com/frankmorgner/vsmartcard/tree/master/virtualsmartcard/npa-example-data

Later, bestie โ€” the footer vibe is source/version opensc, date 06/02/2026, and page OPENSC.CONF(5). periodt ๐Ÿ’…

๐Ÿ“ฆ where this page comes from