xref: /freebsd/crypto/krb5/doc/html/_sources/appdev/refs/api/krb5_parse_name.rst.txt (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1krb5_parse_name -  Convert a string principal name to a krb5_principal structure.
2==================================================================================
3
4..
5
6.. c:function:: krb5_error_code krb5_parse_name(krb5_context context, const char * name, krb5_principal * principal_out)
7
8..
9
10
11:param:
12
13	          **[in]** **context** - Library context
14
15	          **[in]** **name** - String representation of a principal name
16
17	          **[out]** **principal_out** - New principal
18
19
20..
21
22
23:retval:
24         -   0   Success
25
26
27:return:
28         -  Kerberos error codes
29
30..
31
32
33
34
35
36
37
38Convert a string representation of a principal name to a krb5_principal structure.
39
40
41
42A 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.
43
44
45
46To 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 **n** , **t** , **b** or **0** , respectively.
47
48
49
50Beginning with release 1.20, the name type of the principal will be inferred as **KRB5_NT_SRV_INST** or **KRB5_NT_WELLKNOWN** based on the principal name. The type will be **KRB5_NT_PRINCIPAL** if a type cannot be inferred.
51
52
53
54Use krb5_free_principal() to free *principal_out* when it is no longer needed.
55
56
57
58
59
60
61
62
63
64
65..
66
67
68
69
70
71
72.. note::
73
74	 The realm in a Kerberos *name* cannot contain slash, colon, or NULL characters.
75
76
77
78
79