2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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 * @file FSecCert_CertList.h
19 * @brief This header file contains the declarations of Certificate List.
21 * This header file contains the declarations of Certificate List.
24 #ifndef _FSEC_CERT_INTERNAL_CERT_LIST_H_
25 #define _FSEC_CERT_INTERNAL_CERT_LIST_H_
27 #include "unique_ptr.h"
28 #include "FBaseColArrayList.h"
29 #include "FSecCert_CertSignature.h"
30 #include "FSecCert_CertTime.h"
31 #include "FSecCert_CertExtension.h"
32 #include "FSecCert_Asn1Parser.h"
34 namespace Tizen { namespace Security { namespace Cert
37 class _X509RevokedCert
38 : public Tizen::Base::Object
41 _X509RevokedCert(void);
43 virtual ~_X509RevokedCert(void);
45 void SetSerialNumber(byte* pSerial, int len);
47 byte* GetSerialNumber(void);
49 void SetTime(byte* pRevocationDate);
53 void AddExt(byte* pOid, bool critical, byte* pValue, int len);
55 _CertExtensionInfo* GetExt(byte* pOid);
57 _CertExtensionInfo* GetExt(_CertExt type);
59 short GetExtNum(void);
61 _CertExtensionInfo* GetExtEntry(short getId);
64 _X509RevokedCert(const _X509RevokedCert& rhs);
66 _X509RevokedCert& operator =(const _X509RevokedCert& rhs);
69 byte __serialNumber[_MAX_SERIAL_NUMBER_SIZE];
70 int __serialNumberLen;
71 _CertTime __revokedTime;
72 std::unique_ptr< _CertExtension > __pExtension;
73 _X509RevokedCert* __pNextRevokedCert;
77 class _X509TbsCertList
80 _X509TbsCertList(void);
82 virtual ~_X509TbsCertList(void);
84 void SetVersion(byte* pVersion, int len);
88 void SetSignature(const char* pAlgo);
90 char* GetSigature(void);
92 result SetIssuerName(byte* pName);
94 byte* GetIssuerName(void);
96 result SetTimes(byte* pThisUpdate, byte* pNextUpdate);
98 byte* GetNextUpdate(void);
100 void AddCrlEntry(_X509RevokedCert* pCrlEntry);
102 int GetEntryNumber(void);
104 _X509RevokedCert* GetEntry(int getId);
106 void AddExtension(byte* pOid, bool critical, byte* pValue, int len);
109 _X509TbsCertList(const _X509TbsCertList& rhs);
111 _X509TbsCertList& operator =(const _X509TbsCertList& rhs);
115 std::unique_ptr< char[] > __pSignatureAlgoId;
116 std::unique_ptr< byte[] > __pIssuer;
117 Tizen::Base::Collection::ArrayList __revokedCerts;
118 _CertExtension __extension;
119 _CertTime __thisUpdate;
120 _CertTime __nextUpdate;
122 }; //_X509TBSCertList
130 virtual ~_CertList(void);
132 result ParseObject(void);
134 _X509TbsCertList* GetTbsCertListInstance(void);
136 _CertSignature* GetSignInstance(void);
138 result GetCrlBuffer(byte*& pBuf, int& bufSize);
141 _CertList(const _CertList& rhs);
143 _CertList& operator =(const _CertList& rhs);
145 result ParseVersion();
147 result ParseAlgorithmIdentifier();
149 result ParseIssuerName();
151 result ParseUpdateTimes();
153 result ParseRevokedCerts();
155 result ParseExtensions();
157 result ParseSignature();
161 _X509TbsCertList __tbsCertList;
162 _CertSignature __signatureInfo;
166 } } } //Tizen::Security::Cert
168 #endif // _FSEC_CERT_INTERNAL_CERT_LIST_H_