pgp.h 4.01 KB
Newer Older
Thomas Roessler's avatar
Thomas Roessler committed
1
/*
2
 * Copyright (C) 1996-1997 Michael R. Elkins <me@mutt.org>
3
 * Copyright (C) 1999-2003 Thomas Roessler <roessler@does-not-exist.org>
4
 * Copyright (C) 2004 g10 Code GmbH
5
 *
Thomas Roessler's avatar
Thomas Roessler committed
6 7 8 9 10 11 12 13 14 15 16 17
 *     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 2 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, write to the Free Software
18
 *     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
 */
Thomas Roessler's avatar
Thomas Roessler committed
20

21
#ifdef CRYPT_BACKEND_CLASSIC_PGP
Thomas Roessler's avatar
Thomas Roessler committed
22

23
#include "mutt_crypt.h"
24
#include "pgplib.h"
Thomas Roessler's avatar
Thomas Roessler committed
25 26


27
/* prototypes */
28

29
int pgp_use_gpg_agent(void);
30

31
int pgp_check_traditional (FILE *, BODY *, int);
32
BODY *pgp_decrypt_part (BODY *, STATE *, FILE *, BODY *);
Thomas Roessler's avatar
Thomas Roessler committed
33
BODY *pgp_make_key_attachment (char *);
34
const char *pgp_micalg (const char *fname);
Thomas Roessler's avatar
Thomas Roessler committed
35

36 37
char *_pgp_keyid (pgp_key_t);
char *pgp_keyid (pgp_key_t);
38 39
char *pgp_short_keyid (pgp_key_t);
char *pgp_long_keyid (pgp_key_t);
40 41
char *pgp_fingerprint (pgp_key_t k);
char *pgp_fpr_or_lkeyid (pgp_key_t k);
Thomas Roessler's avatar
Thomas Roessler committed
42 43


44
int mutt_check_pgp (HEADER * h);
45

46
int pgp_decrypt_mime (FILE *, FILE **, BODY *, BODY **);
47

48
/* int pgp_string_matches_hint (const char *s, LIST * hints); */
49

50 51 52
/* pgp_key_t gpg_get_candidates (struct pgp_vinfo *, pgp_ring_t, LIST *); */
pgp_key_t pgp_ask_for_key (char *, char *, short, pgp_ring_t);
pgp_key_t pgp_get_candidates (pgp_ring_t, LIST *);
53
pgp_key_t pgp_getkeybyaddr (ADDRESS *, short, pgp_ring_t, int);
54 55
pgp_key_t pgp_getkeybystr (char *, short, pgp_ring_t);

56
char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode);
Thomas Roessler's avatar
Thomas Roessler committed
57

58
void pgp_forget_passphrase (void);
59 60
int pgp_application_pgp_handler (BODY *, STATE *);
int pgp_encrypted_handler (BODY *, STATE *);
61
void pgp_extract_keys_from_attachment_list (FILE * fp, int tag, BODY * top);
Thomas Roessler's avatar
Thomas Roessler committed
62
void pgp_void_passphrase (void);
63
int pgp_valid_passphrase (void);
Thomas Roessler's avatar
Thomas Roessler committed
64

65

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
/* The PGP invocation interface - not really beautiful. */

pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			 int pgpinfd, int pgpoutfd, int pgperrfd, 
			 const char *fname, short need_passphrase);
pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			 int pgpinfd, int pgpoutfd, int pgperrfd, 
			 const char *fname, const char *sig_fname);
pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			  int pgpinfd, int pgpoutfd, int pgperrfd, 
			  const char *fname);
pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr,
		       int pgpinfd, int pgpoutfd, int pgperrfd, 
		       const char *fname);
pid_t pgp_invoke_encrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			  int pgpinfd, int pgpoutfd, int pgperrfd,
			  const char *fname, const char *uids, int sign);
pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			 int pgpinfd, int pgpoutfd, int pgperrfd, 
			 const char *uids);
pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			     int pgpinfd, int pgpoutfd, int pgperrfd, 
			     const char *uids);
pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			    int pgpinfd, int pgpoutfd, int pgperrfd, 
			    pgp_ring_t keyring, LIST *hints);
92 93 94
pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr,
			  int pgpinfd, int pgpoutfd, int pgperrfd,
			  const char *fname, const char *uids, int flags);
Thomas Roessler's avatar
Thomas Roessler committed
95 96


97 98 99
void pgp_invoke_import (const char *fname);
void pgp_invoke_getkeys (ADDRESS *);

100 101 102 103 104 105 106

/* private ? */
int pgp_verify_one (BODY *, STATE *, const char *);
BODY *pgp_traditional_encryptsign (BODY *, int, char *);
BODY *pgp_encrypt_message (BODY *, char *, int);
BODY *pgp_sign_message (BODY *);

107
int pgp_send_menu (HEADER *msg);
108

109
#endif /* CRYPT_BACKEND_CLASSIC_PGP */