2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSecIKeyParameters.h
19 * @brief This is the header file for the %IKeyParameters interface.
21 * This header file contains the declarations of the %IKeyParameters interface.
23 #ifndef _FSEC_CRYPTO_IKEY_PARAMETERS_H_
24 #define _FSEC_CRYPTO_IKEY_PARAMETERS_H_
26 #include <FBaseByteBuffer.h>
27 #include <FSecCryptoTypes.h>
29 namespace Tizen { namespace Security
33 * @interface IKeyParameters
34 * @brief This interface provides the abstract methods for retrieving the parameters of the key exchange algorithms.
38 * The %IKeyParameters interface provides the abstract methods for retrieving the parameters of the key exchange algorithms. @n
40 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/security/key_exchange_algorithm.htm">Key exchanging</a>.
42 * @see Tizen::Security::KeyPair
44 class _OSP_EXPORT_ IKeyParameters
49 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes @n
50 * are called when the destructor of this interface is called.
54 virtual ~IKeyParameters(void) {}
57 * Gets the value of the parameter for a specified key parameter type.
61 * @return A pointer to the Tizen::Base::ByteBuffer class that contains the parameter values, @n
62 * else @c null if an error occurs
63 * @param[in] paramType The type of the parameter @n
64 * For example, @c KEY_PARAMETER_DH_G.
65 * @exception E_SUCCESS The method is successful.
66 * @exception E_OUT_OF_MEMORY The memory is insufficient.
67 * @exception E_UNSUPPORTED_TYPE The specified @c paramType is not supported.
68 * @remarks The specific error code can be accessed using the GetLastResult() method.
70 virtual Tizen::Base::ByteBuffer* GetParameterValueN(KeyParameterType paramType) const = 0;
73 * Gets the size of the key parameter in bits for the specified key parameter type.
77 * @return The size of the parameter, @n
78 * else @c 0 if an error occurs
79 * @param[in] keyParameterType The type of the parameter @n
80 * For example, @c PRIVATE_KEY_SIZE.
81 * @exception E_SUCCESS The method is successful.
82 * @exception E_OUT_OF_MEMORY The memory is insufficient.
83 * @exception E_UNSUPPORTED_TYPE The specified @c paramType is not supported.
84 * @remarks The specific error code can be accessed using the GetLastResult() method.
86 virtual int GetParameterSize(KeyParameterType keyParameterType) const = 0;
90 // This method is for internal use only. Using this method can cause behavioral, security-related,
91 // and consistency-related issues in the application.
93 // This method is reserved and may change its name at any time without prior notice.
97 virtual void IKeyParameters_Reserved1(void) {}
100 // This method is for internal use only. Using this method can cause behavioral, security-related,
101 // and consistency-related issues in the application.
103 // This method is reserved and may change its name at any time without prior notice.
107 virtual void IKeyParameters_Reserved2(void) {}
111 } } //Tizen::Security
113 #endif //_FSEC_CRYPTO_IKEY_PAIR_PARAMETERS_H_