opensc-explorer1openscopensc-explorer
generic interactive utility for accessing smart card
and similar security token functions
Synopsisopensc-explorer [OPTIONS]
Description
The opensc-explorer utility can be
used interactively to perform miscellaneous operations
such as exploring the contents of or sending arbitrary
APDU commands to a smart card or similar security token.
Options
The following are the command-line options for
opensc-explorer. There are additional
interactive commands available once it is running.
num,
num
Use the given reader number. The default
is 0, the first reader in the system.
driver,
driver
Use the given card driver. The default is
auto-detected.
path,
path
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 (e.g. opensc-explorer
--mf ""), then no file is explicitly selected.
Wait for a card to be inserted
Causes opensc-explorer to be more
verbose. Specify this flag several times to enable
debug output in the opensc library.
Commands
The following commands are supported at the opensc-explorer
interactive prompt.
list all files in the current DFfile-idchange to another DF specified by file-id [file-id] sfi:sfi-idprint the contents of the currently selected EF or the contents of a file
specified by file-id
or sfi-id.
[file-id]display attributes of a file specified by file-id.
If file-id is not supplied,
the attributes of the current file are printed.file-idsizecreate a new EF. file-id specifies the
id number and size is the size of the new file.
file-idremove the EF or DF specified by file-idfile-idremove the EF or DF specified by file-idkey-typekey-id
[key]present a PIN or key to the card. Where key-type
can be one of CHV, KEY or PRO. key-id is a number representing the
key or PIN reference. key is the key or PIN to be verified in hex.
If key is omitted, PIN will be verified with PIN-Pad.
Example: verify CHV0 31:32:33:34:00:00:00:00
id
[[old-pin] new-pin]change a PIN, where id is the PIN reference
Examples:
Change PIN: change CHV2 00:00:00:00:00:00 "foobar"
Set PIN: change CHV2 "foobar"
Change PIN with pinpad: change CHV2
file-idinputcopy a local file to the card. The local file is specified
by input while the card file is specified by file-id.
file-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 ommited, the name of the output file will be
derivated from the full card path to file-id.
hex-taginputupdate internal card's 'tagged' data. hex-tag is the tag of the card's data.
input is the filename of the source file or the literal data presented as
a sequence of hexadecimal values or '"' enclosed string.
hex-tag [output]copy the internal card's 'tagged' data into the local file.The local file is specified by output while the tag of
the card's data is specified by hex-tag.
If output is ommited, the name of the output file will be
derivated from hex-tag.
file-idsizecreate a DF. file-id specifies the id number
and size is the size of the new file.erase the card, if the card supports it.countgenerate random sequence of count bytes.file-idrec_nrrec_offsdataupdate 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 the hex values or
as a '"' encolsed string. file-idoffsdatabinary 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 the hex values or
as a '"' encolsed string. [level]set OpenSC debug level to level.If level is ommited the current debug level will be shown.hex_datasend a custom APDU command hex_data.file-idparse and print the ASN1 encoded content of the file specified by
file-id.exit the program.See alsoopensc(7), opensc-tool(1)