1FIND_KEY_BY_TYPE_AND_NAME(3)Linux Key Utility CallsFIND_KEY_BY_TYPE_AND_NAME(3)
2
3
4

NAME

6       find_key_by_type_and_name - find a key by type and name
7

SYNOPSIS

9       #include <keyutils.h>
10
11       key_serial_t find_key_by_type_and_name(const char *type,
12           const char *description, key_serial_t destringid);
13

DESCRIPTION

15       find_key_by_type_and_name()  searches for a key with the given type and
16       exact description, firstly in the thread, process and session  keyrings
17       to which a process is subscribed and secondly in /proc/keys.
18
19       If  a  key  is  found, and destringid is not 0 and specifies a keyring,
20       then the found key will be linked into it.
21

RETURN VALUE

23       The function returns the ID of the key if a key was found or -1  other‐
24       wise.
25

ERRORS

27       ENOKEY No key was found or the keyring specified is invalid.
28
29       EKEYEXPIRED
30              The key or keyring have expired.
31
32       EKEYREVOKED
33              The key or keyring have been revoked.
34
35       EACCES The key is not accessible or keyring exists, but is not writable
36              by the calling process.
37

LINKING

39       When linking, -lkeyutils should be specified to the linker.
40

SEE ALSO

42       request_key(2), keyctl(3), keyrings(7)
43
44
45
46Linux                             10 Sep 2013     FIND_KEY_BY_TYPE_AND_NAME(3)
Impressum