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