1 .\" Copyright (c) 1999-2005 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_create_checksum.3 15921 2005-08-12 09:01:22Z lha $
40 .Nm krb5_checksum_disable ,
41 .Nm krb5_checksum_is_collision_proof ,
42 .Nm krb5_checksum_is_keyed ,
43 .Nm krb5_checksumsize ,
44 .Nm krb5_cksumtype_valid ,
45 .Nm krb5_copy_checksum ,
46 .Nm krb5_create_checksum ,
47 .Nm krb5_crypto_get_checksum_type
48 .Nm krb5_free_checksum ,
49 .Nm krb5_free_checksum_contents ,
51 .Nm krb5_verify_checksum
52 .Nd creates, handles and verifies checksums
54 Kerberos 5 Library (libkrb5, -lkrb5)
58 .Li "typedef Checksum krb5_checksum;"
60 .Fo krb5_checksum_disable
61 .Fa "krb5_context context"
62 .Fa "krb5_cksumtype type"
65 .Fo krb5_checksum_is_collision_proof
66 .Fa "krb5_context context"
67 .Fa "krb5_cksumtype type"
70 .Fo krb5_checksum_is_keyed
71 .Fa "krb5_context context"
72 .Fa "krb5_cksumtype type"
75 .Fo krb5_cksumtype_valid
76 .Fa "krb5_context context"
77 .Fa "krb5_cksumtype ctype"
81 .Fa "krb5_context context"
82 .Fa "krb5_cksumtype type"
86 .Fo krb5_create_checksum
87 .Fa "krb5_context context"
88 .Fa "krb5_crypto crypto"
89 .Fa "krb5_key_usage usage"
93 .Fa "Checksum *result"
96 .Fo krb5_verify_checksum
97 .Fa "krb5_context context"
98 .Fa "krb5_crypto crypto"
99 .Fa "krb5_key_usage usage"
102 .Fa "Checksum *cksum"
105 .Fo krb5_crypto_get_checksum_type
106 .Fa "krb5_context context"
107 .Fa "krb5_crypto crypto"
108 .Fa "krb5_cksumtype *type"
111 .Fo krb5_free_checksum
112 .Fa "krb5_context context"
113 .Fa "krb5_checksum *cksum"
116 .Fo krb5_free_checksum_contents
117 .Fa "krb5_context context"
118 .Fa "krb5_checksum *cksum"
122 .Fa "krb5_context context"
123 .Fa "krb5_cksumtype cktype"
124 .Fa "const void *data"
127 .Fa "krb5_keyblock *key"
128 .Fa "Checksum *result"
131 .Fo krb5_copy_checksum
132 .Fa "krb5_context context"
133 .Fa "const krb5_checksum *old"
134 .Fa "krb5_checksum **new"
139 structure holds a Kerberos checksum.
140 There is no component inside
142 that is directly referable.
144 The functions are used to create and verify checksums.
145 .Fn krb5_create_checksum
146 creates a checksum of the specified data, and puts it in
153 specifies the checksum type to use; it must not be keyed. Otherwise
155 is an encryption context created by
156 .Fn krb5_crypto_init ,
159 specifies a key-usage.
161 .Fn krb5_verify_checksum
164 against the provided data.
166 .Fn krb5_checksum_is_collision_proof
167 returns true is the specified checksum is collision proof (that it's
168 very unlikely that two strings has the same hash value, and that it's
169 hard to find two strings that has the same hash). Examples of
170 collision proof checksums are MD5, and SHA1, while CRC32 is not.
172 .Fn krb5_checksum_is_keyed
173 returns true if the specified checksum type is keyed (that the hash
174 value is a function of both the data, and a separate key). Examples of
175 keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The
177 hash functions MD5, and SHA1 are not keyed.
179 .Fn krb5_crypto_get_checksum_type
180 returns the checksum type that will be used when creating a checksum for the given
183 This function is useful in combination with
184 .Fn krb5_checksumsize
185 when you want to know the size a checksum will
186 use when you create it.
188 .Fn krb5_cksumtype_valid
189 returns 0 or an error if the checksumtype is implemented and not
190 currently disabled in this kerberos library.
192 .Fn krb5_checksumsize
193 returns the size of the outdata of checksum function.
195 .Fn krb5_copy_checksum
196 returns a copy of the checksum
197 .Fn krb5_free_checksum
198 should use used to free the
202 .Fn krb5_free_checksum
203 free the checksum and the content of the checksum.
205 .Fn krb5_free_checksum_contents
206 frees the content of checksum in
210 calculates the HMAC over
218 Note that keyusage is not always used in checksums.
220 .Nm krb5_checksum_disable
221 globally disables the checksum type.
225 .Xr krb5_crypto_init 3 ,
226 .Xr krb5_c_encrypt 3 ,