xref: /freebsd/crypto/krb5/doc/html/_sources/appdev/refs/api/krb5_cc_retrieve_cred.rst.txt (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1krb5_cc_retrieve_cred -  Retrieve a specified credentials from a credential cache.
2===================================================================================
3
4..
5
6.. c:function:: krb5_error_code krb5_cc_retrieve_cred(krb5_context context, krb5_ccache cache, krb5_flags flags, krb5_creds * mcreds, krb5_creds * creds)
7
8..
9
10
11:param:
12
13	          **[in]** **context** - Library context
14
15	          **[in]** **cache** - Credential cache handle
16
17	          **[in]** **flags** - Flags bit mask
18
19	          **[in]** **mcreds** - Credentials to match
20
21	          **[out]** **creds** - Credentials matching the requested value
22
23
24..
25
26
27:retval:
28         -   0   Success; otherwise - Kerberos error codes
29
30
31..
32
33
34
35
36
37
38
39This function searches a credential cache for credentials matching *mcreds* and returns it if found.
40
41
42
43Valid values for *flags* are:
44
45
46
47
48
49	 - #KRB5_TC_MATCH_TIMES The requested lifetime must be at least as great as in *mcreds* .
50
51
52	 - #KRB5_TC_MATCH_IS_SKEY The *is_skey* field much match exactly.
53
54
55	 - #KRB5_TC_MATCH_FLAGS Flags set in *mcreds* must be set.
56
57
58	 - #KRB5_TC_MATCH_TIMES_EXACT The requested lifetime must match exactly.
59
60
61	 - #KRB5_TC_MATCH_FLAGS_EXACT Flags must match exactly.
62
63
64	 - #KRB5_TC_MATCH_AUTHDATA The authorization data must match.
65
66
67	 - #KRB5_TC_MATCH_SRV_NAMEONLY Only the name portion of the principal name must match, not the realm.
68
69
70	 - #KRB5_TC_MATCH_2ND_TKT The second tickets must match.
71
72
73	 - #KRB5_TC_MATCH_KTYPE The encryption key types must match.
74
75
76	 - #KRB5_TC_SUPPORTED_KTYPES Check all matching entries that have any supported encryption type and return the one with the encryption type listed earliest.
77
78 Use krb5_free_cred_contents() to free *creds* when it is no longer needed.
79
80
81
82
83
84
85
86
87
88
89..
90
91
92
93
94
95