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_CertChain.h
19 * @brief This header file contains the declarations of Certificate Chain and its operations.
21 * This header file contains the declarations of Certificate Chain and its operations.
24 #ifndef _FSEC_CERT_INTERNAL_CERT_CHAIN_H_
25 #define _FSEC_CERT_INTERNAL_CERT_CHAIN_H_
27 #include "unique_ptr.h"
29 #include <FBaseColArrayList.h>
31 #include "FSecCert_Certificate.h"
32 #include "FSecCert_CertPrivateKeyInfo.h"
34 namespace Tizen { namespace Security { namespace Cert
42 virtual ~_CertChain(void);
46 result AddCertificate(_CertFormat certFormat, char* pFileName);
48 result AddCertificate(_CertFormat certFormat, byte* pBuf, int bufSize);
50 result AddCertificate(_X509Certificate* pCert);
52 result AddPrivateKey(char* pPKeyPath);
54 result AddPrivateKey(byte* pBuf, int bufSize);
56 result MoveNext(void);
58 result MovePrev(void);
60 result MoveHead(void);
62 result MoveTail(void);
64 void RemoveHead(bool freeFlag);
66 void RemoveTail(bool freeFlag);
68 void SetContextType(_CertContextType type);
72 result VerifyUsingOpenSsl(void);
74 result VerifyCertChainWithDb(void);
76 _CertPrivateKeyInfo* GetPrivateKey(void);
78 _X509Certificate* GetCurrentCertificate(void);
80 _CertFormat GetCertFormat(void);
82 _CertDomainType GetCertTypeByDomain(void);
84 _CertContextType GetContextType(void);
89 _CertChain(const _CertChain& rhs);
91 _CertChain& operator =(const _CertChain& rhs);
93 static void DelFunc4CmCertificate(void* pValue);
95 int CheckBitInBitString(_CertExtensionInfo* pExtension, int bitNo);
99 std::unique_ptr< _CertPrivateKeyInfo > __pPrivateKey;
100 _CertFormat __certFormat;
101 _CaCertType __rootCertType;
102 _CertContextType __contextType;
103 bool __checkValidity;
104 Tizen::Base::Collection::ArrayList __certChain;
108 } } } //Tizen::Security::Cert
110 #endif // _FSEC_CERT_INTERNAL_CERT_CHAIN_H_