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.
23 /******************************************************************************
24 * File : email-core-cert.h
25 * Desc : Certificate operation Header
30 * 2011.04.14 : created
31 *****************************************************************************/
33 #ifndef EM_CORE_CERT_H_
34 #define EM_CORE_CERT_H_
36 #include <openssl/x509.h>
37 #include <openssl/evp.h>
39 #include "email-utilities.h"
40 #include "email-types.h"
42 INTERNAL_FUNC int emcore_add_public_certificate(char *public_cert_path, char *save_name, int *err_code);
44 INTERNAL_FUNC int emcore_delete_public_certificate(char *email_address, int *err_code);
46 INTERNAL_FUNC int emcore_verify_signature(char *p7s_file_path, char *mime_entity, int *validity, int *err_code);
48 INTERNAL_FUNC int emcore_verify_certificate(char *certificate, int *validity, int *err_code);
50 INTERNAL_FUNC int emcore_free_certificate(email_certificate_t **certificate, int count, int *err_code);
52 INTERNAL_FUNC int emcore_load_PFX_file(char *certificate, char *password, EVP_PKEY **pri_key, X509 **cert, STACK_OF(X509) **ca, int *err_code);
54 INTERNAL_FUNC int emcore_load_PFX_file(char *certificate, EVP_PKEY **pri_key, X509 **cert, STACK_OF(X509) **ca, int *err_code);