krb5_parse_name

Function krb5_parse_name 

Source
pub unsafe extern "C" fn krb5_parse_name(
    context: krb5_context,
    name: *const c_char,
    principal_out: *mut krb5_principal,
) -> krb5_error_code
Expand description

Convert a string principal name to a krb5_principal structure.

@param [in] context Library context @param [in] name String representation of a principal name @param [out] principal_out New principal

Convert a string representation of a principal name to a krb5_principal structure.

A string representation of a Kerberos name consists of one or more principal name components, separated by slashes, optionally followed by the @ character and a realm name. If the realm name is not specified, the local realm is used.

To use the slash and @ symbols as part of a component (quoted) instead of using them as a component separator or as a realm prefix), put a backslash () character in front of the symbol. Similarly, newline, tab, backspace, and NULL characters can be included in a component by using @c n, @c t, @c b or @c 0, respectively.

@note The realm in a Kerberos @a name cannot contain slash, colon, or NULL characters.

Beginning with release 1.20, the name type of the principal will be inferred as @c KRB5_NT_SRV_INST or @c KRB5_NT_WELLKNOWN based on the principal name. The type will be @c KRB5_NT_PRINCIPAL if a type cannot be inferred.

Use krb5_free_principal() to free @a principal_out when it is no longer needed.

@retval 0 Success @return Kerberos error codes