2 * Copyright (c) 2011 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 Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 * @brief This is C api for ValidationCore.
22 #ifndef _CERTSVC_OCSP_C_API_H_
23 #define _CERTSVC_OCSP_C_API_H_
27 #include <cert-svc/ccert.h>
33 #define CERTSVC_OCSP_GOOD (1<<0)
34 #define CERTSVC_OCSP_REVOKED (1<<1)
35 #define CERTSVC_OCSP_UNKNOWN (1<<2)
36 #define CERTSVC_OCSP_VERIFICATION_ERROR (1<<3)
37 #define CERTSVC_OCSP_NO_SUPPORT (1<<4)
38 #define CERTSVC_OCSP_CONNECTION_FAILED (1<<5)
39 #define CERTSVC_OCSP_ERROR (1<<6)
41 * Implementation of ocsp call.
43 * Please note: to verify certificate you need certificate and his parrent.
44 * This function will always verify chain_size-1 certificates from the chain.
46 * @param[in] chain Certificate to check.
47 * @param[in] chain_size Size of certificate_array
48 * @param[in] trusted Store with trusted certificates (additional certificates
49 * that may by reqired during verification process).
50 * @param[in] trusted_size Size of trusted certificate store.
51 * @param[in] url Force OCSP to use specific server. Pass NULL to use OCSP server defined in certificate.
52 * @param[out] status Bit field with description of chain validation.
53 * @return CERTSVC_SUCCESS, CERTSVC_FAIL, CERTSVC_WRONG_ARGUMENT
55 int certsvc_ocsp_check(CertSvcCertificate *chain,
57 CertSvcCertificate *trusted,