Annotation of src/usr.bin/sectok/sectok.1, Revision 1.15
1.15 ! jmc 1: .\" $OpenBSD: sectok.1,v 1.14 2007/12/30 13:35:27 sobrado 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: .\"
1.15 ! jmc 29: .Dd $Mdocdate: December 30 2007 $
1.2 jakob 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.14 sobrado 42: .Op Ar command Op Ar arg ...
1.5 jakob 43: .\"
1.1 rees 44: .Sh DESCRIPTION
45: .Nm
1.2 jakob 46: is a command-line-like interface for communicating with smartcards.
1.15 ! jmc 47: APDUs can be sent to the card, and results are displayed.
! 48: Some commands are card-specific, and focus on the Schlumberger Cyberflex
1.2 jakob 49: Access Javacards.
1.6 mpech 50: .Pp
51: The options are as follows:
1.2 jakob 52: .Bl -tag -width Ds
53: .It Fl 0123
54: Select port.
55: .Pp
56: .It Fl f Ar scriptfile
57: Run commands from scriptfile.
58: .Pp
59: .It Fl s Ar sleeptime
1.4 rees 60: Set sleep (in milliseconds) between commands in the script.
1.3 jakob 61: .El
1.2 jakob 62: .Sh COMMANDS
63: .Ss Non-card commands
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
1.12 jmc 76: .Cm \&?
1.2 jakob 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: .Bl -tag -width Ds
113: .It Xo
114: .Cm apdu
115: .Op Fl c Ar class
116: .Ar "ins p1 p2 p3 data ..."
117: .Xc
118: Send APDU to smartcard.
119: .It Xo
120: .Cm fid
121: .Op Fl v
1.4 rees 122: .Ar fid/aid
1.2 jakob 123: .Xc
1.4 rees 124: Select file or aid identified by
125: .Ar fid/aid .
126: .Ar fid/aid
1.10 jmc 127: can be a numeric fid such as 3f00, a two character name, or an aid in hex or
128: 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: .Bl -tag -width Ds
171: .It Xo
172: .Cm ls
173: .Op Fl l
174: .Xc
175: List all files in current DF.
176: .It Xo
177: .Cm acl
178: .Ar fid
179: .Op Ar principal: "r1 r2 ..."
180: .Xc
181: .Bl -tag -width Ds
182: .It principals
183: world, CHV1, CHV2, AUT0, AUT1, AUT2, AUT3, AUT4
184: .It f_rights
185: r, w, x/a, inval, rehab, dec, inc
186: .It d_rights
187: l, d, a, i, manage
188: .El
189: .It Xo
190: .Cm create
191: .Ar fid
192: .Ar size
193: .Xc
194: .It Xo
195: .Cm delete
196: .Ar fid
197: .Xc
198: .It Xo
199: .Cm jdefault
200: .Op Fl d
201: .Xc
202: Set default applet.
203: .Bl -tag -width Ds
204: .It Fl d
205: set default applet to default loader
206: .El
207: .It Xo
208: .Cm jatr
209: .Xc
210: Set java atr.
211: .It Xo
212: .Cm jdata
213: .Xc
214: Print useful info about the card
215: .It Xo
216: .Cm login
217: .Op Fl d
218: .Op Fl k Ar keyno
219: .Op Fl v
220: .Op Fl x Ar hex-aut0
221: .Xc
1.4 rees 222: "login" (verify AUT0 key)
223: .Bl -tag -width Ds
224: .It Fl d
225: use manufacturer's default AUT0 key
226: .El
1.2 jakob 227: .It Xo
228: .Cm jload
229: .Op Fl p Ar progID
230: .Op Fl c Ar contID
231: .Op Fl s Ar cont_size
232: .Op Fl i Ar inst_size
233: .Op Fl v
1.4 rees 234: .Op Fl a Ar aid
235: .Ar filename
1.2 jakob 236: .Xc
1.4 rees 237: Load an applet to the card.
1.5 jakob 238: If the first byte of the
239: .Ar aid
240: is '#' it will be converted to 0xfc.
1.2 jakob 241: .It Xo
242: .Cm junload
243: .Op Fl p Ar progID
244: .Op Fl c Ar contID
245: .Xc
246: .It Xo
247: .Cm jselect
248: .Op Fl a Ar aid
249: .Op Fl d
250: .Xc
251: Select applet.
252: .Bl -tag -width Ds
253: .It Fl d
254: select default loader
255: .El
256: .It Xo
257: .Cm setpass
258: .Op Fl d
259: .Op Fl x Ar hex-aut0
260: .Xc
1.5 jakob 261: .Bl -tag -width Ds
262: .It Fl d
263: use manufacturer's default AUT0 key
264: .El
1.2 jakob 265: .El
1.5 jakob 266: .\"
1.11 jmc 267: .Sh HISTORY
268: .Nm
269: first appeared in
270: .Ox 3.0 .
1.2 jakob 271: .Sh AUTHORS
1.1 rees 272: .Nm
1.7 rees 273: was written by Jim Rees and others at University of Michigan
274: Center for Information Technology Integration (CITI).
1.5 jakob 275: .\"