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