Annotation of src/usr.bin/sectok/sectok.1, Revision 1.9
1.9 ! rees 1: .\" $OpenBSD: sectok.1,v 1.8 2001/08/15 19:48:39 rees Exp $
1.1 rees 2: .\"
1.2 jakob 3: .\" Copyright (C) 2001, Jakob Schlyter. All rights reserved.
4: .\"
5: .\" Redistribution and use in source and binary forms, with or without
6: .\" modification, are permitted provided that the following conditions
7: .\" are met:
8: .\" 1. Redistributions of source code must retain the above copyright
9: .\" notice, this list of conditions and the following disclaimer.
10: .\" 2. Redistributions in binary form must reproduce the above copyright
11: .\" notice, this list of conditions and the following disclaimer in the
12: .\" documentation and/or other materials provided with the distribution.
13: .\" 3. Neither the name of the project nor the names of its contributors
14: .\" may be used to endorse or promote products derived from this software
15: .\" without specific prior written permission.
16: .\"
17: .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27: .\" SUCH DAMAGE.
28: .\"
29: .Dd July 17, 2001
30: .Dt SECTOK 1
1.1 rees 31: .Os
1.5 jakob 32: .\"
1.1 rees 33: .Sh NAME
1.2 jakob 34: .Nm sectok
1.1 rees 35: .Nd communicate with smartcards using iso7816
1.5 jakob 36: .\"
1.1 rees 37: .Sh SYNOPSIS
1.2 jakob 38: .Nm sectok
39: .Op Fl 0123
40: .Op Fl f Ar scriptfile
41: .Op Fl s Ar sleeptime
1.5 jakob 42: .\"
1.1 rees 43: .Sh DESCRIPTION
44: .Nm
1.2 jakob 45: is a command-line-like interface for communicating with smartcards.
46: APDUs can be sent to the card, and results are displayed. Some
47: commands are card-specific, and focus on the Schlumberger Cyberflex
48: Access Javacards.
1.6 mpech 49: .Pp
50: The options are as follows:
1.2 jakob 51: .Bl -tag -width Ds
52: .It Fl 0123
53: Select port.
54: .Pp
55: .It Fl f Ar scriptfile
56: Run commands from scriptfile.
57: .Pp
58: .It Fl s Ar sleeptime
1.4 rees 59: Set sleep (in milliseconds) between commands in the script.
1.3 jakob 60: .El
1.2 jakob 61: .Sh COMMANDS
62: .Ss Non-card commands
63: .Pp
64: .Bl -tag -width Ds
65: .It Xo
66: .Cm help
1.4 rees 67: .Xc
68: List all commands.
69: .It Xo
70: .Cm help
1.2 jakob 71: .Op command
72: .Xc
73: Show help for
74: .Ar command .
75: .It Xo
76: .Cm ?
77: .Op command
78: .Xc
79: Show help for
80: .Ar command .
81: .It Xo
82: .Cm reset
83: .Op Fl 0123ivf
84: .Xc
85: Reset smartcard.
86: .Bl -tag -width Ds
87: .It Fl 0123
88: select port
89: .It Fl i
90: don't wait for card insertion
91: .It Fl v
92: verbose
93: .It Fl f
94: open connection even if atr is bad
95: .El
96: .It Xo
97: .Cm open
98: .Op Fl 0123ivf
99: .Xc
100: Synonym for reset.
101: .It Xo
102: .Cm close
103: .Xc
104: Close smartcard connection.
105: .It Xo
106: .Cm quit
107: .Xc
108: Quit
109: .Nm Li .
110: .El
111: .Ss ISO 7816-4 commands
112: .Pp
113: .Bl -tag -width Ds
114: .It Xo
115: .Cm apdu
116: .Op Fl c Ar class
117: .Ar "ins p1 p2 p3 data ..."
118: .Xc
119: Send APDU to smartcard.
120: .It Xo
121: .Cm fid
122: .Op Fl v
1.4 rees 123: .Ar fid/aid
1.2 jakob 124: .Xc
1.4 rees 125: Select file or aid identified by
126: .Ar fid/aid .
127: .Ar fid/aid
128: can be a numeric fid such as 3f00, a two character name, or an aid in hex or ascii.
1.2 jakob 129: .It Xo
130: .Cm isearch
131: .Xc
132: Try all 256 possible instructions and print results.
133: .It Xo
134: .Cm class
135: .Op Ar class
136: .Xc
1.5 jakob 137: Inquire or set default application
138: .Ar class .
1.2 jakob 139: .It Xo
140: .Cm read
141: .Op Fl x
142: .Ar filesize
143: .Xc
1.4 rees 144: Read selected fid and write to stdout.
1.2 jakob 145: .It Xo
146: .Cm write
147: .Ar input-filename
148: .Xc
1.5 jakob 149: Read from
150: .Ar input-filename
151: and write to selected fid.
1.8 rees 152: .It Xo
153: .Cm challenge
154: .Op Ar length
155: .Xc
156: Get a random challenge from the card.
1.9 ! rees 157: .It Xo
! 158: .Cm pin
! 159: .Op Fl k Ar keyno
! 160: .Op Ar PIN
! 161: .Xc
! 162: Verify CHV (PIN).
! 163: .It Xo
! 164: .Cm chpin
! 165: .Op Fl k Ar keyno
! 166: .Xc
! 167: Change CHV (PIN).
1.2 jakob 168: .El
169: .Ss Cyberflex commands
170: .Pp
171: .Bl -tag -width Ds
172: .It Xo
173: .Cm ls
174: .Op Fl l
175: .Xc
176: List all files in current DF.
177: .It Xo
178: .Cm acl
179: .Ar fid
180: .Op Ar principal: "r1 r2 ..."
181: .Xc
182: .Bl -tag -width Ds
183: .It principals
184: world, CHV1, CHV2, AUT0, AUT1, AUT2, AUT3, AUT4
185: .It f_rights
186: r, w, x/a, inval, rehab, dec, inc
187: .It d_rights
188: l, d, a, i, manage
189: .El
190: .It Xo
191: .Cm create
192: .Ar fid
193: .Ar size
194: .Xc
195: .It Xo
196: .Cm delete
197: .Ar fid
198: .Xc
199: .It Xo
200: .Cm jdefault
201: .Op Fl d
202: .Xc
203: Set default applet.
204: .Bl -tag -width Ds
205: .It Fl d
206: set default applet to default loader
207: .El
208: .It Xo
209: .Cm jatr
210: .Xc
211: Set java atr.
212: .It Xo
213: .Cm jdata
214: .Xc
215: Print useful info about the card
216: .It Xo
217: .Cm login
218: .Op Fl d
219: .Op Fl k Ar keyno
220: .Op Fl v
221: .Op Fl x Ar hex-aut0
222: .Xc
1.4 rees 223: "login" (verify AUT0 key)
224: .Bl -tag -width Ds
225: .It Fl d
226: use manufacturer's default AUT0 key
227: .El
1.2 jakob 228: .It Xo
229: .Cm jload
230: .Op Fl p Ar progID
231: .Op Fl c Ar contID
232: .Op Fl s Ar cont_size
233: .Op Fl i Ar inst_size
234: .Op Fl v
1.4 rees 235: .Op Fl a Ar aid
236: .Ar filename
1.2 jakob 237: .Xc
1.4 rees 238: Load an applet to the card.
1.5 jakob 239: If the first byte of the
240: .Ar aid
241: is '#' it will be converted to 0xfc.
1.2 jakob 242: .It Xo
243: .Cm junload
244: .Op Fl p Ar progID
245: .Op Fl c Ar contID
246: .Xc
247: .It Xo
248: .Cm jselect
249: .Op Fl a Ar aid
250: .Op Fl d
251: .Xc
252: Select applet.
253: .Bl -tag -width Ds
254: .It Fl d
255: select default loader
256: .El
257: .It Xo
258: .Cm setpass
259: .Op Fl d
260: .Op Fl x Ar hex-aut0
261: .Xc
1.5 jakob 262: .Bl -tag -width Ds
263: .It Fl d
264: use manufacturer's default AUT0 key
265: .El
1.2 jakob 266: .El
1.5 jakob 267: .\"
1.2 jakob 268: .Sh AUTHORS
1.1 rees 269: .Nm
1.7 rees 270: was written by Jim Rees and others at University of Michigan
271: Center for Information Technology Integration (CITI).
1.5 jakob 272: .\"
1.2 jakob 273: .Sh HISTORY
1.1 rees 274: .Nm
1.2 jakob 275: first appeared in
276: .Ox 3.0 .