X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fcrypt.h;h=4f550aff7cf488eb2a58d870037691c22812a70c;hb=7dea2ed3be5f5aaa2975647e69a414925ccb3cb8;hp=2b9434c03f36a7f281980ad46f09a19dacca3f29;hpb=4761fa78a6dfc9437caa6e6e0aac806e50e01c83;p=apps%2Fmadmutt.git diff --git a/lib-crypt/crypt.h b/lib-crypt/crypt.h index 2b9434c..4f550af 100644 --- a/lib-crypt/crypt.h +++ b/lib-crypt/crypt.h @@ -16,14 +16,13 @@ #ifndef MUTT_CRYPT_H #define MUTT_CRYPT_H -#include "mutt.h" /* Need this to declare BODY, address_t. STATE etc. */ +#include #include "state.h" /* FIXME: They should be pointer to anonymous structures for better information hiding. */ - #define ENCRYPT (1 << 0) #define SIGN (1 << 1) #define GOODSIGN (1 << 2) @@ -83,27 +82,21 @@ typedef struct pgp_keyinfo *pgp_key_t; int mutt_protect (HEADER *, char *); -int mutt_is_multipart_encrypted (BODY *); - -int mutt_is_multipart_signed (BODY *); - -int mutt_is_application_pgp (BODY *); - -int mutt_is_application_smime (BODY *); - int mutt_signed_handler (BODY *, STATE *); int mutt_parse_crypt_hdr (char *, int); - void convert_to_7bit (BODY *); +/*-- new API --*/ -/*-- crypt.c --*/ +void crypt_invoke_import(FILE *stream, int smime); +int crypt_send_menu(HEADER *msg, int *redraw, int smime); +int crypt_verify_one(BODY *, STATE *s, FILE *fp, int smime); -/* Print the current time. */ -void crypt_current_time (STATE * s, const char *app_name); + +/*-- crypt.c --*/ /* Check out the type of encryption used and set the cached status values if there are any. */ @@ -123,24 +116,12 @@ void crypt_forget_passphrase (void); /* Check that we have a usable passphrase, ask if not. */ int crypt_valid_passphrase (int); -/* Write the message body/part A described by state S to a the given - TEMPFILE. */ -int crypt_write_signed (BODY * a, STATE * s, const char *tempf); - - /*-- cryptglue.c --*/ /* Show a message that a backend will be invoked. */ void crypt_invoke_message (int type); - -/* Silently forget about a passphrase. */ -void crypt_pgp_void_passphrase (void); - -int crypt_pgp_valid_passphrase (void); - - /* Decrypt a PGP/MIME message. */ int crypt_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c, BODY ** d); @@ -160,19 +141,12 @@ pgp_key_t crypt_pgp_ask_for_key (char *tag, char *whatfor, /* Check for a traditional PGP message in body B. */ int crypt_pgp_check_traditional (FILE * fp, BODY * b, int tagged_only); -/* fixme: needs documentation. */ -BODY *crypt_pgp_traditional_encryptsign (BODY * a, int flags, char *keylist); - /* Release the PGP key KPP (note, that we pass a pointer to it). */ void crypt_pgp_free_key (pgp_key_t * kpp); /* Generate a PGP public key attachment. */ BODY *crypt_pgp_make_key_attachment (char *tempf); -/* This routine attempts to find the keyids of the recipients of a - message. It returns NULL if any of the keys can not be found. */ -char *crypt_pgp_findkeys (address_t * to, address_t * cc, address_t * bcc); - /* Create a new body with a PGP signed message from A. */ BODY *crypt_pgp_sign_message (BODY * a); @@ -180,14 +154,6 @@ BODY *crypt_pgp_sign_message (BODY * a); later. This is necessary for $fcc_attach. */ BODY *crypt_pgp_encrypt_message (BODY * a, char *keylist, int sign); -/* Invoke the PGP command to import a key. */ -void crypt_pgp_invoke_import (const char *fname); - -int crypt_pgp_send_menu (HEADER * msg, int *redraw); - -/* fixme: needs documentation */ -int crypt_pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempf); - /* Access the keyID in K. */ char *crypt_pgp_keyid (pgp_key_t k); @@ -196,14 +162,6 @@ void crypt_pgp_extract_keys_from_attachment_list (FILE * fp, int tag, BODY * top); - - - -/* Silently forget about a passphrase. */ -void crypt_smime_void_passphrase (void); - -int crypt_smime_valid_passphrase (void); - /* Decrypt an S/MIME message. */ int crypt_smime_decrypt_mime (FILE * a, FILE ** b, BODY * c, BODY ** d); @@ -219,24 +177,10 @@ int crypt_smime_verify_sender (HEADER * h); /* Ask for an SMIME key. */ char *crypt_smime_ask_for_key (char *prompt, char *mailbox, short public); -/* This routine attempts to find the keyids of the recipients of a - message. It returns NULL if any of the keys can not be found. */ -char *crypt_smime_findkeys (address_t * to, address_t * cc, address_t * bcc); - /* fixme: Needs documentation. */ BODY *crypt_smime_sign_message (BODY * a); /* fixme: needs documentation. */ BODY *crypt_smime_build_smime_entity (BODY * a, char *certlist); -/* Add a certificate and update index file (externally). */ -void crypt_smime_invoke_import (char *infile, char *mailbox); - -int crypt_smime_send_menu (HEADER * msg, int *redraw); - -/* fixme: needs documentation */ -int crypt_smime_verify_one (BODY * sigbdy, STATE * s, const char *tempf); - -void crypt_init (void); - #endif /*MUTT_CRYPT_H */