2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Jacek Migacz (j.migacz@samsung.com)
20 * @brief PKCS#12 container manipulation routines.
24 #include <cert-svc/ccert.h>
27 * To import the p12/pfx/crt/pem file to specified store (WIFI_STORE/VPN_STORE/EMAIL_STORE).
29 * @param[in] storeType Refers to WIFI_STORE / VPN_STORE / EMAIL_STORE / ALL_STORE.
30 * @param[in] path Path to file.
31 * @param[in] password Password for opening the file.
32 * @param[in] alias Logical name for certificate bundle identification (can't be empty).
33 * @param[out] certList cert list in store returned in linked list. Free by
34 * certsvc_pkcs12_free_certificate_list_loaded_from_store()
35 * after use. Pass NULL if you don't want to return a list.
36 * @param[out] length length of output @a certList. Pass NULL if you don't
37 * want to return a list.
38 * @return CERTSVC_SUCCESS, CERTSVC_FAIL, CERTSVC_DUPLICATED_ALIAS, CERTSVC_IO_ERROR, CERTSVC_WRONG_ARGUMENT, CERTSVC_BAD_ALLOC.
40 int pkcs12_import_from_file_to_store(CertStoreType storeType, const char *path,
41 const char *password, const char *alias, CertSvcStoreCertList **certList,
45 * TO check if the p12/pfx file is protected by password or not.
47 * @param[in] filePath Where the file is located.
48 * @param[out] passworded A boolean value to state if the file is protected by password or not.
49 * @return CERTSVC_SUCCESS, CERTSVC_FAIL, CERTSVC_IO_ERROR, CERTSVC_WRONG_ARGUMENT.
51 int pkcs12_has_password(const char *filepath, int *passworded);