1 .\" Copyright (c) 2003 - 2006 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
35 .Dt KRB5_C_MAKE_CHECKSUM 3
38 .Nm krb5_c_block_size ,
41 .Nm krb5_c_encrypt_length ,
42 .Nm krb5_c_enctype_compare ,
43 .Nm krb5_c_get_checksum ,
44 .Nm krb5_c_is_coll_proof_cksum ,
45 .Nm krb5_c_is_keyed_cksum ,
46 .Nm krb5_c_keylength ,
47 .Nm krb5_c_make_checksum ,
48 .Nm krb5_c_make_random_key ,
49 .Nm krb5_c_set_checksum ,
50 .Nm krb5_c_valid_cksumtype ,
51 .Nm krb5_c_valid_enctype ,
52 .Nm krb5_c_verify_checksum ,
53 .Nm krb5_c_checksum_length
54 .Nd Kerberos 5 crypto API
56 Kerberos 5 Library (libkrb5, -lkrb5)
62 .Fa "krb5_context context"
63 .Fa "krb5_enctype enctype"
64 .Fa "size_t *blocksize"
68 .Fa "krb5_context context"
69 .Fa "const krb5_keyblock key"
70 .Fa "krb5_keyusage usage"
71 .Fa "const krb5_data *ivec"
72 .Fa "krb5_enc_data *input"
73 .Fa "krb5_data *output"
77 .Fa "krb5_context context"
78 .Fa "const krb5_keyblock *key"
79 .Fa "krb5_keyusage usage"
80 .Fa "const krb5_data *ivec"
81 .Fa "const krb5_data *input"
82 .Fa "krb5_enc_data *output"
85 .Fo krb5_c_encrypt_length
86 .Fa "krb5_context context"
87 .Fa "krb5_enctype enctype"
92 .Fo krb5_c_enctype_compare
93 .Fa "krb5_context context"
96 .Fa "krb5_boolean *similar"
99 .Fo krb5_c_make_random_key
100 .Fa "krb5_context context"
101 .Fa "krb5_enctype enctype"
102 .Fa "krb5_keyblock *random_key"
105 .Fo krb5_c_make_checksum
106 .Fa "krb5_context context"
107 .Fa "krb5_cksumtype cksumtype"
108 .Fa "const krb5_keyblock *key"
109 .Fa "krb5_keyusage usage"
110 .Fa "const krb5_data *input"
111 .Fa "krb5_checksum *cksum"
114 .Fo krb5_c_verify_checksum
115 .Fa "krb5_context context
116 .Fa "const krb5_keyblock *key"
117 .Fa "krb5_keyusage usage"
118 .Fa "const krb5_data *data"
119 .Fa "const krb5_checksum *cksum"
120 .Fa "krb5_boolean *valid"
123 .Fo krb5_c_checksum_length
124 .Fa "krb5_context context"
125 .Fa "krb5_cksumtype cksumtype"
129 .Fo krb5_c_get_checksum
130 .Fa "krb5_context context"
131 .Fa "const krb5_checksum *cksum"
132 .Fa "krb5_cksumtype *type"
133 .Fa "krb5_data **data"
136 .Fo krb5_c_set_checksum
137 .Fa "krb5_context context"
138 .Fa "krb5_checksum *cksum"
139 .Fa "krb5_cksumtype type"
140 .Fa "const krb5_data *data"
143 .Fo krb5_c_valid_enctype
144 .Fa krb5_enctype etype"
147 .Fo krb5_c_valid_cksumtype
148 .Fa "krb5_cksumtype ctype"
151 .Fo krb5_c_is_coll_proof_cksum
152 .Fa "krb5_cksumtype ctype"
155 .Fo krb5_c_is_keyed_cksum
156 .Fa "krb5_cksumtype ctype"
159 .Fo krb5_c_keylengths
160 .Fa "krb5_context context"
161 .Fa "krb5_enctype enctype"
162 .Fa "size_t *inlength"
163 .Fa "size_t *keylength"
166 The functions starting with krb5_c are compat functions with MIT kerberos.
170 structure holds and encrypted data.
171 There are two public accessable members of
174 that holds the encryption type of the data encrypted and
178 that might contain the encrypted data.
180 .Fn krb5_c_block_size
181 returns the blocksize of the encryption type.
186 and store the data in
192 the default initialization vector for that encryption type will be used.
195 encrypts the plaintext in
197 and store the ciphertext in
200 .Fn krb5_c_encrypt_length
201 returns the length the encrypted data given the plaintext length.
203 .Fn krb5_c_enctype_compare
204 compares to encryption types and returns if they use compatible
205 encryption key types.
207 .Fn krb5_c_make_checksum
210 with the checksum type
217 are used if the checksum is a keyed checksum type.
218 Returns 0 or an error code.
220 .Fn krb5_c_verify_checksum
221 verifies the checksum
226 that was created with
231 is set to non-zero if the checksum verifies correctly and zero if not.
232 Returns 0 or an error code.
234 .Fn krb5_c_checksum_length
235 returns the length of the checksum.
237 .Fn krb5_c_set_checksum
246 should be freeed with
247 .Fn krb5_c_free_checksum_contents .
249 .Fn krb5_c_get_checksum
250 retrieves the components of the
260 is not needed for the application,
264 .Fn krb5_c_valid_enctype
267 is a valid encryption type.
269 .Fn krb5_c_valid_cksumtype
272 is a valid checksum type.
274 .Fn krb5_c_is_keyed_cksum
277 is a keyed checksum type.
279 .Fn krb5_c_is_coll_proof_cksum
282 is a collition proof checksum type.
284 .Fn krb5_c_keylengths
285 return the minimum length (
287 bytes needed to create a key and the
295 .Xr krb5_create_checksum 3 ,
296 .Xr krb5_free_data 3 ,