1f59d82ffSelric/*
2f59d82ffSelric * Copyright (c) 2004 Kungliga Tekniska Högskolan
3f59d82ffSelric * (Royal Institute of Technology, Stockholm, Sweden).
4f59d82ffSelric * All rights reserved.
5f59d82ffSelric *
6f59d82ffSelric * Redistribution and use in source and binary forms, with or without
7f59d82ffSelric * modification, are permitted provided that the following conditions
8f59d82ffSelric * are met:
9f59d82ffSelric *
10f59d82ffSelric * 1. Redistributions of source code must retain the above copyright
11f59d82ffSelric *    notice, this list of conditions and the following disclaimer.
12f59d82ffSelric *
13f59d82ffSelric * 2. Redistributions in binary form must reproduce the above copyright
14f59d82ffSelric *    notice, this list of conditions and the following disclaimer in the
15f59d82ffSelric *    documentation and/or other materials provided with the distribution.
16f59d82ffSelric *
17f59d82ffSelric * 3. Neither the name of the Institute nor the names of its contributors
18f59d82ffSelric *    may be used to endorse or promote products derived from this software
19f59d82ffSelric *    without specific prior written permission.
20f59d82ffSelric *
21f59d82ffSelric * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22f59d82ffSelric * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23f59d82ffSelric * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24f59d82ffSelric * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25f59d82ffSelric * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26f59d82ffSelric * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27f59d82ffSelric * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28f59d82ffSelric * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29f59d82ffSelric * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30f59d82ffSelric * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31f59d82ffSelric * SUCH DAMAGE.
32f59d82ffSelric */
33fcfd9267Selric/* Id */
34f59d82ffSelric
35f59d82ffSelriccommand = {
36f59d82ffSelric	name = "add"
37f59d82ffSelric	option = {
38f59d82ffSelric		long = "principal"
39f59d82ffSelric		short = "p"
40f59d82ffSelric		type = "string"
41f59d82ffSelric		help = "principal to add"
42f59d82ffSelric		argument = "principal"
43f59d82ffSelric		default = ""
44f59d82ffSelric	}
45f59d82ffSelric	option = {
46f59d82ffSelric		long = "kvno"
47f59d82ffSelric		short = "V"
48f59d82ffSelric		type = "integer"
49f59d82ffSelric		help = "key version number"
50f59d82ffSelric		default = "-1"
51f59d82ffSelric	}
52f59d82ffSelric	option = {
53f59d82ffSelric		long = "enctype"
54f59d82ffSelric		short = "e"
55f59d82ffSelric		type = "string"
56f59d82ffSelric		argument = "enctype"
57f59d82ffSelric		help = "encryption type"
58f59d82ffSelric	}
59f59d82ffSelric	option = {
60f59d82ffSelric		long = "password"
61f59d82ffSelric		short = "w"
62f59d82ffSelric		type = "string"
63f59d82ffSelric		help = "password for key"
64f59d82ffSelric	}
65f59d82ffSelric	option = {
66f59d82ffSelric		long = "salt"
67f59d82ffSelric		short = "s"
68f59d82ffSelric		type = "-flag"
69f59d82ffSelric		help = "use unsalted keys"
70f59d82ffSelric		default = "1"
71f59d82ffSelric	}
72f59d82ffSelric	option = {
73f59d82ffSelric		long = "random"
74f59d82ffSelric		short = "r"
75f59d82ffSelric		type = "flag"
76f59d82ffSelric		help = "generate random key"
77f59d82ffSelric	}
78f59d82ffSelric	option = {
79f59d82ffSelric		long = "hex"
80f59d82ffSelric		short = "H"
81f59d82ffSelric		type = "flag"
82f59d82ffSelric		help = "password is a hexadecimal string"
83f59d82ffSelric	}
84f59d82ffSelric	function = "kt_add"
85f59d82ffSelric	help = "Adds a key to a keytab."
86f59d82ffSelric	max_args = "0"
87f59d82ffSelric}
88f59d82ffSelriccommand = {
89f59d82ffSelric	name = "change"
90f59d82ffSelric	option = {
91f59d82ffSelric		long = "realm"
92f59d82ffSelric		short = "r"
93f59d82ffSelric		type = "string"
94f59d82ffSelric		argument = "realm"
95f59d82ffSelric		help = "realm to use"
96f59d82ffSelric	}
97f59d82ffSelric	option = {
98f59d82ffSelric		long = "admin-server"
99f59d82ffSelric		short = "a"
100f59d82ffSelric		type = "string"
101f59d82ffSelric		argument = "host"
102f59d82ffSelric		help = "server to contact"
103f59d82ffSelric	}
104f59d82ffSelric	option = {
105f59d82ffSelric		long = "server-port"
106f59d82ffSelric		short = "s"
107f59d82ffSelric		type = "integer"
108f59d82ffSelric		argument = "port number"
109f59d82ffSelric		help = "port number on server"
110f59d82ffSelric	}
111f59d82ffSelric	function = "kt_change"
112f59d82ffSelric	argument = "[principal...]"
113f59d82ffSelric	help = "Change keys for specified principals (default all)."
114f59d82ffSelric}
115f59d82ffSelriccommand = {
116f59d82ffSelric	name = "copy"
117f59d82ffSelric	function = "kt_copy"
118f59d82ffSelric	argument = "source destination"
119f59d82ffSelric	min_args = "2"
120f59d82ffSelric	max_args = "2"
121f59d82ffSelric	help = "Copies one keytab to another."
122f59d82ffSelric}
123f59d82ffSelriccommand = {
124f59d82ffSelric	name = "get"
125f59d82ffSelric	option = {
126f59d82ffSelric		long = "principal"
127f59d82ffSelric		short = "p"
128f59d82ffSelric		type = "string"
129f59d82ffSelric		help = "admin principal"
130f59d82ffSelric		argument = "principal"
131f59d82ffSelric	}
132f59d82ffSelric	option = {
133f59d82ffSelric		long = "enctypes"
134f59d82ffSelric		short = "e"
135f59d82ffSelric		type = "strings"
136f59d82ffSelric		help = "encryption types to use"
137f59d82ffSelric		argument = "enctype"
138f59d82ffSelric	}
139f59d82ffSelric	option = {
140f59d82ffSelric		long = "realm"
141f59d82ffSelric		short = "r"
142f59d82ffSelric		type = "string"
143f59d82ffSelric		argument = "realm"
144f59d82ffSelric		help = "realm to use"
145f59d82ffSelric	}
146f59d82ffSelric	option = {
147f59d82ffSelric		long = "admin-server"
148f59d82ffSelric		short = "a"
149f59d82ffSelric		type = "string"
150f59d82ffSelric		argument = "host"
151f59d82ffSelric		help = "server to contact"
152f59d82ffSelric	}
153f59d82ffSelric	option = {
154f59d82ffSelric		long = "server-port"
155f59d82ffSelric		short = "s"
156f59d82ffSelric		type = "integer"
157f59d82ffSelric		argument = "port number"
158f59d82ffSelric		help = "port number on server"
159f59d82ffSelric	}
160f59d82ffSelric	function = "kt_get"
161f59d82ffSelric	min_args = "1"
162f59d82ffSelric	argument = "principal..."
163f59d82ffSelric	help = "Change keys for specified principals, and add them to the keytab."
164f59d82ffSelric}
165f59d82ffSelriccommand = {
166f59d82ffSelric	name = "list"
167f59d82ffSelric	option = {
168f59d82ffSelric		long = "keys"
169f59d82ffSelric		type = "flag"
170f59d82ffSelric		help = "show key values"
171f59d82ffSelric	}
172f59d82ffSelric	option = {
173f59d82ffSelric		long = "timestamp"
174f59d82ffSelric		type = "flag"
175f59d82ffSelric		help = "show timestamps"
176f59d82ffSelric	}
177f59d82ffSelric	max_args = "0"
178f59d82ffSelric	function = "kt_list"
179f59d82ffSelric	help = "Show contents of keytab."
180f59d82ffSelric}
181f59d82ffSelriccommand = {
182f59d82ffSelric	name = "purge"
183f59d82ffSelric	option = {
184f59d82ffSelric		long = "age"
185f59d82ffSelric		type = "string"
186f59d82ffSelric		help = "age to retiere"
187f59d82ffSelric		default = "1 week";
188f59d82ffSelric		argument = "time"
189f59d82ffSelric	}
190f59d82ffSelric	max_args = "0"
191f59d82ffSelric	function = "kt_purge"
192f59d82ffSelric	help = "Remove superceded keys from keytab."
193f59d82ffSelric}
194f59d82ffSelriccommand = {
195f59d82ffSelric	name = "remove"
196f59d82ffSelric	name = "delete"
197f59d82ffSelric	option = {
198f59d82ffSelric		long = "principal"
199f59d82ffSelric		short = "p"
200f59d82ffSelric		type = "string"
201f59d82ffSelric		help = "principal to remove"
202f59d82ffSelric		argument = "principal"
203f59d82ffSelric	}
204f59d82ffSelric	option = {
205f59d82ffSelric		long = "kvno"
206f59d82ffSelric		short = "V"
207f59d82ffSelric		type = "integer"
208f59d82ffSelric		help = "key version to remove"
209*e0895134Schristos		argument = "kvno"
210f59d82ffSelric		default = "0"
211f59d82ffSelric	}
212f59d82ffSelric	option = {
213f59d82ffSelric		long = "enctype"
214f59d82ffSelric		short = "e"
215f59d82ffSelric		type = "string"
216f59d82ffSelric		help = "enctype to remove"
217f59d82ffSelric		argument = "enctype"
218f59d82ffSelric	}
219f59d82ffSelric	max_args = "0"
220f59d82ffSelric	function = "kt_remove"
221f59d82ffSelric	help = "Remove keys from keytab."
222f59d82ffSelric}
223f59d82ffSelriccommand = {
224f59d82ffSelric	name = "rename"
225f59d82ffSelric	function = "kt_rename"
226f59d82ffSelric	argument = "from to"
227f59d82ffSelric	min_args = "2"
228f59d82ffSelric	max_args = "2"
229f59d82ffSelric	help = "Renames an entry in the keytab."
230f59d82ffSelric	option = {
231f59d82ffSelric		long = "delete"
232f59d82ffSelric		type = "-flag"
233f59d82ffSelric		help = "don't delete orignal entry"
234f59d82ffSelric	}
235f59d82ffSelric}
236f59d82ffSelriccommand = {
237f59d82ffSelric	name = "destroy"
238f59d82ffSelric	function = "kt_destroy"
239f59d82ffSelric	max_args = "0"
240f59d82ffSelric	help = "Destroy (remove) the keytab."
241f59d82ffSelric}
242f59d82ffSelriccommand = {
243f59d82ffSelric	name = "help"
244f59d82ffSelric	argument = "command"
245f59d82ffSelric	max_args = "1"
246f59d82ffSelric	function = "help"
247f59d82ffSelric}
248