opensc-explorer1OpenSCOpenSC Toolsopenscopensc-explorer
generic interactive utility for accessing smart card
and similar security token functions
opensc-explorerOPTIONSSCRIPTDescription
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.
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.
num,
num
Use the given reader number. The default
is 0, the first reader in the system.
,
Causes opensc-explorer to be more
verbose. Specify this flag several times to enable
debug output in the opensc library.
,
Wait for a card to be insertedCommands
The following commands are supported at opensc-explorer's
interactive prompt or in script files passed via the command line parameter
SCRIPT.
apduhex-dataSend a custom APDU command hex-data.asn1file-idParse and print the ASN.1 encoded content of the file specified by
file-id.cat [file-id]
cat sfi:short-idPrint the contents of the currently selected EF or the contents
of a file specified by file-id or the short file id
short-id.
cdfile-idChange to another DF specified by file-idchange CHVid [[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
createfile-idsizeCreate a new EF. file-id specifies the
id number and size is the size of the new file.
debug [level]
Set OpenSC debug level to level.If level is omitted the current debug level will be shown.deletefile-idRemove the EF or DF specified by file-iddo_gethex-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 omitted, the name of the output file will be
derived from hex-tag.
do_puthex-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.
eraseErase the card, if the card supports it.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.
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 printed.lsList all files in the current DFfind [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 (by default from 0000 to FFFF).mkdirfile-idsizeCreate a DF. file-id specifies the id number
and size is the size of the new file.putfile-idinputCopy a local file to the card. The local file is specified
by input while the card file is specified by file-id.
quitExit the program.randomcountGenerate random sequence of count bytes.rmfile-idRemove the EF or DF specified by file-idupdate_binaryfile-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 " enclosed string. update_recordfile-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 " enclosed string. verifykey-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
pacesecret-type [secret]
Perform PACE with the card. secret-type
can be one of pin, can, puk or mrz. secret is the secret to be verified as string.
If secret is omitted, the secret will be verified with the PIN-Pad.
Example: pace can 123456
See alsoopensc-tool1