DESCRIPTION
These functions create a "service" principal that can, for instance, be used to lookup a key in a keytab. For both these function the sname parameter will be used for the first component of the created principal. If sname is NULL, "host" will be used instead. krb5_sname_to_principal will use the passed hostname for the second component. If type KRB5_NT_SRV_HST this name will be looked up with gethostbyname. If hostname is NULL, the local hostname will be used. krb5_sock_to_principal will use the "sockname" of the passed socket, which should be a bound AF_INET socket.
SEE ALSO
krb5_425_conv_principal(3), krb5_build_principal(3), krb5_free_principal(3), krb5_parse_name(3), krb5_unparse_name(3)