Fix & Refactor internal unit tests
[platform/core/security/cert-svc.git] / tests / capi / common-res.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file        common-res.h
18  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
19  * @author      Kyungwook Tak (k.tak@samsung.com)
20  * @version     1.0
21  * @brief       This file is the common resource for certsvc capi test
22  */
23 #pragma once
24
25 #include <vector>
26 #include <string>
27
28 #include <cert-svc/cinstance.h>
29
30 extern CertSvcInstance vinstance;
31
32 namespace TestData {
33
34 class SigComponents {
35 public:
36         SigComponents(std::string &cert, std::string &mes, std::string &sig)
37           : certificate(cert)
38           , message(mes)
39           , signature(sig) {}
40
41         std::string certificate;
42         std::string message;
43         std::string signature;
44 };
45
46 extern const std::string SelfSignedCAPath;
47
48 extern const std::string subjectGoogleCA;
49 /*
50  *  Not Before: Jan 29 00:00:00 1996 GMT
51  *  Not After : Aug  1 23:59:59 2028 GMT
52  */
53 extern const std::string googleCA;
54
55 /*
56  *  Signed by googleCA
57  *  Not Before: May 13 00:00:00 2004 GMT
58  *  Not After : May 12 23:59:59 2014 GMT
59  */
60 extern const std::string google2nd;
61
62 /*
63  *  Signed by google2nd
64  *  Not Before: Oct 26 00:00:00 2011 GMT
65  *  Not After : Sep 30 23:59:59 2013 GMT
66  */
67 extern const std::string certEE;
68
69 /*
70  *  Issuer  : /C=KO/ST=Kyeongkido/L=Suwon/O=Samsung/OU=SoftwareCenter/CN=TizenSecurity/emailAddress=k.tak@samsung.com
71  *  Subject : /C=PO/ST=SeoulState/L=Seoul/O=SamsungSecond/OU=SoftwareCenterSecond/CN=TizenSecuritySecond/emailAddress=kyungwook.tak@gmail.com
72  */
73 extern const std::string certFullField;
74
75 /*
76  *  Not Before: Oct  5 12:11:33 2011 GMT
77  *  Not After : Oct  2 12:11:33 2021 GMT
78  */
79 extern const SigComponents magda;
80
81 /*
82  *  Not Before: Oct  5 12:00:51 2011 GMT
83  *  Not After : Oct  2 12:00:51 2021 GMT
84  */
85 extern const SigComponents filipSHA1;
86 extern const SigComponents filipSHA256;
87
88 /*
89  *  Signer
90  *  Not Before: Jun 18 08:11:04 2014 GMT
91  *  Not After : Jun 18 08:11:04 2015 GMT
92  *
93  *  Second CA
94  *  Not Before: Jun 18 08:10:59 2014 GMT
95  *  Not After : Jun 18 08:10:59 2015 GMT
96  *
97  *  Root CA
98  *  Not Before: Jun 18 08:10:51 2014 GMT
99  *  Not After : Jun 18 08:10:51 2015 GMT
100  */
101 extern std::vector<std::string> certChain;
102
103 /*
104  *  Second CA
105  *  Not Before: Jun 14 08:12:50 2014 GMT
106  *  Not After : Jun 14 08:12:50 2015 GMT
107  *
108  *  Root CA
109  *  Not Before: Jun 14 08:12:35 2014 GMT
110  *  Not After : Jun 14 08:12:35 2015 GMT
111  */
112 extern std::vector<std::string> certChainSelfSigned;
113
114 }