1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 * camel-signed--multipart.h : class for a signed-multipart
4 * Authors: Michael Zucchi <notzed@ximian.com>
6 * Copyright 2002 Ximian, Inc. (www.ximian.com)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 /* Should this be a subclass of multipart?
24 No, because we dont have different parts?
25 I'm not really sure yet ... ? */
27 #ifndef CAMEL_MULTIPART_SIGNED_H
28 #define CAMEL_MULTIPART_SIGNED_H 1
33 #endif /* __cplusplus }*/
35 #include <camel/camel-multipart.h>
36 #include <camel/camel-cipher-context.h>
38 #define CAMEL_MULTIPART_SIGNED_TYPE (camel_multipart_signed_get_type ())
39 #define CAMEL_MULTIPART_SIGNED(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSigned))
40 #define CAMEL_MULTIPART_SIGNED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSignedClass))
41 #define CAMEL_IS_MULTIPART_SIGNED(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_SIGNED_TYPE))
45 CAMEL_MULTIPART_EMPTY,
46 CAMEL_MULTIPART_CONST,
52 /* 'handy' enums for getting the internal parts of the multipart */
54 CAMEL_MULTIPART_SIGNED_CONTENT,
55 CAMEL_MULTIPART_SIGNED_SIGNATURE,
58 typedef struct _CamelMultipartSigned CamelMultipartSigned;
60 struct _CamelMultipartSigned
62 CamelMultipart parent_object;
64 /* these are the client visible parts, decoded forms of our data wrapper content */
65 CamelMimePart *content;
66 CamelMimePart *signature;
68 /* the raw content which must go over the wire, if we have generated it */
69 /* perhaps this should jsut set data_wrapper->stream and update start1/end1 accordingly, as it is done
70 for other parts, or visa versa? */
71 CamelStream *contentraw;
75 /* just cache some info we use */
79 /* offset pointers of start of boundary in content object */
85 CamelMultipartClass parent_class;
86 } CamelMultipartSignedClass;
88 /* Standard Camel function */
89 CamelType camel_multipart_signed_get_type (void);
92 CamelMultipartSigned *camel_multipart_signed_new (void);
94 CamelStream *camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelException *ex);
96 int camel_multipart_signed_sign (CamelMultipartSigned *mps, CamelCipherContext *context,
97 CamelMimePart *content, const char *uiserid,
98 CamelCipherHash hash, CamelException *ex);
99 CamelCipherValidity *camel_multipart_signed_verify (CamelMultipartSigned *mps, CamelCipherContext *context,
104 #endif /* __cplusplus */
106 #endif /* CAMEL_MULTIPART_SIGNED_H */