OPENSC-EXPLORER(1)
π OPENSC-EXPLORER π
okay bestie, gather round, because this is the OpenSC Tools manual page for opensc-explorer, and honestly? she's a whole vibe. a generic interactive utility for accessing smart card and similar security token functions. yes she does it all, no cap.
β¨ SYNOPSIS β¨
opensc-explorer [OPTIONS] [SCRIPT]
π¦ DESCRIPTION π¦
so the opensc-explorer utility can be used to perform miscellaneous operations, like exploring the contents of a smart card (or similar security token) or sending arbitrary APDU commands to it. she's giving multitasking icon.
if a SCRIPT is given, opensc-explorer runs in non-interactive mode, reading the commands from SCRIPT, one command per line. and if no script is given? she runs in interactive mode, reading commands from standard input. main character energy either way π
π OPTIONS π
these are the command-line options for opensc-explorer. lowkey important: there are additional interactive commands available once it's running, so don't think this is the whole menu.
--card-driverdriver,-cdriver β use the given card driver. the default is to auto-detect the correct card driver. and if you pass the literal value?it lists all available card drivers and then terminatesopensc-explorer. cute little easter egg, fr fr.--mfpath,-mpath β select the file referenced by the given path on startup. the default is the path to the standard master file,3F00. if path is empty (likeopensc-explorer --mf ""), then no file is explicitly selected. noted π--readerarg,-rarg β 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. she'll find your card, don't worry.--verbose,-vβ causeopensc-explorerto be more verbose. specify this flag several times to enable debug output in the opensc library. stack 'em up for maximum yapping π£οΈ--wait,-wβ wait for a card to be inserted. she'll be patient for you, bestie.
π COMMANDS π
opensc-explorer supports commands with arguments at its interactive prompt or in script files passed via the command line parameter SCRIPT.
similar to a command shell like, say, bash, each input line is split into white-space separated words. of those words, the first one is used as the command, while the remaining ones are treated as arguments to that command. iconic parsing behaviour, honestly.
the following commands are supported:
# ...β treat line as a comment. ignore anything until the end of the line introduced by#. silence is golden β¨apdudata... β send a custom APDU command to the card. data is a series of sequences of hexadecimal values and strings enclosed in double quotes ("...").asn1file-id [rec-no] [offs] β parse and print the ASN.1 encoded content of the working EF specified by file-id. if the optional parameter rec-no is given and the file is a record-oriented EF, parse and print only the record indicated by this parameter. if the optional parameter offs is given, start parsing and printing the file or record at the offset indicated by the value given. if this parameter is not given, the default offset is0.cat[file-id |sfi:short-id] [rec-no] β print the contents of the working EF specified by file-id or the short file id short-id. if the optional second parameter rec-no is given, only print the record indicated by this parameter. if no argument is given, print the the contents of the currently selected EF. (yes, "the the". she's quirky like that, we keep it π)cd{..| file-id |aid:DF-name} β change to another DF specified by the argument passed. if the argument given is.., then move up one level in the file system hierarchy. if it is a file-id, which must be a DF directly beneath the current DF, then change to that DF. if it is an application identifier given asaid:DF-name, then jump to the MF of the application denoted by DF-name. navigation queen π§change CHVpin-ref [[old-pin] new-pin] β change the PIN specified by pin-ref from the value given by old-pin and change its value to new-pin.
old-pin and new-pin can be sequences of hexadecimal values, strings enclosed in double quotes ("..."), empty (""), or absent. if absent, the values are read from the card reader's pin pad.
examples:
change CHV2 00:00:00:00:00:00 "foobar"
change PIN CHV2 to the new value foobar, giving the old value 00:00:00:00:00:00.
change CHV2 "foobar"
set PIN CHV2 to the new value foobar.
change CHV2
change PIN CHV2 using the card reader's pinpad.
createfile-id size β create a new EF. file-id specifies the numeric id, and size the size of the EF to create. new file, who dis π±debug[level] β set OpenSC debug level to level.
if level is omitted, show the current debug level.
deletefile-id β remove the EF or DF specified by file-id.do_gethex-tag [output] β copy the contents of the card's data object (DO) specified by hex-tag to the local host computer's file named output.
if output is not given, the contents of hex-tag will be displayed as hex-dump.
do_puthex-tag data β change the contents of the card's data object (DO) specified by hex-tag to data.
data is either a sequence of hexadecimal values or a string enclosed in double quotes ("...").
echostring... β print the strings given. π£οΈeraseβ erase the card, if the card supports it. β οΈ okay this one is a little scary, she said what she said.getfile-id [output] β copy an EF to a local file. the local file is specified by output while the card file is specified by file-id.
if output is omitted, the name of the output file will be derived from the full card path to file-id.
get_recordfile-id rec-no [output] β copy a record of a record-oriented EF to a local file. the local file is specified by output while the card file and the record are specified by file-id and rec-no,
if output is omitted, the name of the output file will be derived from the full card path to file-id. and the rec-no. (that stray comma? kept it. she's perfect in her own way π«Ά)
help[pattern] β display the list of available commands, their options and parameters together with a short help text. if pattern is given, the commands shown are limited to those matching pattern. she's helpful AND stylish, obsessed.info[file-id] β display attributes of a file specified by file-id. if file-id is not supplied, the attributes of the current file are displayed.ls[pattern...] β list files in the current DF. if no pattern is given, then all files are listed. if one or more *pattern*s are given, only files matching at least one pattern are listed.find[start-id [end-id]] β find all files in the current DF. files are found by selecting all file identifiers in the range from start-fid to end-fid.
if not given, the default value for start-fid is 0000, while the default for end-fid is FFFF.
find_tags[start-tag [end-tag]] β find all tags of data objects in the current context. tags are found by using GET DATA in the range from from start-tag to end-tag.
if not given, the default value for start-tag is 0000, while the default for end-tag is FFFF.
mkdirfile-id size β create a DF. file-id specifies the numeric id, and size the size of the DF to create. πpin_infokey-typekey-id β get information on a PIN or key from the card, where key-type can be one ofCHV,KEY,AUTorPRO. key-id is a number representing the key or PIN reference.putfile-id input β copy a local file to the card. the local file is specified by input while the card file is specified by file-id.quitβ exit the program. bye bestie πrandomcount [output-file] β generate count bytes of random data. if output-file is given, write the data to the host computer's file denoted by it, otherwise show the data as hex dump. chaos but make it cryptographic π²rmfile-id β remove the EF or DF specified by file-id.unblock CHVpin-ref [puk [new-pin]] β unblock the PIN denoted by pin-ref using the PUK puk, and potentially change its value to new-pin.
puk and new-pin can be sequences of hexadecimal values, strings enclosed in double quotes ("..."), empty (""), or absent. if absent, the values are read from the card reader's pin pad.
examples:
unblock CHV2 00:00:00:00:00:00 "foobar"
unblock PIN CHV2 using PUK 00:00:00:00:00:00 and set it to the new value foobar.
unblock CHV2 00:00:00:00:00:00 ""
unblock PIN CHV2 using PUK 00:00:00:00:00:00 keeping the old value.
unblock CHV2 "" "foobar"
set new value of PIN CHV2 to foobar.
unblock CHV2 00:00:00:00:00:00
unblock PIN CHV2 using PUK 00:00:00:00:00:00. the new PIN value is prompted by pinpad.
unblock CHV2 ""
set PIN CHV2. the new PIN value is prompted by pinpad.
unblock CHV2
unblock PIN CHV2. the unblock code and new PIN value are prompted by pinpad.
update_binaryfile-id offs data β binary update of the file specified by file-id with the literal data data starting from offset specified by offs.
data can be supplied as a sequence of hexadecimal values or as a string enclosed in double quotes ("...").
update_recordfile-id rec-nr rec-offs data β update record specified by rec-nr of the file specified by file-id with the literal data data starting from offset specified by rec-offs.
data can be supplied as a sequence of hexadecimal values or as a string enclosed in double quotes ("...").
verifykey-typekey-id [key] β present a PIN or key to the card, where key-type can be one ofCHV,KEY,AUTorPRO. key-id is a number representing the key or PIN reference. key is the key or PIN to be verified, formatted as a colon-separated sequence of hexadecimal values or a string enclosed in double quotes ("...").
if key is omitted, the exact action depends on the card reader's features: if the card readers supports PIN input via a pin pad, then the PIN will be verified using the card reader's pin pad. if the card reader does not support PIN input, then the PIN will be asked interactively.
examples:
verify CHV2 31:32:33:34:00:00:00:00
verify CHV2 using the hex value 31:32:33:34:00:00:00:00
verify CHV1 "secret"
verify CHV1 using the string value secret.
verify KEY2
verify KEY2, get the value from the card reader's pin pad.
sm{open|close} β call the card'sopenorcloseSecure Messaging handler. π
π SEE ALSO π
πΈ AUTHORS πΈ
opensc-explorer was written by Juha YrjΓΆlΓ€ <juha.yrjola@iki.fi>. we stan a legend π
and that's the whole page, bestie!! π this was the opensc manual, dated 04/19/2026, and it shipped with version opensc. go explore those smart cards, you absolute icon β¨π¦π
π¦ 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