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