Merge "Add Setting feature on system-server lib" into tizen_2.2
[platform/framework/native/appfw.git] / src / security / FSec_GenerateParameters.h
1 //
2 // Copyright (c) 2012 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        FSec_GenerateParameters.h
19  * @brief       This file contains implementation of Generating Key Exchange Parameters p and g using ANSFS X9.31 Standard.
20  */
21 #ifndef _FSEC_INTERNAL_GENERATE_PARAMETERS_H_
22 #define _FSEC_INTERNAL_GENERATE_PARAMETERS_H_
23
24
25 namespace Tizen { namespace Security
26 {
27
28 /**
29  *      @class          _GenerateParameters
30  *      @brief          This class generates a pseudo random number as per X9.31 specification using algorithm passed as input.
31  *      @since 2.1
32  *
33  * This file contains implementation of Generating Key Exchange Parameters p and g using ANSFS X9.31 Standard.
34  *
35  */
36 class _GenerateParameters
37 {
38
39 public:
40         /**
41          * Generate key Exchange Parameters as per X9.31 specification using algorithm passed as input.
42          *
43          * @since 2.1
44          * @return                      Returns 0 in case of error otherwise success.
45          * @param[out]  pDh     Pointer to output DH structure which includes the generated parameters p and g.
46          * @param[in]   primeNumberLength   Length of the prime that is to be generated.
47          * @param[in]   generatorLength   Length of the generator that is to be generated.
48          * @param[in]   seedLengthInBytes Length of the seed that is required to Generate Key Exchange Parameters p and g.
49          *
50          */
51         static result GenerateParametersX186(void* pDh, long primeNumberLength, long generatorLength, long seedLengthInBytes);
52
53 private:
54         _GenerateParameters(void);
55         _GenerateParameters(const _GenerateParameters& rhs);
56         _GenerateParameters& operator =(const _GenerateParameters& rhs);
57         ~_GenerateParameters(void);
58
59 }; //_GenerateParameters
60
61 } } // Tizen::Security
62
63 #endif //_FSEC_INTERNAL_GENERATE_PARAMETERS_H_