* Forwarding messages with attachments of content-type multipart,
[alpine.git] / pith / smime.h
bloba8ca8dd231709fa0e01decd379158b6a4f0ea291
1 /*
2 * $Id: smime.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2014 Eduardo Chappa
6 * Copyright 2008 University of Washington
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifdef SMIME
18 #ifndef PITH_SMIME_INCLUDED
19 #define PITH_SMIME_INCLUDED
22 #include "../pith/state.h"
23 #include "../pith/send.h"
24 #include "../pith/filttype.h"
25 #include "../pith/smkeys.h"
27 #include <openssl/rand.h>
28 #include <openssl/err.h>
31 #define OUR_PKCS7_ENCLOSURE_SUBTYPE "x-pkcs7-enclosure"
34 /* exported protoypes */
35 int smime_validate_cert(X509 *cert, long *error);
36 int encrypt_file(char *fp, char *text);
37 char *decrypt_file(char *fp, int *rv);
38 int is_pkcs7_body(BODY *b);
39 int fiddle_smime_message(BODY *b, long msgno);
40 int encrypt_outgoing_message(METAENV *header, BODY **bodyP);
41 void free_smime_body_sparep(void **sparep);
42 int sign_outgoing_message(METAENV *header, BODY **bodyP, int dont_detach);
43 void gf_puts_uline(char *txt, gf_io_t pc);
44 PERSONAL_CERT *find_certificate_matching_recip_info(PKCS7_RECIP_INFO *ri);
45 PERSONAL_CERT *get_personal_certs(char *path);
46 void smime_init(void);
47 void smime_deinit(void);
48 void renew_store(void);
49 void renew_cert_data(CertList **data, WhichCerts ctype);
50 BIO *print_private_key_information(char *email, int itype);
52 SMIME_STUFF_S *new_smime_struct(void);
53 int copy_publiccert_dir_to_container(void);
54 int copy_publiccert_container_to_dir(void);
55 int copy_privatecert_dir_to_container(void);
56 int copy_privatecert_container_to_dir(void);
57 int copy_cacert_dir_to_container(void);
58 int copy_cacert_container_to_dir(void);
59 #ifdef APPLEKEYCHAIN
60 int copy_publiccert_container_to_keychain(void);
61 int copy_publiccert_keychain_to_container(void);
62 #endif /* APPLEKEYCHAIN */
63 int import_certificate(WhichCerts);
66 #endif /* PITH_SMIME_INCLUDED */
67 #endif /* SMIME */