2 // Open Service Platform
3 // Copyright (c) 2012 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 FSecIKeyParameters.h
20 * @brief This is the header file for the %IKeyParameters interface.
22 * This header file contains the declarations of the %IKeyParameters interface.
24 #ifndef _FSEC_CRYPTO_IKEY_PARAMETERS_H_
25 #define _FSEC_CRYPTO_IKEY_PARAMETERS_H_
27 #include <FBaseByteBuffer.h>
28 #include <FSecCryptoTypes.h>
30 namespace Tizen { namespace Security
34 * @interface IKeyParameters
35 * @brief This interface provides the abstract methods for retrieving the parameters of the key exchange algorithms.
39 * The %IKeyParameters interface provides the abstract methods for retrieving the parameters of the key exchange algorithms. @n
41 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/security/key_exchange_algorithm.htm">Key exchanging</a>.
43 * @see Tizen::Security::KeyPair
45 class _OSP_EXPORT_ IKeyParameters
50 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes @n
51 * are called when the destructor of this interface is called.
55 virtual ~IKeyParameters(void) {}
58 * Gets the value of the parameter for a specified key parameter type.
62 * @return A pointer to the Tizen::Base::ByteBuffer class that contains the parameter values, @n
63 * else @c null if an error occurs
64 * @param[in] paramType The type of the parameter @n
65 * For example, @c KEY_PARAMETER_DH_G.
66 * @exception E_SUCCESS The method is successful.
67 * @exception E_OUT_OF_MEMORY The memory is insufficient.
68 * @exception E_UNSUPPORTED_TYPE The specified @c paramType is not supported.
69 * @remarks The specific error code can be accessed using the GetLastResult() method.
71 virtual Tizen::Base::ByteBuffer* GetParameterValueN(KeyParameterType paramType) const = 0;
74 * Gets the size of the key parameter in bits for the specified key parameter type.
78 * @return The size of the parameter, @n
79 * else @c 0 if an error occurs
80 * @param[in] keyParameterType The type of the parameter @n
81 * For example, @c PRIVATE_KEY_SIZE.
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_OUT_OF_MEMORY The memory is insufficient.
84 * @exception E_UNSUPPORTED_TYPE The specified @c paramType is not supported.
85 * @remarks The specific error code can be accessed using the GetLastResult() method.
87 virtual int GetParameterSize(KeyParameterType keyParameterType) const = 0;
91 // This method is for internal use only. Using this method can cause behavioral, security-related,
92 // and consistency-related issues in the application.
94 // This method is reserved and may change its name at any time without prior notice.
98 virtual void IKeyParameters_Reserved1(void) {}
101 // This method is for internal use only. Using this method can cause behavioral, security-related,
102 // and consistency-related issues in the application.
104 // This method is reserved and may change its name at any time without prior notice.
108 virtual void IKeyParameters_Reserved2(void) {}
112 } } //Tizen::Security
114 #endif //_FSEC_CRYPTO_IKEY_PAIR_PARAMETERS_H_