1KEYCTL_CAPABILITIES(3)    Linux Key Management Calls    KEYCTL_CAPABILITIES(3)
2
3
4

NAME

6       keyctl_capabilities - Query subsystem capabilities
7

SYNOPSIS

9       #include <keyutils.h>
10
11       long keyctl_capabilities(unsigned char *buffer, size_t buflen);
12

DESCRIPTION

14       keyctl_capabilities()  queries  the keyrings subsystem in the kernel to
15       ask about its capabilities and fills in the array in  the  buffer  with
16       bits  that indicate the presence or absence of specific features in the
17       keyrings subsystem.
18
19       The function returns the amount of data the kernel has available, irre‐
20       spective  of  the  amount  of buffer space available.  If the buffer is
21       shorter than the data, a short copy will be  made;  if  the  buffer  is
22       larger than the data, the excess space will be cleared.
23
24       If  this operation is not available in the kernel, the keyutils library
25       will be emulate it as best it can and the capability bit that indicates
26       if the kernel operation is available will be cleared.
27
28       In buffer[0], the following capabilities exist:
29
30       KEYCTL_CAPS0_CAPABILITIES
31              This  is  set  if the kernel supports this operation and cleared
32              otherwise.  If it is cleared, the rest of  the  flags  are  emu‐
33              lated.
34
35       KEYCTL_CAPS0_PERSISTENT_KEYRINGS
36              This  is  set  if  the  kernel  supports persistent keyrings and
37              cleared otherwise.  See keyctl_get_persistent(3).
38
39       KEYCTL_CAPS0_DIFFIE_HELLMAN
40              This is set if the kernel  supports  Diffie-Hellman  calculation
41              and cleared otherwise.  See keyctl_dh_compute(3).
42
43       KEYCTL_CAPS0_PUBLIC_KEY
44              This  is  set  if  the kernel supports public-key operations and
45              cleared otherwise.  See keyctl_pkey_query(3).
46
47       KEYCTL_CAPS0_BIG_KEY
48              This is set if the kernel supports  the  big_key  key  type  and
49              cleared otherwise.
50
51       KEYCTL_CAPS0_INVALIDATE
52              This  is set if the kernel supports key invalidation and cleared
53              otherwise.  See keyctl_invalidate(3).
54
55       KEYCTL_CAPS0_RESTRICT_KEYRING
56              This is set if the kernel supports restrictions on keyrings  and
57              cleared otherwise.  See keyctl_restrict_keyring(3).
58
59       KEYCTL_CAPS0_MOVE
60              This  is  set  if the kernel supports the move key operation and
61              cleared otherwise.  See keyctl_move(3).
62

RETURN VALUE

64       On success keyctl_capabilities() returns the size of the  data  it  has
65       available, irrespective of the size of the buffer.  On error, the value
66       -1 will be returned and errno will have  been  set  to  an  appropriate
67       error.
68

ERRORS

70       EFAULT The buffer cannot be written to.
71

LINKING

73       This  is  a  library  function  that can be found in libkeyutils.  When
74       linking, -lkeyutils should be specified to the linker.
75

SEE ALSO

77       keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3),
78       keyrings(7), keyutils(7)
79
80
81
82Linux                             30 May 2019           KEYCTL_CAPABILITIES(3)
Impressum