/usr/include/claws-mail/passwordstore.h is in libclaws-mail-dev 3.14.1-3+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | /*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
* Copyright (C) 2016 Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __PASSWORDSTORE_H
#define __PASSWORDSTORE_H
#include <glib.h>
typedef enum {
PWS_CORE,
PWS_ACCOUNT,
PWS_PLUGIN,
NUM_PWS_TYPES
} PasswordBlockType;
typedef struct _PasswordBlock {
PasswordBlockType block_type;
gchar *block_name;
GHashTable *entries;
} PasswordBlock;
/* Saves a password into a chosen password block.
* The block is created if it doesn't exist.
* block_type - from PasswordBlockType
* block_name - name of the block
* password_id - ID of the saved password
* password - the actual password string
* encrypted - TRUE if the password string is in an already encrypted form
* (useful mostly for migration from accountrc)
*
* Function will make a copy of the strings where necessary and doesn't
* take ownership of any of the passed arguments. */
gboolean passwd_store_set(PasswordBlockType block_type,
const gchar *block_name,
const gchar *password_id,
const gchar *password,
gboolean encrypted);
/* Retrieves a password. Returned string should be freed by the caller. */
gchar *passwd_store_get(PasswordBlockType block_type,
const gchar *block_name,
const gchar *password_id);
gboolean passwd_store_delete_block(PasswordBlockType block_type,
const gchar *block_name);
/* Reencrypts all stored passwords using new_mpwd as an encryption
* password. */
void passwd_store_reencrypt_all(const gchar *old_mpwd,
const gchar *new_mpwd);
/* Writes/reads password store to/from file. */
void passwd_store_write_config(void);
void passwd_store_read_config(void);
/* Convenience wrappers for handling account passwords.
* (This is to save some boilerplate code converting account_id to
* a string and freeing the string afterwards.) */
gboolean passwd_store_set_account(gint account_id,
const gchar *password_id,
const gchar *password,
gboolean encrypted);
gchar *passwd_store_get_account(gint account_id, const gchar *block_name);
/* Macros for standard, predefined password IDs. */
#define PWS_ACCOUNT_RECV "recv"
#define PWS_ACCOUNT_SEND "send"
#define PWS_ACCOUNT_RECV_CERT "recv_cert"
#define PWS_ACCOUNT_SEND_CERT "send_cert"
#endif /* __PASSWORDSTORE_H */
|