Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FSecIKeyParameters.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                FSecIKeyParameters.h
19  * @brief               This is the header file for the %IKeyParameters interface.
20  *
21  * This header file contains the declarations of the %IKeyParameters interface.
22  */
23 #ifndef _FSEC_CRYPTO_IKEY_PARAMETERS_H_
24 #define _FSEC_CRYPTO_IKEY_PARAMETERS_H_
25
26 #include <FBaseByteBuffer.h>
27 #include <FSecCryptoTypes.h>
28
29 namespace Tizen { namespace Security
30 {
31
32 /**
33  * @interface   IKeyParameters
34  * @brief               This interface provides the abstract methods for retrieving the parameters of the key exchange algorithms.
35  *
36  * @since               2.0
37  *
38  * The %IKeyParameters interface provides the abstract methods for retrieving the parameters of the key exchange algorithms. @n
39  *
40  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/security/key_exchange_algorithm.htm">Key exchanging</a>.
41  *
42  * @see                 Tizen::Security::KeyPair
43  */
44 class _OSP_EXPORT_ IKeyParameters
45 {
46
47 public:
48         /**
49          * This polymorphic destructor should be overridden if required. @n 
50          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
51          *
52          * @since               2.0
53          */
54         virtual ~IKeyParameters(void) {}
55
56         /**
57          * Gets the value of the parameter for the specified key parameter type.
58          *
59          * @since               2.0
60          *
61          * @return              A pointer to the Tizen::Base::ByteBuffer class that contains the parameter values, @n
62          *                              else @c null if an error occurs
63          * @param[in]   paramType                               The type of the parameter @n
64          *                                                                              For example, @c KEY_PARAMETER_DH_G.
65          * @exception   E_SUCCESS                               The method is successful.
66          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
67          * @exception   E_UNSUPPORTED_TYPE              The specified @c paramType is not supported.
68          * @remarks             The specific error code can be accessed using the GetLastResult() method.
69          */
70         virtual Tizen::Base::ByteBuffer* GetParameterValueN(KeyParameterType paramType) const = 0;
71
72         /**
73          * Gets the size of the key parameter in bits for the specified key parameter type.
74          *
75          * @since               2.0
76          *
77          * @return              The size of the parameter, @n
78          *                              else @c 0 if an error occurs
79          * @param[in]   keyParameterType                The type of the parameter @n
80          *                                                                              For example, @c PRIVATE_KEY_SIZE.
81          * @exception   E_SUCCESS                               The method is successful.
82          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
83          * @exception   E_UNSUPPORTED_TYPE              The specified @c paramType is not supported.
84          * @remarks             The specific error code can be accessed using the GetLastResult() method.
85          */
86         virtual int GetParameterSize(KeyParameterType keyParameterType) const = 0;
87
88 protected:
89         //
90         // This method is for internal use only. Using this method can cause behavioral, security-related,
91         // and consistency-related issues in the application.
92         //
93         // This method is reserved and may change its name at any time without prior notice.
94         //
95         // @since 2.0
96         //
97         virtual void IKeyParameters_Reserved1(void) {}
98
99         //
100         // This method is for internal use only. Using this method can cause behavioral, security-related,
101         // and consistency-related issues in the application.
102         //
103         // This method is reserved and may change its name at any time without prior notice.
104         //
105         // @since 2.0
106         //
107         virtual void IKeyParameters_Reserved2(void) {}
108
109 }; //IKeyParameters
110
111 } } //Tizen::Security
112
113 #endif //_FSEC_CRYPTO_IKEY_PAIR_PARAMETERS_H_