Add certificate verification
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / pkix / sn_store.h
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19
20  ******************************************************************/
21 #ifndef _SN_STORE_H_
22 #define _SN_STORE_H_
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif //__cplusplus
27
28 #include "pki_errors.h"
29 #include "byte_array.h"
30
31
32 /**
33  * Stores serial number to SN storage.
34  *
35  * @param[in] serNum certificate serial number to be stored
36  * @return PKI_SUCCESS if success, error code otherwise
37  */
38 PKIError StoreSerialNumber(const ByteArray serNum);
39
40 /**
41  * Check whether there is \a serNum in SN storage.
42  *
43  * @param[in] serNum certificate serial number to be stored
44  * @return PKI_SUCCESS if \a not belongs SN storage, error code otherwise
45  */
46 PKIError CheckSerialNumber(const ByteArray serNum);
47
48
49 #ifdef X509_DEBUG
50 /**
51  * Prints all serial numbers from SN storage.
52  */
53 void PrintSNStore(void);
54 #endif
55
56
57 /**
58  * Frees memory occupied by SN storage.
59  */
60 void FreeSNStore(void);
61
62
63 #ifdef __cplusplus
64 }
65 #endif //__cplusplus
66 #endif //_SN_STORE_H_
67