Merge "Alarm refactoring : remove IPC between appfw and app-service" into tizen_2.1
[platform/framework/native/appfw.git] / inc / FSecPkcsRc2CbcParameters.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FSecPkcsRc2CbcParameters.h
20  * @brief               This is the header file for the %PkcsRc2CbcParametersr class.
21  *
22  * This header file contains the declarations of the %PkcsRc2CbcParameters class.
23  */
24
25 #ifndef _FSEC_PKCS_RC2_CBC_PARAMETERS_H_
26 #define _FSEC_PKCS_RC2_CBC_PARAMETERS_H_
27
28 #include <FBaseByteBuffer.h>
29 #include <FSecPkcsIAlgorithmParameters.h>
30 #include <FSecPkcsTypes.h>
31
32 namespace Tizen { namespace Security { namespace Pkcs
33 {
34
35 /**
36  * @class               Rc2CbcParameters
37  * @brief               This class implements the functionalities specified by the Rc2 Cbc mode parameter.
38  * @brief               This class implements the functionalities specified by the Rc2 Cbc mode parameter.
39  *                                      This class represents the Rc2 cbc mode parameter for symmetric ciphers RC2.
40  *                                      ASN.1 format for RC2-CBC-Parameter ::= SEQUENCE {
41  *                                      rc2ParameterVersion INTEGER OPTIONAL,
42  *                                      iv OCTET STRING (SIZE(8)) }
43  *
44  * @since               2.1
45  *
46  */
47
48 class _OSP_EXPORT_ Rc2CbcParameters
49         : public virtual IAlgorithmParameters
50         , public Tizen::Base::Object
51 {
52
53 public:
54         /**
55          * The object is not fully constructed after this constructor is called. @n
56          * For full construction, the Construct() method must be called right after calling this constructor.
57          *
58          * @since               2.1
59          */
60         Rc2CbcParameters(void);
61
62         /**
63          * This destructor overrides Tizen::Base::Object::~Object().
64          *
65          * @since               2.1
66          */
67         virtual ~Rc2CbcParameters(void);
68
69         /**
70          * Initializes this instance of %Rc2CbcParameters with supplied input parameters values.
71          *
72          * @since               2.1
73          *
74          * @return              An error code
75          * @param[in]   initialVector                   An instance of ByteBuffer containing the initial vector.
76          * @param[in]   version                                         An integer value defines the rc2 cbc parameter version.
77          *                                                                                                                      As per Pkcs 5 standard, possible value can be 160,120,58 or any value
78          *                                                                                                                      greater than or equal to 256.
79          * @exception   E_SUCCESS                                       The method is successful.
80          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
81          */
82         result Construct(const Tizen::Base::ByteBuffer& initialVector, int version = 0);
83
84         /**
85          * Get the copy of this instance.
86          *
87          * @since               2.1
88          *
89          * @return              A pointer to IAlgorithmParameters, containing the copy of this instance.
90          * @remarks             The specific error code can be accessed using the GetLastResult() method.
91          */
92         virtual IAlgorithmParameters* CloneN(void) const;
93
94         /**
95          * Get the algorithm parameter type enum value for Rc2CbcParameters.
96          *
97          * @since               2.1
98          *
99          * @return              PkcsAlgorithmParameterType      Enum value  containing the PKCS_ALGO_PARAM_TYPE_RC2 value for Rc2CbcParameters parameter.
100          *
101          */
102         virtual PkcsAlgorithmParameterType GetType(void) const;
103
104         /**
105          * Checks whether the specified instance of %Rc2CbcParameters equals the current instance.
106          *
107          * @since               2.1
108          *
109          * @return              @c true if the specified instance equals the current instance, @n
110          *              else @c false
111          * @param[in]   rhs                                             An instance of %Rc2CbcParameters
112          * @exception   E_SUCCESS                               The method is successful.
113          * @exception   E_INVALID_ARG                           The specified input parameter is invalid.
114          * @remarks             The specific error code can be accessed using the GetLastResult() method.
115         */
116         virtual bool Equals(const Tizen::Base::Object& rhs) const;
117
118         /**
119          * Gets the hash value of the current instance of %Rc2CbcParameters.
120          *
121          * @since               2.1
122          *
123          * @return              An integer value indicating the hash value of the current instance of %Rc2CbcParameters
124          */
125         virtual int GetHashCode(void) const;
126
127         /**
128          * Get the rc2 cbc parameter version value.
129          *
130          * @since               2.1
131          *
132          * @return              An integer value that contains the rc2 cbc parameter version.
133          *
134          */
135         int GetVersion(void) const;
136
137         /**
138          * Get the instance of byte buffer that contains the Initial Vector value.
139          *
140          * @since               2.1
141          *
142          * @return              A reference to ByteBuffer , containing the initial vector data.
143          *
144          */
145         const Tizen::Base::ByteBuffer& GetInitialVector(void) const;
146
147         /**
148          * Gets the encoded form of the Rc2CbcParameter. @n
149          * It is assumed that each Rc2CbcParameter type will have only a single form of encoding that is DER encoding.
150          *
151          * @since               2.1
152          *
153          * @return              Pointer to the DER encoded ByteBuffer, @n
154          *                                              else @c null if an error occurs.
155          * @exception   E_SUCCESS                                               The method is successful.
156          * @exception   E_SYSTEM                                                The method cannot proceed due to a severe system error.
157          * @remarks             The specific error code can be accessed using the GetLastResult() method.
158          */
159         Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
160
161 private:
162         // This copy constructor is intentionally declared as private to prohibit @n
163         // copying of objects by users.
164         //
165         // @since               2.1
166         Rc2CbcParameters(const Rc2CbcParameters& rhs);
167
168         // The implementation of this copy assignment operator is intentionally blank and @n
169         // declared as private to prohibit copying of objects.Use GetCloneN() to get an exact copy of the instance.
170         //
171         // @since               2.1
172         Rc2CbcParameters& operator =(const Rc2CbcParameters& rhs);
173
174 private:
175         class _Rc2CbcParametersImpl* __pRc2CbcParametersImpl;
176         friend class _Rc2CbcParametersImpl;
177
178 }; // Rc2CbcParameters
179
180 } } } // Tizen::Security::Pkcs
181
182 #endif // _FSEC_PKCS_RC2_CBC_PARAMETERS_H_