1 .\" Copyright (c) 2003 - 2004 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Heimdal: krb5_keyblock.3 17385 2006-05-01 08:48:55Z lha $
40 .Nm krb5_keyblock_get_enctype ,
41 .Nm krb5_copy_keyblock ,
42 .Nm krb5_copy_keyblock_contents ,
43 .Nm krb5_free_keyblock ,
44 .Nm krb5_free_keyblock_contents ,
45 .Nm krb5_generate_random_keyblock ,
46 .Nm krb5_generate_subkey ,
47 .Nm krb5_generate_subkey_extended ,
48 .Nm krb5_keyblock_init ,
49 .Nm krb5_keyblock_zero ,
50 .Nm krb5_random_to_key
51 .Nd Kerberos 5 key handling functions
53 Kerberos 5 Library (libkrb5, -lkrb5)
59 .Fo krb5_keyblock_get_enctype
60 .Fa "const krb5_keyblock *block"
63 .Fo krb5_copy_keyblock
64 .Fa "krb5_context context"
65 .Fa "krb5_keyblock **to"
68 .Fo krb5_copy_keyblock_contents
69 .Fa "krb5_context context"
70 .Fa "const krb5_keyblock *inblock"
71 .Fa "krb5_keyblock *to"
74 .Fo krb5_free_keyblock
75 .Fa "krb5_context context"
76 .Fa "krb5_keyblock *keyblock"
79 .Fo krb5_free_keyblock_contents
80 .Fa "krb5_context context"
81 .Fa "krb5_keyblock *keyblock"
84 .Fo krb5_generate_random_keyblock
85 .Fa "krb5_context context"
86 .Fa "krb5_enctype type"
87 .Fa "krb5_keyblock *key"
90 .Fo krb5_generate_subkey
91 .Fa "krb5_context context"
92 .Fa "const krb5_keyblock *key"
93 .Fa "krb5_keyblock **subkey"
96 .Fo krb5_generate_subkey_extended
97 .Fa "krb5_context context"
98 .Fa "const krb5_keyblock *key"
99 .Fa "krb5_enctype enctype"
100 .Fa "krb5_keyblock **subkey"
103 .Fo krb5_keyblock_init
104 .Fa "krb5_context context"
105 .Fa "krb5_enctype type"
106 .Fa "const void *data"
108 .Fa "krb5_keyblock *key"
111 .Fo krb5_keyblock_zero
112 .Fa "krb5_keyblock *keyblock"
115 .Fo krb5_random_to_key
116 .Fa "krb5_context context"
117 .Fa "krb5_enctype type"
118 .Fa "const void *data"
120 .Fa "krb5_keyblock *key"
124 holds the encryption key for a specific encryption type.
125 There is no component inside
127 that is directly referable.
129 .Fn krb5_keyblock_get_enctype
130 returns the encryption type of the keyblock.
132 .Fn krb5_copy_keyblock
133 makes a copy the keyblock
139 should be freed by the caller with
140 .Fa krb5_free_keyblock .
142 .Fn krb5_copy_keyblock_contents
143 copies the contents of
148 The destination keyblock is overritten.
150 .Fn krb5_free_keyblock
151 zeros out and frees the content and the keyblock itself.
153 .Fn krb5_free_keyblock_contents
154 zeros out and frees the content of the keyblock.
156 .Fn krb5_generate_random_keyblock
157 creates a new content of the keyblock
159 of type encrytion type
163 is overwritten and not freed, so the caller should be sure it is
164 freed before calling the function.
166 .Fn krb5_generate_subkey
171 The caller must free the subkey with
172 .Fa krb5_free_keyblock .
174 .Fn krb5_generate_subkey_extended
177 of the specified encryption type
185 The caller must free the subkey with
186 .Fa krb5_free_keyblock .
188 .Fn krb5_keyblock_init
191 with key data of type
197 Key should be freed using
198 .Fn krb5_free_keyblock_contents .
200 .Fn krb5_keyblock_zero
201 zeros out the keyblock to to make sure no keymaterial is in
204 .Fn krb5_free_keyblock_contents
205 also zeros out the memory.
207 .Fn krb5_random_to_key
208 converts the random bytestring to a protocol key according to Kerberos
210 It the resulting key will be of type
212 It may be assumed that all the bits of the input string are equally
213 random, even though the entropy present in the random source may be
217 .Xr krb5_crypto_init 3 ,