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_CertPrivateKeyInfo.h
20 * @brief This header file contains the declarations of Certificate Private Key operations.
22 * This header file contains the declarations of Certificate Private Key operations.
25 #ifndef _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_
26 #define _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_
28 #include "unique_ptr.h"
29 #include "FSecCert_CertTypes.h"
31 namespace Tizen { namespace Security { namespace Cert
35 class _CertPrivateKeyInfo
38 _CertPrivateKeyInfo(void);
40 _CertPrivateKeyInfo(char* pFileName);
42 _CertPrivateKeyInfo(byte* pBuf, int bufSize);
44 virtual ~_CertPrivateKeyInfo(void);
46 void GetPrivateKeyN(int& keyLen, byte** ppPrivKey);
48 result GetEncDecPrivateKeyN(int& keyLen, byte** ppPrivKey, int encDecBit);
50 result GetPkcs8EncDecKeyN(int& keyLen, byte** ppPrivKey, int encDecBit);
52 result SetPrivateKey(int keyLen, byte* pPrivKey);
54 result SetPrivateKey(char* pFileName);
57 _CertPrivateKeyInfo(const _CertPrivateKeyInfo& rhs);
59 _CertPrivateKeyInfo& operator =(const _CertPrivateKeyInfo& rhs);
63 std::unique_ptr< byte[] > __pPrivateKey;
65 }; //_CertPrivateKeyInfo
67 } } } //Tizen::Security::Cert
69 #endif // _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_