1OPENSC-EXPLORER(1) OpenSC Tools OPENSC-EXPLORER(1)
2
3
4
6 opensc-explorer - generic interactive utility for accessing smart card
7 and similar security token functions
8
10 opensc-explorer [OPTIONS] [SCRIPT]
11
13 The opensc-explorer utility can be used interactively to perform
14 miscellaneous operations such as exploring the contents of or sending
15 arbitrary APDU commands to a smart card or similar security token.
16
18 The following are the command-line options for opensc-explorer. There
19 are additional interactive commands available once it is running.
20
21 --card-driver driver, -c driver
22 Use the given card driver. The default is auto-detected.
23
24 --mf path, -m path
25 Select the file referenced by the given path on startup. The
26 default is the path to the standard master file, 3F00. If path is
27 empty (e.g. opensc-explorer --mf ""), then no file is explicitly
28 selected.
29
30 --reader num, -r num
31 Specify the reader to use. By default, the first reader with a
32 present card is used. If num is an ATR, the reader with a matching
33 card will be chosen.
34
35 --verbose, -v
36 Causes opensc-explorer to be more verbose. Specify this flag
37 several times to enable debug output in the opensc library.
38
39 --wait, -w
40 Wait for a card to be inserted
41
43 The following commands are supported at opensc-explorer's interactive
44 prompt or in script files passed via the command line parameter SCRIPT.
45
46 apdu hex-data
47 Send a custom APDU command hex-data.
48
49 asn1 file-id
50 Parse and print the ASN.1 encoded content of the file specified by
51 file-id.
52
53 cat [file-id | sfi:short-id]
54 Print the contents of the currently selected EF or the contents of
55 a file specified by file-id or the short file id short-id.
56
57 cd {.. | file-id | aid:DF-name}
58 Change to another DF specified by the argument passed. If the
59 argument given is .., then move up one level in the file system
60 hierarchy. If it is file-id, which must be a DF directly beneath
61 the current DF, then change to that DF. If it is an application
62 identifier given as aid:DF-name, then jump to the MF of the
63 application denoted by DF-name.
64
65 change CHVpin-ref [[old-pin] new-pin]
66 Change a PIN, where pin-ref is the PIN reference.
67
68 Examples:
69
70 change CHV2 00:00:00:00:00:00 "foobar"
71 Change PIN CHV2 to the new value foobar, giving the old value
72 00:00:00:00:00:00.
73
74 change CHV2 "foobar"
75 Set PIN CHV2 to the new value foobar.
76
77 change CHV2
78 Change PIN CHV2 using the card reader's pinpad.
79
80
81 create file-id size
82 Create a new EF. file-id specifies the id number and size is the
83 size of the new file.
84
85 debug [level]
86 Set OpenSC debug level to level.
87
88 If level is omitted the current debug level will be shown.
89
90 delete file-id
91 Remove the EF or DF specified by file-id
92
93 do_get hex-tag [output]
94 Copy the internal card's 'tagged' data into the local file.
95
96 The local file is specified by output while the tag of the card's
97 data is specified by hex-tag.
98
99 If output is omitted, the name of the output file will be derived
100 from hex-tag.
101
102 do_put hex-tag input
103 Update internal card's 'tagged' data.
104
105 hex-tag is the tag of the card's data. input is the filename of
106 the source file or the literal data presented as a sequence of
107 hexadecimal values or " enclosed string.
108
109 echo string...
110 Print the strings given.
111
112 erase
113 Erase the card, if the card supports it.
114
115 get file-id [output]
116 Copy an EF to a local file. The local file is specified by output
117 while the card file is specified by file-id.
118
119 If output is omitted, the name of the output file will be derived
120 from the full card path to file-id.
121
122 info [file-id]
123 Display attributes of a file specified by file-id. If file-id is
124 not supplied, the attributes of the current file are printed.
125
126 ls [pattern...]
127 List files in the current DF. If no pattern is given, then all
128 files are listed. If one ore more patterns are given, only files
129 matching at least one pattern are listed.
130
131 find [start-id [end-id]]
132 Find all files in the current DF. Files are found by selecting all
133 file identifiers in the range from start-fid to end-fid (by default
134 from 0000 to FFFF).
135
136 find_tags [start-tag [end-tag]]
137 Find all tags of data objects in the current context. Tags are
138 found by using GET DATA in the range from start-tag to end-tag (by
139 default from 0000 to FFFF).
140
141 mkdir file-id size
142 Create a DF. file-id specifies the id number and size is the size
143 of the new file.
144
145 put file-id input
146 Copy a local file to the card. The local file is specified by input
147 while the card file is specified by file-id.
148
149 quit
150 Exit the program.
151
152 random count
153 Generate random sequence of count bytes.
154
155 rm file-id
156 Remove the EF or DF specified by file-id
157
158 unblock CHVpin-ref [puk [new-pin]]
159 Unblock the PIN denoted by pin-ref using the PUK puk, and set
160 potentially change its value to new-pin.
161
162 PUK and PIN values can be a sequence of hexadecimal values,
163 "-enclosed strings, empty (""), or absent. If they are absent, the
164 values are read from the card reader's pin pad.
165
166 Examples:
167
168 unblock CHV2 00:00:00:00:00:00 "foobar"
169 Unblock PIN CHV2 using PUK 00:00:00:00:00:00 and set it to the
170 new value foobar.
171
172 unblock CHV2 00:00:00:00:00:00 ""
173 Unblock PIN CHV2 using PUK 00:00:00:00:00:00 keeping the old
174 value.
175
176 unblock CHV2 "" "foobar"
177 Set new value of PIN CHV2 to foobar.
178
179 unblock CHV2 00:00:00:00:00:00
180 Unblock PIN CHV2 using PUK 00:00:00:00:00:00. The new PIN value
181 is prompted by pinpad.
182
183 unblock CHV2 ""
184 Set PIN CHV2. The new PIN value is prompted by pinpad.
185
186 unblock CHV2
187 Unblock PIN CHV2. The unblock code and new PIN value are
188 prompted by pinpad.
189
190
191 update_binary file-id offs data
192 Binary update of the file specified by file-id with the literal
193 data data starting from offset specified by offs.
194
195 data can be supplied as a sequencer of the hex values or as a "
196 enclosed string.
197
198 update_record file-id rec-nr rec-offs data
199 Update record specified by rec-nr of the file specified by file-id
200 with the literal data data starting from offset specified by
201 rec-offs.
202
203 data can be supplied as a sequence of the hex values or as a "
204 enclosed string.
205
206 verify key-typekey-id [key]
207 Present a PIN or key to the card, where key-type can be one of CHV,
208 KEY, AUT or PRO. key-id is a number representing the key or PIN
209 reference. key is the key or PIN to be verified, formatted as a
210 colon-separated list of hex values or a " enclosed string.
211
212 If key is omitted, the exact action depends on the card reader's
213 features: if the card readers supports PIN input via a pin pad,
214 then the PIN will be verified using the card reader's pin pad. If
215 the card reader does not support PIN input, then the PIN will be
216 asked interactively.
217
218 Examples:
219
220 verify CHV0 31:32:33:34:00:00:00:00
221 Verify CHV2 using the hex value 31:32:33:34:00:00:00:00
222
223 verify CHV1 "secret"
224 Verify CHV1 using the string value secret.
225
226 verify KEY2
227 Verify KEY2, get the value from the card reader's pin pad.
228
229
230 sm {open | close}
231 Calls the card's open or close Secure Messaging handler.
232
234 opensc-tool(1)
235
237 opensc-explorer was written by Juha Yrjölä <juha.yrjola@iki.fi>.
238
239
240
241opensc 09/30/2019 OPENSC-EXPLORER(1)