1NAME(3)                  BSD Library Functions Manual                  NAME(3)
2

NAME

4     krb5_checksum, krb5_checksum_disable, krb5_checksum_is_collision_proof,
5     krb5_checksum_is_keyed, krb5_checksumsize, krb5_cksumtype_valid,
6     krb5_copy_checksum, krb5_create_checksum, krb5_crypto_get_checksum_type
7     krb5_free_checksum, krb5_free_checksum_contents, krb5_hmac,
8     krb5_verify_checksum — creates, handles and verifies checksums
9

LIBRARY

11     Kerberos 5 Library (libkrb5, -lkrb5)
12

SYNOPSIS

14     #include <krb5.h>
15
16     typedef Checksum krb5_checksum;
17
18     void
19     krb5_checksum_disable(krb5_context context, krb5_cksumtype type);
20
21     krb5_boolean
22     krb5_checksum_is_collision_proof(krb5_context context,
23         krb5_cksumtype type);
24
25     krb5_boolean
26     krb5_checksum_is_keyed(krb5_context context, krb5_cksumtype type);
27
28     krb5_error_code
29     krb5_cksumtype_valid(krb5_context context, krb5_cksumtype ctype);
30
31     krb5_error_code
32     krb5_checksumsize(krb5_context context, krb5_cksumtype type,
33         size_t *size);
34
35     krb5_error_code
36     krb5_create_checksum(krb5_context context, krb5_crypto crypto,
37         krb5_key_usage usage, int type, void *data, size_t len,
38         Checksum *result);
39
40     krb5_error_code
41     krb5_verify_checksum(krb5_context context, krb5_crypto crypto,
42         krb5_key_usage usage, void *data, size_t len, Checksum *cksum);
43
44     krb5_error_code
45     krb5_crypto_get_checksum_type(krb5_context context, krb5_crypto crypto,
46         krb5_cksumtype *type);
47
48     void
49     krb5_free_checksum(krb5_context context, krb5_checksum *cksum);
50
51     void
52     krb5_free_checksum_contents(krb5_context context, krb5_checksum *cksum);
53
54     krb5_error_code
55     krb5_hmac(krb5_context context, krb5_cksumtype cktype, const void *data,
56         size_t len, unsigned usage, krb5_keyblock *key, Checksum *result);
57
58     krb5_error_code
59     krb5_copy_checksum(krb5_context context, const krb5_checksum *old,
60         krb5_checksum **new);
61

DESCRIPTION

63     The krb5_checksum structure holds a Kerberos checksum.  There is no com‐
64     ponent inside krb5_checksum that is directly referable.
65
66     The functions are used to create and verify checksums.
67     krb5_create_checksum() creates a checksum of the specified data, and puts
68     it in result.  If crypto is NULL, usage_or_type specifies the checksum
69     type to use; it must not be keyed. Otherwise crypto is an encryption con‐
70     text created by krb5_crypto_init(), and usage_or_type specifies a key-
71     usage.
72
73     krb5_verify_checksum() verifies the checksum against the provided data.
74
75     krb5_checksum_is_collision_proof() returns true is the specified checksum
76     is collision proof (that it's very unlikely that two strings has the same
77     hash value, and that it's hard to find two strings that has the same
78     hash). Examples of collision proof checksums are MD5, and SHA1, while
79     CRC32 is not.
80
81     krb5_checksum_is_keyed() returns true if the specified checksum type is
82     keyed (that the hash value is a function of both the data, and a separate
83     key). Examples of keyed hash algorithms are HMAC-SHA1-DES3, and RSA-
84     MD5-DES. The “plain” hash functions MD5, and SHA1 are not keyed.
85
86     krb5_crypto_get_checksum_type() returns the checksum type that will be
87     used when creating a checksum for the given crypto context.  This func‐
88     tion is useful in combination with krb5_checksumsize() when you want to
89     know the size a checksum will use when you create it.
90
91     krb5_cksumtype_valid() returns 0 or an error if the checksumtype is
92     implemented and not currently disabled in this kerberos library.
93
94     krb5_checksumsize() returns the size of the outdata of checksum function.
95
96     krb5_copy_checksum() returns a copy of the checksum krb5_free_checksum()
97     should use used to free the new checksum.
98
99     krb5_free_checksum() free the checksum and the content of the checksum.
100
101     krb5_free_checksum_contents() frees the content of checksum in cksum.
102
103     krb5_hmac() calculates the HMAC over data (with length len) using the
104     keyusage usage and keyblock key.  Note that keyusage is not always used
105     in checksums.
106
107     krb5_checksum_disable globally disables the checksum type.
108

SEE ALSO

110     krb5_crypto_init(3), krb5_c_encrypt(3), krb5_encrypt(3)
111
112HEIMDAL                         August 12, 2005                        HEIMDAL
Impressum