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-pin thing. ๐Ÿ‘‘
  • --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-pin option. ๐Ÿ’…
  • --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-pin option. 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-pin option 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. if filename already 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-object prints the content to standard output. by default, when --raw is not given, it prints the content in hex notation. if --raw is set, it prints the binary data directly. this does not affect the output written to the file specified by the --output option โ€” data written to a file is always in raw binary. so --raw is 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 --raw option is given. if an output file is given with the --output option, the content is additionally written to the file. output to the file is always written in raw binary mode โ€” the --raw only affects standard output behavior. got it? good. ๐Ÿ“
  • --read-public-key id โ€” reads the public key with id id, letting you extract and store or use the public key. go get your key, bestie. ๐Ÿ”‘โœจ
  • --read-ssh-key id โ€” reads the public key with id id, 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. if arg is 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 โ€” causes pkcs15-tool to 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 to env: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-pin with additional session PIN generation. ๐Ÿ”„
  • --wait, -w โ€” causes pkcs15-tool to 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