4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
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 * 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.
22 #ifndef __EMAIL_API_SMIME_H__
23 #define __EMAIL_API_SMIME_H__
25 #include "email-types.h"
29 #endif /* __cplusplus */
32 * @file email-api-smime.h
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.
40 * @section EMAIL_SERVICE_SMIME_MODULE_HEADER Required Header
41 * \#include <email-api-smime.h>
43 * @section EMAIL_SERVICE_SMIME_MODULE_OVERVIEW Overview
44 * SMIME API is a set of operations to handle SMIME data for secured email.
48 * @addtogroup EMAIL_SERVICE_SMIME_MODULE
54 * @brief Gets a decrypted message.
58 * @privilege %http://tizen.org/privilege/email
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]
67 * @return #EMAIL_ERROR_NONE on success,
68 * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
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);
75 * @brief Gets a decrypted message.
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]
88 * @return EMAIL_ERROR_NONE on success or an error code (refer to EMAIL_ERROR_XXX) on failure
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,
98 * @brief Verifies a signed mail.
102 * @privilege %http://tizen.org/privilege/email
104 * @param[in] mail_id The mail ID
105 * @param[out] verify The verification state \n
106 * [false : failed verification, true : verification successful]
108 * @return #EMAIL_ERROR_NONE on success,
109 * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
111 EXPORT_API int email_verify_signature(int mail_id, int *verify);
114 * @brief Verifies a signed mail.
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
123 * @return #EMAIL_ERROR_NONE on success,
124 * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
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);
129 * @brief Gets the certificate from the server (using exchange server).
133 * @privilege %http://tizen.org/privilege/email
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
139 * @return #EMAIL_ERROR_NONE on success,
140 * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
142 EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle);
145 * @brief Verifies the certificate to the server (using exchange server).
149 * @privilege %http://tizen.org/privilege/email
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
155 * @return #EMAIL_ERROR_NONE on success,
156 * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
158 EXPORT_API int email_validate_certificate(int account_id, char *email_address, unsigned *handle);
161 * @brief Frees the memory of the certificate.
166 * @param[in] certificate The certificate
167 * @param[in] count The count of certificates
169 * @return #EMAIL_ERROR_NONE on success,
170 * otherwise error code (see #EMAIL_ERROR_XXX) on failure
172 EXPORT_API int email_free_certificate(email_certificate_t **certificate, int count);
180 #endif /* __cplusplus */
182 #endif /* __EMAIL_API_SMIME_H__ */