Fixed Klocworks issues
[platform/framework/native/appfw.git] / src / security / cert / FSecCert_CertSignature.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_CertSignature.h
19  * @brief       This header file contains the declarations of certificate signature verification.
20  *
21  * This header file contains the declarations of certificate signature verification.
22  */
23
24 #ifndef _FSEC_CERT_INTERNAL_CERT_SIGNATURE_H_
25 #define _FSEC_CERT_INTERNAL_CERT_SIGNATURE_H_
26
27 #include <unique_ptr.h>
28 #include "FSecCert_CertTypes.h"
29
30 namespace Tizen { namespace Security { namespace Cert
31 {
32
33 class _CertSignature
34 {
35 public:
36         _CertSignature(void);
37
38         _CertSignature(const char* pSigAlgId, int len, byte* pValue);
39
40         virtual ~_CertSignature(void);
41
42         void SetSignature(const char* pSigAlgId, int len, byte* pValue);
43
44         result Verify(byte* data, int dataLen, byte* pModulus, int keyLen, byte* pExponent, int expLen);
45
46         byte* GetSignatureInfo(int& sigLen);
47
48         char* GetSignatureAlgo(void);
49
50 private:
51         _CertSignature(const _CertSignature& rhs);
52
53         _CertSignature& operator =(const _CertSignature& rhs);
54
55 private:
56         int __signLen;
57         std::unique_ptr< byte[] > __pSignValue;
58         std::unique_ptr< char[] > __pSignatureAlgId;
59
60 }; //_CertSignature
61
62 } } } //Tizen::Security::Cert
63
64 #endif // _FSEC_CERT_INTERNAL_CERT_SIGNATURE_H_