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