Fixed Klocworks issues
[platform/framework/native/appfw.git] / src / security / cert / FSecCert_CertTime.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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 /**
18  * @file        FSecCert_CertTime.h
19  * @brief       This header file contains the declarations of certificate time.
20  *
21  * This header file contains the declarations of certificate time.
22  */
23
24 #ifndef _FSEC_CERT_INTERNAL_CERT_TIME_H_
25 #define _FSEC_CERT_INTERNAL_CERT_TIME_H_
26
27 #include <FBaseDateTime.h>
28 #include "FSecCert_CertTypes.h"
29
30 namespace Tizen { namespace Security { namespace Cert
31 {
32
33 class _CertTime
34 {
35 public:
36         enum _CertTimeType
37         {
38                 CERT_TIME_UTC = 0,
39                 CERT_TIME_GENERAL = 1
40         }; //_CertTimeType
41
42         _CertTime(void);
43
44         _CertTime(_CertTimeType type, byte* pValue);
45
46         virtual ~_CertTime(void);
47
48         void SetTime(_CertTimeType type, byte* pValue);
49
50         void SetTime(byte* pValue);
51
52         byte* GetTime(void);
53
54         void ConvertToDateTime(Tizen::Base::DateTime& cmTime);
55
56         static void FormatDateTime(Tizen::Base::DateTime& time, char* pFormattedDatTime);
57
58 private:
59         _CertTime(const _CertTime& rhs);
60
61         _CertTime& operator =(const _CertTime& rhs);
62
63 private:
64         byte __value[_MAX_CERT_TIME_LEN + 1];  // stored GeneralizedTime format - YYYYMMDDHHMMSSZ
65
66 }; //_CertTime
67
68 } } } //Tizen::Security::Cert
69
70 #endif  // _FSEC_CERT_INTERNAL_CERT_TIME_H_