Update reviewed Tizen::Io doxygen
[platform/framework/native/appfw.git] / inc / FSecPkcsInitialVector.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                FSecPkcsInitialVector.h
20  * @brief               This is the header file for the %InitialVector class.
21  *
22  * This header file contains the declarations of the %InitialVector class.
23  */
24
25 #ifndef _FSEC_PKCS_INITIAL_VECTOR_H_
26 #define _FSEC_PKCS_INITIAL_VECTOR_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               InitialVector
37  * @brief               This class implements the functionalities specified by the %InitialVector class.
38  *
39  * @since               2.1
40  *
41  * The %InitialVector class implements the functionalities specified by the %InitialVector class.
42  *                                      This class represents the Initial Vector parameter for symmetric ciphers such as DES, AES, DES_EDE.
43  *                                      This %InitialVector parameters will be used by both PKCS05 and PKCS08 related classes at the time of encryption.
44  *
45  *
46  */
47
48 class _OSP_EXPORT_ InitialVector
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         InitialVector(void);
61
62         /**
63         * This destructor overrides Tizen::Base::Object::~Object().
64         *
65         * @since                2.1
66         */
67
68         virtual ~InitialVector(void);
69
70         /**
71          * Initializes this instance of %InitialVector with the specified input buffer.
72          *
73          * @since               2.1
74          *
75          * @return              An error code
76          *
77          * @param[in]   initialVector           An instance of Tizen::Base::ByteBuffer, holding the initial vector data
78          * @exception   E_SUCCESS                               The method is successful.
79          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
80          */
81         result Construct(const Tizen::Base::ByteBuffer& initialVector);
82
83         /**
84          * Gets copy of this instance.
85          *
86          * @since               2.1
87          *
88          * @return              A pointer to IAlgorithmParameters, containing the copy of this instance
89          * @remarks             The specific error code can be accessed using the GetLastResult() method.
90          */
91         virtual IAlgorithmParameters* CloneN(void) const;
92
93         /**
94          * Gets the algorithm parameter type enum value for Initial Vector.
95          *
96          * @since               2.1
97          *
98          * @return              PkcsAlgorithmParameterType              Enum value containing the PKCS_ALGO_PARAM_TYPE_IV value for Initial Vector parameter
99          *
100          */
101         virtual PkcsAlgorithmParameterType GetType(void) const;
102
103         /**
104          * Checks whether the specified instance of %InitialVector equals the current instance.
105          *
106          * @since               2.1
107          *
108          * @return              @c true if the specified instance equals the current instance, @n
109          *              else @c false
110          * @param[in]   rhs                                     An instance of %InitialVector
111          * @exception   E_SUCCESS                               The method is successful.
112          * @exception   E_INVALID_ARG                           The specified input parameter is invalid.
113          * @remarks             The specific error code can be accessed using the GetLastResult() method.
114          */
115         virtual bool Equals(const Tizen::Base::Object& rhs) const;
116
117         /**
118          * Gets the hash value of the current instance of %InitialVector.
119          *
120          * @since               2.1
121          *
122          * @return              An integer value indicating the hash value of the current instance of %InitialVector
123          */
124         virtual int GetHashCode(void) const;
125
126         /**
127          * Gets the instance of Tizen::Base::ByteBuffer that contains the Initial Vector value.
128          *
129          * @since               2.1
130          *
131          * @return              A reference to the Tizen::Base::ByteBuffer class that contains the output
132          */
133         const Tizen::Base::ByteBuffer& GetInitialVector(void) const;
134
135         /**
136          * Gets the encoded form of the InitialVector. @n
137          * It is assumed that each InitialVector type will have only a single form of encoding that is DER encoding.
138          *
139          * @since               2.1
140          *
141          * @return              Pointer to the DER encoded Tizen::Base::ByteBuffer, @n
142          *                                                      else @c null if an error occurs
143          * @exception   E_SUCCESS                                               The method is successful.
144          * @exception   E_SYSTEM                                                The method cannot proceed due to a severe system error.
145          * @remarks             The specific error code can be accessed using the GetLastResult() method.
146          */
147         Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
148
149 private:
150         // This copy constructor is intentionally declared as private to prohibit @n
151         // copying of objects by users.
152         //
153         // @since               2.1
154         InitialVector(const InitialVector& rhs);
155
156         // The implementation of this copy assignment operator is intentionally blank and @n
157         // declared as private to prohibit copying of objects.Use CloneN() to get an exact copy of the instance. @n
158         // Use Equals() to compare the contents of one instance with the other.
159         //
160         // @since               2.1
161         InitialVector& operator =(const InitialVector& rhs);
162
163 private:
164         class _InitialVectorImpl* __pInitialVectorImpl;
165         friend class _InitialVectorImpl;
166
167 }; // InitialVector
168
169 } } } //Tizen::Security::Pkcs
170
171 #endif //_FSEC_PKCS_INITIAL_VECTOR_H_