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"
28 #include "FSecCert_Certificate.h"
29 #include "FSecCert_CertPrivateKeyInfo.h"
31 namespace Tizen { namespace Security { namespace Cert
39 virtual ~_CertChain(void);
43 result AddCertificate(_CertFormat certFormat, char* pFileName);
45 result AddCertificate(_CertFormat certFormat, byte* pBuf, int bufSize);
47 result AddCertificate(_X509Certificate* pCert);
49 result AddPrivateKey(char* pPKeyPath);
51 result AddPrivateKey(byte* pBuf, int bufSize);
53 result MoveNext(void);
55 result MovePrev(void);
57 result MoveHead(void);
59 result MoveTail(void);
61 void RemoveHead(bool freeFlag);
63 void RemoveTail(bool freeFlag);
65 void SetContextType(_CertContextType type);
69 result VerifyUsingOpenSsl(void);
71 result VerifyCertChainWithDb(void);
73 _CertPrivateKeyInfo* GetPrivateKey(void);
75 _X509Certificate* GetCurrentCertificate(void);
77 _CertFormat GetCertFormat(void);
79 _CertDomainType GetCertTypeByDomain(void);
81 _CertContextType GetContextType(void);
86 _CertChain(const _CertChain& rhs);
88 _CertChain& operator =(const _CertChain& rhs);
90 static void DelFunc4CmCertificate(void* pValue);
92 int CheckBitInBitString(_CertExtensionInfo* pExtension, int bitNo);
96 std::unique_ptr< _CertPrivateKeyInfo > __pPrivateKey;
97 _CertFormat __certFormat;
98 _CaCertType __rootCertType;
99 _CertContextType __contextType;
100 bool __checkValidity;
101 Tizen::Base::Collection::ArrayList __certChain;
105 } } } //Tizen::Security::Cert
107 #endif // _FSEC_CERT_INTERNAL_CERT_CHAIN_H_