2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSecCert_CertList.h
20 * @brief This header file contains the declarations of Certificate List.
22 * This header file contains the declarations of Certificate List.
25 #ifndef _FSEC_CERT_INTERNAL_CERT_LIST_H_
26 #define _FSEC_CERT_INTERNAL_CERT_LIST_H_
28 #include "unique_ptr.h"
29 #include "FBaseColArrayList.h"
30 #include "FSecCert_CertSignature.h"
31 #include "FSecCert_CertTime.h"
32 #include "FSecCert_CertExtension.h"
33 #include "FSecCert_Asn1Parser.h"
35 namespace Tizen { namespace Security { namespace Cert
38 class _X509RevokedCert
39 : public Tizen::Base::Object
42 _X509RevokedCert(void);
44 virtual ~_X509RevokedCert(void);
46 void SetSerialNumber(byte* pSerial, int len);
48 byte* GetSerialNumber(void);
50 void SetTime(byte* pRevocationDate);
54 void AddExt(byte* pOid, bool critical, byte* pValue, int len);
56 _CertExtensionInfo* GetExt(byte* pOid);
58 _CertExtensionInfo* GetExt(_CertExt type);
60 short GetExtNum(void);
62 _CertExtensionInfo* GetExtEntry(short getId);
65 _X509RevokedCert(const _X509RevokedCert& rhs);
67 _X509RevokedCert& operator =(const _X509RevokedCert& rhs);
70 byte __serialNumber[_MAX_SERIAL_NUMBER_SIZE];
71 int __serialNumberLen;
72 _CertTime __revokedTime;
73 std::unique_ptr< _CertExtension > __pExtension;
74 _X509RevokedCert* __pNextRevokedCert;
78 class _X509TbsCertList
81 _X509TbsCertList(void);
83 virtual ~_X509TbsCertList(void);
85 void SetVersion(byte* pVersion, int len);
89 void SetSignature(const char* pAlgo);
91 char* GetSigature(void);
93 result SetIssuerName(byte* pName);
95 byte* GetIssuerName(void);
97 result SetTimes(byte* pThisUpdate, byte* pNextUpdate);
99 byte* GetNextUpdate(void);
101 void AddCrlEntry(_X509RevokedCert* pCrlEntry);
103 int GetEntryNumber(void);
105 _X509RevokedCert* GetEntry(int getId);
107 void AddExtension(byte* pOid, bool critical, byte* pValue, int len);
110 _X509TbsCertList(const _X509TbsCertList& rhs);
112 _X509TbsCertList& operator =(const _X509TbsCertList& rhs);
116 std::unique_ptr< char[] > __pSignatureAlgoId;
117 std::unique_ptr< byte[] > __pIssuer;
118 Tizen::Base::Collection::ArrayList __revokedCerts;
119 _CertExtension __extension;
120 _CertTime __thisUpdate;
121 _CertTime __nextUpdate;
123 }; //_X509TBSCertList
131 virtual ~_CertList(void);
133 result ParseObject(void);
135 _X509TbsCertList* GetTbsCertListInstance(void);
137 _CertSignature* GetSignInstance(void);
139 result GetCrlBuffer(byte*& pBuf, int& bufSize);
142 _CertList(const _CertList& rhs);
144 _CertList& operator =(const _CertList& rhs);
146 result ParseVersion();
148 result ParseAlgorithmIdentifier();
150 result ParseIssuerName();
152 result ParseUpdateTimes();
154 result ParseRevokedCerts();
156 result ParseExtensions();
158 result ParseSignature();
162 _X509TbsCertList __tbsCertList;
163 _CertSignature __signatureInfo;
167 } } } //Tizen::Security::Cert
169 #endif // _FSEC_CERT_INTERNAL_CERT_LIST_H_