Change the level of datacontrol.consumer privilege from partner to public
[platform/framework/native/appfw.git] / src / security / cert / FSecCert_CertPrivateKeyInfo.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FSecCert_CertPrivateKeyInfo.h
19  * @brief       This header file contains the declarations of Certificate Private Key operations.
20  *
21  * This header file contains the declarations of Certificate Private Key operations.
22  */
23
24 #ifndef _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_
25 #define _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_
26
27 #include "unique_ptr.h"
28 #include "FSecCert_CertTypes.h"
29
30 namespace Tizen { namespace Security { namespace Cert
31 {
32
33
34 class _CertPrivateKeyInfo
35 {
36 public:
37         _CertPrivateKeyInfo(void);
38
39         _CertPrivateKeyInfo(char* pFileName);
40
41         _CertPrivateKeyInfo(byte* pBuf, int bufSize);
42
43         virtual ~_CertPrivateKeyInfo(void);
44
45         void GetPrivateKeyN(int& keyLen, byte** ppPrivKey);
46
47         result GetEncDecPrivateKeyN(int& keyLen, byte** ppPrivKey, int encDecBit);
48
49         result GetPkcs8EncDecKeyN(int& keyLen, byte** ppPrivKey, int encDecBit);
50
51         result SetPrivateKey(int keyLen, byte* pPrivKey);
52
53         result SetPrivateKey(char* pFileName);
54
55 private:
56         _CertPrivateKeyInfo(const _CertPrivateKeyInfo& rhs);
57
58         _CertPrivateKeyInfo& operator =(const _CertPrivateKeyInfo& rhs);
59
60 private:
61         int __privateKeyLen;
62         std::unique_ptr< byte[] > __pPrivateKey;
63
64 }; //_CertPrivateKeyInfo
65
66 } } } //Tizen::Security::Cert
67
68 #endif // _FSEC_CERT_INTERNAL_CERT_PRIVATE_KEY_INFO_H_