PKCS15-TOOL(1)
๐ PKCS15-TOOL โ the OpenSC tool, bestie edition ๐
okay so. this is pkcs15-tool(1), from the OpenSC Tools gang, and it's literally the utility for manipulating PKCS #15 data structures on smart cards and similar security tokens. yes, actual little plastic cards with actual secrets inside. icon behavior. ๐
โจ NAME โจ
pkcs15-tool โ a utility for manipulating PKCS #15 data structures on smart cards and similar security tokens. ๐ฆ
๐ธ SYNOPSIS ๐ธ
pkcs15-tool [OPTIONS]
that's it. that's the whole vibe. options only, no positional args, she's low-maintenance like that. ๐
๐ DESCRIPTION ๐
so the pkcs15-tool utility is used to manipulate the PKCS #15 data structures on smart cards and similar security tokens. that's the whole job description, periodt.
you can list and read PINs, keys and certificates stored on the token. and for the operations that need it, user PIN authentication gets performed โ like, the card wants to know it's really you before it spills the tea. ๐โจ
๐ฅ OPTIONS ๐ฅ
okay bestie, this is the long part, but every single one matters, so we're going through ALL of them, no skipping, no cap.
--versionโ prints the OpenSC package release version. that's it, that's the whole flag. quick lil flex. ๐ซ--aid aidโ specify, in hexadecimal form, the AID of the on-card PKCS#15 application you wanna bind to. hex, babe. hexadecimal. ๐งฎ--auth-id id,-a idโ specifies the auth id of the PIN to use for the operation. super useful when you're doing the--change-pinthing. ๐--change-pinโ changes a PIN or PUK stored on the token. user authentication is required for this one โ the card is NOT letting you in without it, fr fr. โ ๏ธ--dump,-Dโ lists all card objects. everything. the whole closet. ๐๏ธ--list-infoโ lists card objects. yes, similar energy to--dump, but she's her own thing, respect her. โจ--list-applicationsโ lists the on-card PKCS#15 applications. ๐--list-certificates,-cโ lists all certificates stored on the token. ๐--list-data-objects,-Cโ lists all data objects stored on the token. heads up though: for some cards, the PKCS#15 attributes of the private data objects are protected for reading and need authentication with the User PIN. in that case you gotta use the--verify-pinoption. ๐--list-keys,-kโ lists all private keys stored on the token. you get general info about each private key (eg. key name, id and algorithm). actual private key values are NOT displayed โ she's private, that's the point. ๐ also: for some cards, the PKCS#15 attributes of the private keys are protected for reading and need authentication with the User PIN, and in that case you have to use the--verify-pinoption. same deal as above.--list-secret-keysโ lists all secret (symmetric) keys stored on the token. general info about each secret key gets listed (eg. key name, id and algorithm), and the actual secret key values are not displayed. and yeah โ for some cards the PKCS#15 attributes of the private keys are protected for reading and need authentication with the User PIN, so in that case the--verify-pinoption has to be used. ๐ซฃ--list-pinsโ lists all PINs stored on the token. general info about each PIN is listed (eg. PIN name). the actual PIN values are not shown. obviously. bestie. ๐--list-public-keysโ lists all public keys stored on the token, including key name, id, algorithm and length information. public keys are the extroverts of the key world, they love being seen. ๐--short,-sโ outputs lists in compact format. minimal, clean, chef's kiss. ๐ค--no-cacheโ disables token data caching. ๐ซ--clear-cacheโ removes the user's cache directory. on Windows, this option additionally removes the system's caching directory โ and that one requires administrator privileges, so bring your admin crown. ๐โ ๏ธ--output filename,-o filenameโ specifies where key output should be written. iffilenamealready exists, it will be overwritten (no takebacks, no recycling bin, she's gone). if you don't give this option, keys get printed to standard output. ๐จ๏ธ--rawโ changes how--read-data-objectprints the content to standard output. by default, when--rawis not given, it prints the content in hex notation. if--rawis set, it prints the binary data directly. this does not affect the output written to the file specified by the--outputoption โ data written to a file is always in raw binary. so--rawis a stdout-only kind of girl. ๐--read-certificate certโ reads the certificate with the given id. ๐--read-data-object data,-R dataโ reads data object with OID, applicationName or label. the content is printed to standard output in hex notation, unless the--rawoption is given. if an output file is given with the--outputoption, the content is additionally written to the file. output to the file is always written in raw binary mode โ the--rawonly affects standard output behavior. got it? good. ๐--read-public-key idโ reads the public key with idid, letting you extract and store or use the public key. go get your key, bestie. ๐โจ--read-ssh-key idโ reads the public key with idid, writing the output in a format suitable for$HOME/.ssh/authorized_keys. the key label, if any, will be shown in the'Comment'field. ๐ฆ--rfc4716โ when used in conjunction with option--read-ssh-key, the output format of the public key follows rfc4716. ๐
the default output format is a single line (openssh). ๐ซถ
--test-update,-Tโ test if the card needs a security update. ๐งช--update,-Uโ update the card with a security update. ๐ง--reader argโ number of the reader to use. by default, the first reader with a present card is used. ifargis an ATR, the reader with a matching card will be chosen. so you can pick your fave. ๐ฏ--unblock-pin,-uโ unblocks a PIN stored on the token. knowledge of the Pin Unblock Key (PUK) is required for this operation, so no PUK, no entry. ๐--verbose,-vโ causespkcs15-toolto be more verbose. specify this flag several times to enable debug output in the OpenSC library. stack those-vs like accessories. ๐ ๐ ๐--pin pin,--new-pin newpin,--puk pukโ these options can be used to specify the PIN/PUK values on the command line. if the value is set toenv:VARIABLE, the value of the specified environment variable is used. by default, the code is prompted on the command line if needed.
โ ๏ธ note that on most operating systems, any user can display the command line of any process on the system using utilities such as ps(1). therefore, you should prefer passing the codes via an environment variable on an unsecured system. like. seriously. protect your PINs, bestie, that's not a vibe you want leaked. ๐ญ
--new-pin pinโ specify New PIN (when changing or unblocking). โจ--verify-pinโ verify PIN after card binding and before issuing any command (without'auth-id'the first non-SO, non-Unblock PIN will be verified). ๐--test-session-pinโ equivalent to--verify-pinwith additional session PIN generation. ๐--wait,-wโ causespkcs15-toolto wait for a card insertion. she'll just chill there, patiently, until you show up. โณ๐ซถ--use-pinpadโ do not prompt the user; if no PINs supplied, pinpad will be used. ๐ข
๐ SEE ALSO ๐
go read those too, they're the friend group. ๐ธ
๐ AUTHORS ๐
pkcs15-tool was written by Juha Yrjรถlรค <juha.yrjola@iki.fi>. thank you Juha, king behavior. ๐
and that's the whole page, bestie! this came to you from the opensc package, dated 04/19/2026, and it lives under the name PKCS15-TOOL(1). slay, go read some smart cards. ๐โจ๐๐ฆ๐ธ๐
๐ซถ
๐ฆ where this page comes from
- fedora 43: opensc 0.27.1-2.fc43 ยท LGPL-2.1-or-later AND BSD-3-Clause
- fedora 44: opensc 0.27.1-2.fc44 ยท LGPL-2.1-or-later AND BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms