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