2 * kernel keyring syscall wrappers
4 * Copyright (C) 2016-2020 Red Hat, Inc. All rights reserved.
5 * Copyright (C) 2016-2020 Ondrej Kozina
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef _UTILS_KEYRING
23 #define _UTILS_KEYRING
27 typedef enum { LOGON_KEY = 0, USER_KEY } key_type_t;
29 const char *key_type_name(key_type_t ktype);
31 int keyring_check(void);
33 int keyring_get_key(const char *key_desc,
37 int keyring_get_passphrase(const char *key_desc,
39 size_t *passphrase_len);
41 int keyring_add_key_in_thread_keyring(
47 int keyring_add_key_in_user_keyring(
53 int keyring_revoke_and_unlink_key(key_type_t ktype, const char *key_desc);