1KRB5_C_MAKE_CHECKSUM(3) BSD Library Functions Manual KRB5_C_MAKE_CHECKSUM(3)
2
4 krb5_c_block_size, krb5_c_decrypt, krb5_c_encrypt, krb5_c_encrypt_length,
5 krb5_c_enctype_compare, krb5_c_get_checksum, krb5_c_is_coll_proof_cksum,
6 krb5_c_is_keyed_cksum, krb5_c_keylength, krb5_c_make_checksum,
7 krb5_c_make_random_key, krb5_c_set_checksum, krb5_c_valid_cksumtype,
8 krb5_c_valid_enctype, krb5_c_verify_checksum, krb5_c_checksum_length —
9 Kerberos 5 crypto API
10
12 Kerberos 5 Library (libkrb5, -lkrb5)
13
15 #include <krb5.h>
16
17 krb5_error_code
18 krb5_c_block_size(krb5_context context, krb5_enctype enctype,
19 size_t *blocksize);
20
21 krb5_error_code
22 krb5_c_decrypt(krb5_context context, const krb5_keyblock key,
23 krb5_keyusage usage, const krb5_data *ivec, krb5_enc_data *input,
24 krb5_data *output);
25
26 krb5_error_code
27 krb5_c_encrypt(krb5_context context, const krb5_keyblock *key,
28 krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input,
29 krb5_enc_data *output);
30
31 krb5_error_code
32 krb5_c_encrypt_length(krb5_context context, krb5_enctype enctype,
33 size_t inputlen, size_t *length);
34
35 krb5_error_code
36 krb5_c_enctype_compare(krb5_context context, krb5_enctype e1,
37 krb5_enctype e2, krb5_boolean *similar);
38
39 krb5_error_code
40 krb5_c_make_random_key(krb5_context context, krb5_enctype enctype,
41 krb5_keyblock *random_key);
42
43 krb5_error_code
44 krb5_c_make_checksum(krb5_context context, krb5_cksumtype cksumtype,
45 const krb5_keyblock *key, krb5_keyusage usage,
46 const krb5_data *input, krb5_checksum *cksum);
47
48 krb5_error_code
49 krb5_c_verify_checksum(krb5_context context, const krb5_keyblock *key,
50 krb5_keyusage usage, const krb5_data *data,
51 const krb5_checksum *cksum, krb5_boolean *valid);
52
53 krb5_error_code
54 krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype,
55 size_t *length);
56
57 krb5_error_code
58 krb5_c_get_checksum(krb5_context context, const krb5_checksum *cksum,
59 krb5_cksumtype *type, krb5_data **data);
60
61 krb5_error_code
62 krb5_c_set_checksum(krb5_context context, krb5_checksum *cksum,
63 krb5_cksumtype type, const krb5_data *data);
64
65 krb5_boolean
66 krb5_c_valid_enctype(krb5_enctype, etype");
67
68 krb5_boolean
69 krb5_c_valid_cksumtype(krb5_cksumtype ctype);
70
71 krb5_boolean
72 krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype);
73
74 krb5_boolean
75 krb5_c_is_keyed_cksum(krb5_cksumtype ctype);
76
77 krb5_error_code
78 krb5_c_keylengths(krb5_context context, krb5_enctype enctype,
79 size_t *inlength, size_t *keylength);
80
82 The functions starting with krb5_c are compat functions with MIT ker‐
83 beros.
84
85 The krb5_enc_data structure holds and encrypted data. There are two pub‐
86 lic accessible members of krb5_enc_data. enctype that holds the encryp‐
87 tion type of the data encrypted and ciphertext that is a krb5_data that
88 might contain the encrypted data.
89
90 krb5_c_block_size() returns the blocksize of the encryption type.
91
92 krb5_c_decrypt() decrypts input and store the data in output. If ivec is
93 NULL the default initialization vector for that encryption type will be
94 used.
95
96 krb5_c_encrypt() encrypts the plaintext in input and store the ciphertext
97 in output.
98
99 krb5_c_encrypt_length() returns the length the encrypted data given the
100 plaintext length.
101
102 krb5_c_enctype_compare() compares to encryption types and returns if they
103 use compatible encryption key types.
104
105 krb5_c_make_checksum() creates a checksum cksum with the checksum type
106 cksumtype of the data in data. key and usage are used if the checksum is
107 a keyed checksum type. Returns 0 or an error code.
108
109 krb5_c_verify_checksum() verifies the checksum of data in cksum that was
110 created with key using the key usage usage. verify is set to non-zero if
111 the checksum verifies correctly and zero if not. Returns 0 or an error
112 code.
113
114 krb5_c_checksum_length() returns the length of the checksum.
115
116 krb5_c_set_checksum() sets the krb5_checksum structure given type and
117 data. The content of cksum should be freeed with
118 krb5_c_free_checksum_contents().
119
120 krb5_c_get_checksum() retrieves the components of the krb5_checksum.
121 structure. data should be free with krb5_free_data(). If some either of
122 data or checksum is not needed for the application, NULL can be passed
123 in.
124
125 krb5_c_valid_enctype() returns true if etype is a valid encryption type.
126
127 krb5_c_valid_cksumtype() returns true if ctype is a valid checksum type.
128
129 krb5_c_is_keyed_cksum() return true if ctype is a keyed checksum type.
130
131 krb5_c_is_coll_proof_cksum() returns true if ctype is a collision proof
132 checksum type.
133
134 krb5_c_keylengths() return the minimum length (inlength) bytes needed to
135 create a key and the length (keylength) of the resulting key for the
136 enctype.
137
139 krb5(3), krb5_create_checksum(3), krb5_free_data(3), kerberos(8)
140
141HEIMDAL Nov 17, 2006 HEIMDAL