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 FSecISecretKeyGenerator.h
19 * @brief This is the header file for the %ISecretKeyGenerator interface.
21 * This header file contains the declarations of the %ISecretKeyGenerator interface.
23 #ifndef _FSEC_ISECRET_KEY_GENERATOR_H_
24 #define _FSEC_ISECRET_KEY_GENERATOR_H_
26 #include <FSecISecretKey.h>
27 #include <FBaseString.h>
30 namespace Tizen { namespace Security
34 * @interface ISecretKeyGenerator
35 * @brief This interface provides the abstract methods for generating a secret (symmetric) key.
39 * The %ISecretKeyGenerator interface provides the abstract methods for generating a secret (symmetric) key. @n
41 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/security/key_mgmt_and_csprng.htm">Key Management and CSPRNG</a>.
43 * @see Tizen::Security::ISecretKey
45 class _OSP_EXPORT_ ISecretKeyGenerator
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 ~ISecretKeyGenerator(void) {}
58 * Generates a new secret key.
62 * @return A pointer to the ISecretKey interface, @n
63 * else @c null if the secret key generation fails
64 * @exception E_SUCCESS The method is successful.
65 * @exception E_OUT_OF_MEMORY The memory is insufficient.
66 * @exception E_SYSTEM A system error has occurred. @n
67 * The method has failed to operate with the OpenSSL library.
68 * @remarks The specific error code can be accessed using the GetLastResult() method.
70 virtual Tizen::Security::ISecretKey* GenerateKeyN(void) = 0;
74 // This method is for internal use only. Using this method can cause behavioral, security-related,
75 // and consistency-related issues in the application.
77 // This method is reserved and may change its name at any time without prior notice.
81 virtual void ISecretKeyGenerator_Reserved1(void) {}
84 }; //ISecretKeyGenerator
88 #endif // _FSEC_ISECRET_KEY_GENERATOR_H_