2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FSecPkcsRc2CbcParameters.h
20 * @brief This is the header file for the %Rc2CbcParameters class.
22 * This header file contains the declarations of the %Rc2CbcParameters class.
25 #ifndef _FSEC_PKCS_RC2_CBC_PARAMETERS_H_
26 #define _FSEC_PKCS_RC2_CBC_PARAMETERS_H_
28 #include <FBaseByteBuffer.h>
29 #include <FSecPkcsIAlgorithmParameters.h>
30 #include <FSecPkcsTypes.h>
32 namespace Tizen { namespace Security { namespace Pkcs
36 * @class Rc2CbcParameters
37 * @brief This class implements the functionalities specified by the Rc2 Cbc mode parameter.
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)) }
49 class _OSP_EXPORT_ Rc2CbcParameters
50 : public virtual IAlgorithmParameters
51 , public Tizen::Base::Object
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.
61 Rc2CbcParameters(void);
64 * This destructor overrides Tizen::Base::Object::~Object().
68 virtual ~Rc2CbcParameters();
71 * Initializes this instance of %Rc2CbcParameters with the values of the specified input parameters.
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.
83 result Construct(const Tizen::Base::ByteBuffer& initialVector, int version = 0);
86 * Gets a copy of this instance.
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.
93 virtual IAlgorithmParameters* CloneN(void) const;
96 * Gets the algorithm parameter type enum value for %Rc2CbcParameters.
100 * @return An enum value containing the @c PKCS_ALGO_PARAM_TYPE_RC2 value for %Rc2CbcParameters parameter
103 virtual PkcsAlgorithmParameterType GetType(void) const;
106 * Checks whether the specified instance of %Rc2CbcParameters equals the current instance.
110 * @return @c true if the specified instance equals the current instance, @n
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.
117 virtual bool Equals(const Tizen::Base::Object& rhs) const;
120 * Gets the hash value of the current instance of %Rc2CbcParameters.
124 * @return An integer value indicating the hash value of the current instance of %Rc2CbcParameters
126 virtual int GetHashCode(void) const;
129 * Gets the rc2 cbc parameter version value.
133 * @return An integer value that contains the rc2 cbc parameter version
136 int GetVersion(void) const;
139 * Gets an instance of Tizen::Base::ByteBuffer that contains the initial vector value.
143 * @return A reference to Tizen::Base::ByteBuffer containing the initial vector data
146 const Tizen::Base::ByteBuffer& GetInitialVector(void) const;
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.
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.
160 Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
163 // This copy constructor is intentionally declared as private to prohibit @n
164 // copying of objects by users.
167 Rc2CbcParameters(const Rc2CbcParameters& rhs);
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.
173 Rc2CbcParameters& operator =(const Rc2CbcParameters& rhs);
176 class _Rc2CbcParametersImpl* __pRc2CbcParametersImpl;
177 friend class _Rc2CbcParametersImpl;
179 }; // Rc2CbcParameters
181 } } } // Tizen::Security::Pkcs
183 #endif // _FSEC_PKCS_RC2_CBC_PARAMETERS_H_