talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

password.h (1650B)


      1 /*
      2  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
      3  * Copyright (C) 2016-2023 The Claws Mail team
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License as published by
      7  * the Free Software Foundation; either version 3 of the License, or
      8  * (at your option) any later version.
      9  *
     10  * This program is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  * GNU General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU General Public License
     16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
     17  */
     18 
     19 #ifndef __PASSWORD_H
     20 #define __PASSWORD_H
     21 
     22 #include <glib.h>
     23 
     24 gchar *password_encrypt_gnutls(const gchar *password,
     25 		const gchar *encryption_passphrase);
     26 gchar *password_decrypt_gnutls(const gchar *password,
     27 		const gchar *decryption_passphrase);
     28 #define password_encrypt_real(n, m) password_encrypt_gnutls(n, m)
     29 #define password_decrypt_real(n, m) password_decrypt_gnutls(n, m)
     30 
     31 /* Wrapper function that will apply best encryption available,
     32  * and return a string ready to be saved as-is in preferences. */
     33 gchar *password_encrypt(const gchar *password,
     34 		const gchar *encryption_passphrase);
     35 
     36 /* This is a wrapper function that looks at the whole string from
     37  * prefs (e.g. including the leading '!' for old implementation),
     38  * and tries to do the smart thing. */
     39 gchar *password_decrypt(const gchar *password,
     40 		const gchar *decryption_passphrase);
     41 
     42 #endif /* __PASSWORD_H */