298 lines
12 KiB
XML
298 lines
12 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<refentry id="opensc-explorer">
|
|
<refmeta>
|
|
<refentrytitle>opensc-explorer</refentrytitle>
|
|
<manvolnum>1</manvolnum>
|
|
<refmiscinfo>opensc</refmiscinfo>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>opensc-explorer</refname>
|
|
<refpurpose>
|
|
generic interactive utility for accessing smart card
|
|
and similar security token functions
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
<title>Synopsis</title>
|
|
<para>
|
|
<command>opensc-explorer</command> [OPTIONS]
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
The <command>opensc-explorer</command> 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.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Options</title>
|
|
<para>
|
|
The following are the command-line options for
|
|
<command>opensc-explorer</command>. There are additional
|
|
interactive commands available once it is running.
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<option>--reader</option> num,
|
|
<option>-r</option> num
|
|
</term>
|
|
<listitem><para>
|
|
Use the given reader number. The default
|
|
is 0, the first reader in the system.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<option>--card-driver</option> driver,
|
|
<option>-c</option> driver
|
|
</term>
|
|
<listitem><para>
|
|
Use the given card driver. The default is
|
|
auto-detected.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<option>--mf</option> path,
|
|
<option>-m</option> path
|
|
</term>
|
|
<listitem><para>
|
|
Select the file referenced by the given path on
|
|
startup. The default is the path to the standard master file,
|
|
3F00. If <varname>path</varname> is empty (e.g. <command>opensc-explorer
|
|
--mf ""</command>), then no file is explicitly selected.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><option>--wait, -w</option></term>
|
|
<listitem><para>Wait for a card to be inserted</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><option>--verbose, -v</option></term>
|
|
<listitem><para>
|
|
Causes <command>opensc-explorer</command> to be more
|
|
verbose. Specify this flag several times to enable
|
|
debug output in the opensc library.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Commands</title>
|
|
<para>
|
|
The following commands are supported at the <command>opensc-explorer</command>
|
|
interactive prompt.
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><option>ls</option></term>
|
|
<listitem><para>list all files in the current DF</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>cd</option> <varname>file-id</varname></term>
|
|
<listitem><para>change to another DF specified by <varname>file-id</varname></para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>cat</option> [<varname>file-id</varname>]</term>
|
|
<term><option>cat</option> sfi:<varname>sfi-id</varname></term>
|
|
<listitem><para>print the contents of the currently selected EF or the contents of a file
|
|
specified by <varname>file-id</varname>
|
|
or <varname>sfi-id</varname>.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>info</option> [<varname>file-id</varname>]</term>
|
|
<listitem><para>display attributes of a file specified by <varname>file-id</varname>.
|
|
If <varname>file-id</varname> is not supplied,
|
|
the attributes of the current file are printed.</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>create</option> <varname>file-id</varname> <varname>size</varname></term>
|
|
<listitem><para>create a new EF. <varname>file-id</varname> specifies the
|
|
id number and <varname>size</varname> is the size of the new file.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>delete</option> <varname>file-id</varname></term>
|
|
<listitem><para>remove the EF or DF specified by <varname>file-id</varname></para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>rm</option> <varname>file-id</varname></term>
|
|
<listitem><para>remove the EF or DF specified by <varname>file-id</varname></para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>verify</option> <varname>key-type</varname><varname>key-id</varname>
|
|
[<varname>key</varname>]</term>
|
|
<listitem><para>present a PIN or key to the card. Where <varname>key-type</varname>
|
|
can be one of CHV, KEY or PRO. <varname>key-id</varname> is a number representing the
|
|
key or PIN reference. <varname>key</varname> is the key or PIN to be verified in hex.
|
|
</para>
|
|
<para>
|
|
If <varname>key</varname> is omitted, PIN will be verified with PIN-Pad.
|
|
</para>
|
|
<para>
|
|
Example: verify CHV0 31:32:33:34:00:00:00:00
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>change CHV</option><varname>id</varname>
|
|
[[<varname>old-pin</varname>] <varname>new-pin</varname>]</term>
|
|
<listitem><para>change a PIN, where <varname>id</varname> is the PIN reference</para>
|
|
<para>
|
|
Examples:
|
|
</para>
|
|
<para>
|
|
Change PIN: change CHV2 00:00:00:00:00:00 "foobar"
|
|
</para>
|
|
<para>
|
|
Set PIN: change CHV2 "foobar"
|
|
</para>
|
|
<para>
|
|
Change PIN with pinpad: change CHV2
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>put</option> <varname>file-id</varname> <varname>input</varname></term>
|
|
<listitem><para>copy a local file to the card. The local file is specified
|
|
by <varname>input</varname> while the card file is specified by <varname>file-id</varname>.
|
|
</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>get</option> <varname>file-id</varname> [<varname>output</varname>]</term>
|
|
<listitem>
|
|
<para>copy an EF to a local file. The local file is specified
|
|
by <varname>output</varname> while the card file is specified by <varname>file-id</varname>.
|
|
</para>
|
|
<para>
|
|
If <varname>output</varname> is ommited, the name of the output file will be
|
|
derivated from the full card path to <varname>file-id</varname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>do_put</option> <varname>hex-tag</varname> <varname>input</varname></term>
|
|
<listitem>
|
|
<para>update internal card's 'tagged' data. </para>
|
|
<para><varname>hex-tag</varname> is the tag of the card's data.
|
|
<varname>input</varname> is the filename of the source file or the literal data presented as
|
|
a sequence of hexadecimal values or '"' enclosed string.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>do_get</option> <varname>hex-tag</varname> [<varname>output</varname>]</term>
|
|
<listitem>
|
|
<para>copy the internal card's 'tagged' data into the local file.</para>
|
|
<para>The local file is specified by <varname>output</varname> while the tag of
|
|
the card's data is specified by <varname>hex-tag</varname>.
|
|
</para>
|
|
<para>
|
|
If <varname>output</varname> is ommited, the name of the output file will be
|
|
derivated from <varname>hex-tag</varname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>mkdir</option> <varname>file-id</varname> <varname>size</varname></term>
|
|
<listitem><para>create a DF. <varname>file-id</varname> specifies the id number
|
|
and <varname>size</varname> is the size of the new file.</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>erase</option></term>
|
|
<listitem><para>erase the card, if the card supports it.</para></listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>random</option> <varname>count</varname></term>
|
|
<listitem>
|
|
<para>generate random sequence of <varname>count</varname> bytes.</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>update_record</option> <varname>file-id</varname> <varname>rec_nr</varname>
|
|
<varname>rec_offs</varname> <varname>data</varname></term>
|
|
<listitem>
|
|
<para>update record specified by <varname>rec_nr</varname> of the file
|
|
specified by <varname>file-id</varname> with the literal data
|
|
<varname>data</varname> starting from offset specified by
|
|
<varname>rec_offs</varname>.</para>
|
|
<para><varname>data</varname> can be supplied as a sequence of the hex values or
|
|
as a '"' encolsed string. </para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>update_binary</option> <varname>file-id</varname> <varname>offs</varname>
|
|
<varname>data</varname></term>
|
|
<listitem>
|
|
<para>binary update of the file specified by <varname>file-id</varname> with the literal data
|
|
<varname>data</varname> starting from offset specified by <varname>offs</varname>.</para>
|
|
<para><varname>data</varname> can be supplied as a sequence of the hex values or
|
|
as a '"' encolsed string. </para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>debug</option> [<varname>level</varname>]</term>
|
|
<listitem>
|
|
<para>set OpenSC debug level to <varname>level</varname>.</para>
|
|
<para>If <varname>level</varname> is ommited the current debug level will be shown.</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>apdu</option> <varname>hex_data</varname></term>
|
|
<listitem>
|
|
<para>send a custom APDU command <varname>hex_data</varname>.</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>asn1</option> <varname>file-id</varname></term>
|
|
<listitem>
|
|
<para>parse and print the ASN1 encoded content of the file specified by
|
|
<varname>file-id</varname>.</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><option>quit</option></term>
|
|
<listitem><para>exit the program.</para></listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>See also</title>
|
|
<para>opensc(7), opensc-tool(1)</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|