1.\" $NetBSD: krb5_string_to_key.3,v 1.3 2014/04/24 13:45:34 pettai Exp $ 2.\" 3.\" Copyright (c) 2004 - 2006 Kungliga Tekniska Högskolan 4.\" (Royal Institute of Technology, Stockholm, Sweden). 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" 3. Neither the name of the Institute nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" Id 35.\" 36.Dd July 10, 2006 37.Dt KRB5_STRING_TO_KEY 3 38.Os 39.Sh NAME 40.Nm krb5_string_to_key , 41.Nm krb5_string_to_key_data , 42.Nm krb5_string_to_key_data_salt , 43.Nm krb5_string_to_key_data_salt_opaque , 44.Nm krb5_string_to_key_salt , 45.Nm krb5_string_to_key_salt_opaque , 46.Nm krb5_get_pw_salt , 47.Nm krb5_free_salt 48.Nd turns a string to a Kerberos key 49.Sh LIBRARY 50Kerberos 5 Library (libkrb5, -lkrb5) 51.Sh SYNOPSIS 52.In krb5/krb5.h 53.Ft krb5_error_code 54.Fo krb5_string_to_key 55.Fa "krb5_context context" 56.Fa "krb5_enctype enctype" 57.Fa "const char *password" 58.Fa "krb5_principal principal" 59.Fa "krb5_keyblock *key" 60.Fc 61.Ft krb5_error_code 62.Fo krb5_string_to_key_data 63.Fa "krb5_context context" 64.Fa "krb5_enctype enctype" 65.Fa "krb5_data password" 66.Fa "krb5_principal principal" 67.Fa "krb5_keyblock *key" 68.Fc 69.Ft krb5_error_code 70.Fo krb5_string_to_key_data_salt 71.Fa "krb5_context context" 72.Fa "krb5_enctype enctype" 73.Fa "krb5_data password" 74.Fa "krb5_salt salt" 75.Fa "krb5_keyblock *key" 76.Fc 77.Ft krb5_error_code 78.Fo krb5_string_to_key_data_salt_opaque 79.Fa "krb5_context context" 80.Fa "krb5_enctype enctype" 81.Fa "krb5_data password" 82.Fa "krb5_salt salt" 83.Fa "krb5_data opaque" 84.Fa "krb5_keyblock *key" 85.Fc 86.Ft krb5_error_code 87.Fo krb5_string_to_key_salt 88.Fa "krb5_context context" 89.Fa "krb5_enctype enctype" 90.Fa "const char *password" 91.Fa "krb5_salt salt" 92.Fa "krb5_keyblock *key" 93.Fc 94.Ft krb5_error_code 95.Fo krb5_string_to_key_salt_opaque 96.Fa "krb5_context context" 97.Fa "krb5_enctype enctype" 98.Fa "const char *password" 99.Fa "krb5_salt salt" 100.Fa "krb5_data opaque" 101.Fa "krb5_keyblock *key" 102.Fc 103.Ft krb5_error_code 104.Fo krb5_get_pw_salt 105.Fa "krb5_context context" 106.Fa "krb5_const_principal principal" 107.Fa "krb5_salt *salt" 108.Fc 109.Ft krb5_error_code 110.Fo krb5_free_salt 111.Fa "krb5_context context" 112.Fa "krb5_salt salt" 113.Fc 114.Sh DESCRIPTION 115The string to key functions convert a string to a kerberos key. 116.Pp 117.Fn krb5_string_to_key_data_salt_opaque 118is the function that does all the work, the rest of the functions are 119just wrappers around 120.Fn krb5_string_to_key_data_salt_opaque 121that calls it with default values. 122.Pp 123.Fn krb5_string_to_key_data_salt_opaque 124transforms the 125.Fa password 126with the given salt-string 127.Fa salt 128and the opaque, encryption type specific parameter 129.Fa opaque 130to a encryption key 131.Fa key 132according to the string to key function associated with 133.Fa enctype . 134.Pp 135The 136.Fa key 137should be freed with 138.Fn krb5_free_keyblock_contents . 139.Pp 140If one of the functions that doesn't take a 141.Li krb5_salt 142as it argument 143.Fn krb5_get_pw_salt 144is used to get the salt value. 145.Pp 146.Fn krb5_get_pw_salt 147get the default password salt for a principal, use 148.Fn krb5_free_salt 149to free the salt when done. 150.Pp 151.Fn krb5_free_salt 152frees the content of 153.Fa salt . 154.Sh SEE ALSO 155.Xr krb5 3 , 156.Xr krb5_data 3 , 157.Xr krb5_keyblock 3 , 158.Xr kerberos 8 159