1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
4 * Michael Zucchi <notzed@ximian.com>
6 * Copyright 2002,2003 Ximian, Inc. (www.ximian.com)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __CAMEL_SMIME_CONTEXT_H__
25 #define __CAMEL_SMIME_CONTEXT_H__
27 #include <camel/camel-cipher-context.h>
29 #define CAMEL_SMIME_CONTEXT_TYPE (camel_smime_context_get_type())
30 #define CAMEL_SMIME_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContext))
31 #define CAMEL_SMIME_CONTEXT_CLASS(k)(CAMEL_CHECK_CLASS_CAST((k), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContextClass))
32 #define CAMEL_IS_SMIME_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SMIME_CONTEXT_TYPE))
36 typedef enum _camel_smime_sign_t {
37 CAMEL_SMIME_SIGN_CLEARSIGN,
38 CAMEL_SMIME_SIGN_ENVELOPED
41 typedef enum _camel_smime_describe_t {
42 CAMEL_SMIME_SIGNED = 1<<0,
43 CAMEL_SMIME_ENCRYPTED = 1<<1,
44 CAMEL_SMIME_CERTS = 1<<2,
45 CAMEL_SMIME_CRLS = 1<<3,
46 } camel_smime_describe_t;
48 typedef struct _CamelSMIMEContext CamelSMIMEContext;
49 typedef struct _CamelSMIMEContextClass CamelSMIMEContextClass;
51 struct _CamelSMIMEContext {
52 CamelCipherContext cipher;
54 struct _CamelSMIMEContextPrivate *priv;
57 struct _CamelSMIMEContextClass {
58 CamelCipherContextClass cipher_class;
61 CamelType camel_smime_context_get_type(void);
63 CamelCipherContext *camel_smime_context_new(CamelSession *session);
65 /* nick to use for SMIMEEncKeyPrefs attribute for signed data */
66 void camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const char *key);
67 /* set signing mode, clearsigned multipart/signed or enveloped */
68 void camel_smime_context_set_sign_mode(CamelSMIMEContext *context, camel_smime_sign_t type);
70 guint32 camel_smime_context_describe_part(CamelSMIMEContext *, struct _CamelMimePart *);
74 #endif /* __CAMEL_SMIME_CONTEXT_H__ */