Removed the certificate api
[platform/core/messaging/email-service.git] / email-api / include / email-api-smime.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5 *
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
7
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
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22 #ifndef __EMAIL_API_SMIME_H__
23 #define __EMAIL_API_SMIME_H__
24
25 #include "email-types.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 /**
32  * @file email-api-smime.h
33  */
34
35 /**
36  * @ingroup EMAIL_SERVICE_FRAMEWORK
37  * @defgroup EMAIL_SERVICE_SMIME_MODULE SMIME API
38  * @brief SMIME API is a set of operations to handle SMIME data for secured email.
39  *
40  * @section EMAIL_SERVICE_SMIME_MODULE_HEADER Required Header
41  *   \#include <email-api-smime.h>
42  *
43  * @section EMAIL_SERVICE_SMIME_MODULE_OVERVIEW Overview
44  * SMIME API is a set of operations to handle SMIME data for secured email.
45  */
46
47 /**
48  * @addtogroup EMAIL_SERVICE_SMIME_MODULE
49  * @{
50  */
51
52
53 /**
54  * @brief Gets a decrypted message.
55  *
56  * @since_tizen 2.3
57  * @privlevel public
58  * @privilege %http://tizen.org/privilege/email
59  *
60  * @param[in]  mail_id                  The mail ID
61  * @param[out] output_mail_data         The mail data
62  * @param[out] output_attachment_data   The mail attachment data
63  * @param[out] output_attachment_count  The count of attachment
64  * @param[out] verify  The verification state \n
65  *                     [false : failed verification, true : verification successful]
66  *
67  * @return  #EMAIL_ERROR_NONE on success,
68  *          otherwise an error code (see #EMAIL_ERROR_XXX) on failure
69  */
70 EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output_mail_data, 
71                                                                                 email_attachment_data_t **output_attachment_data, 
72                                                                                 int *output_attachment_count, int *verify);
73
74 /**
75  * @brief Gets a decrypted message.
76  * @since_tizen 2.3
77  * @privlevel public
78  * @privilege %http://tizen.org/privilege/email
79  * @param[in] input_mail_data           Specifies the signed mail data
80  * @param[in] input_attachment_data     Specifies the attachment of signed mail
81  * @param[in] input_attachment_count    Specifies the attachment count of signed mail
82  * @param[out] output_mail_data         Specifies the mail_data
83  * @param[out] output_attachment_data   Specifies the mail_attachment_data
84  * @param[out] output_attachment_count  Specifies the count of attachment
85  * @param[out] verify  The verification state \n
86  *                     [false : failed verification, true : verification successful]
87
88  * @return EMAIL_ERROR_NONE on success or an error code (refer to EMAIL_ERROR_XXX) on failure
89  */
90 EXPORT_API int email_get_decrypt_message_ex(email_mail_data_t *input_mail_data, 
91                                                                                         email_attachment_data_t *input_attachment_data, 
92                                                                                         int input_attachment_count,
93                                             email_mail_data_t **output_mail_data, 
94                                                                                         email_attachment_data_t **output_attachment_data, 
95                                                                                         int *output_attachment_count,
96                                                                                         int *verify);
97 /**
98  * @brief Verifies a signed mail.
99  *
100  * @since_tizen 2.3
101  * @privlevel public
102  * @privilege %http://tizen.org/privilege/email
103  *
104  * @param[in] mail_id  The mail ID
105  * @param[out] verify  The verification state \n
106  *                     [false : failed verification, true : verification successful]
107  *
108  * @return  #EMAIL_ERROR_NONE on success,
109  *          otherwise an error code (see #EMAIL_ERROR_XXX) on failure
110  */
111 EXPORT_API int email_verify_signature(int mail_id, int *verify);
112
113 /**
114 * @brief Verifies a signed mail.
115 * @since_tizen 2.3
116 *
117 * @param[in]  input_mail_data         The signed mail data
118 * @param[in]  input_attachment_data   The attachment of signed mail
119 * @param[in]  input_attachment_count  The attachment count of signed mail
120 * @param[out] verify                  The verification status \n
121 *                                     false : failed verification, true : verification successful
122 *
123 * @return  #EMAIL_ERROR_NONE on success,
124 *          otherwise an error code (see #EMAIL_ERROR_XXX) on failure
125 */
126 EXPORT_API int email_verify_signature_ex(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data, int input_attachment_count, int *verify);
127
128 /**
129  * @brief Gets the certificate from the server (using exchange server).
130  *
131  * @since_tizen 2.3
132  * @privlevel public
133  * @privilege %http://tizen.org/privilege/email
134  *
135  * @param[in]  account_id     The account ID
136  * @param[in]  email_address  The email address that gets a certificate
137  * @param[out] handle         The handle for stopping
138  *
139  * @return  #EMAIL_ERROR_NONE on success,
140  *          otherwise an error code (see #EMAIL_ERROR_XXX) on failure
141  */
142 EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle);
143
144 /**
145  * @brief Verifies the certificate to the server (using exchange server).
146  *
147  * @since_tizen 2.3
148  * @privlevel public
149  * @privilege %http://tizen.org/privilege/email
150  *
151  * @param[in]  account_id     The account ID
152  * @param[in]  email_address  The email address that validates a certificate
153  * @param[out] handle         The handle for stopping
154  *
155  * @return  #EMAIL_ERROR_NONE on success,
156  *          otherwise an error code (see #EMAIL_ERROR_XXX) on failure
157  */
158 EXPORT_API int email_validate_certificate(int account_id, char *email_address, unsigned *handle);
159
160 /**
161  * @brief Frees the memory of the certificate.
162  *
163  * @since_tizen 2.3
164  * @privlevel N/P
165  *
166  * @param[in] certificate  The certificate
167  * @param[in] count        The count of certificates
168  *
169  * @return  #EMAIL_ERROR_NONE on success,
170  *          otherwise error code (see #EMAIL_ERROR_XXX) on failure
171  */
172 EXPORT_API int email_free_certificate(email_certificate_t **certificate, int count);
173
174 /**
175  * @}
176  */
177
178 #ifdef __cplusplus
179 }
180 #endif /* __cplusplus */
181
182 #endif /* __EMAIL_API_SMIME_H__ */