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 FSecISecretKeyGenerator.h
20 * @brief This is the header file for the %ISecretKeyGenerator interface.
22 * This header file contains the declarations of the %ISecretKeyGenerator interface.
24 #ifndef _FSEC_ISECRET_KEY_GENERATOR_H_
25 #define _FSEC_ISECRET_KEY_GENERATOR_H_
27 #include <FSecISecretKey.h>
28 #include <FBaseString.h>
31 namespace Tizen { namespace Security
35 * @interface ISecretKeyGenerator
36 * @brief This interface provides the abstract methods for generating a secret (symmetric) key.
40 * The %ISecretKeyGenerator interface provides the abstract methods for generating a secret (symmetric) key. @n
42 * 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>.
44 * @see Tizen::Security::ISecretKey
46 class _OSP_EXPORT_ ISecretKeyGenerator
51 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes @n
52 * are called when the destructor of this interface is called.
56 virtual ~ISecretKeyGenerator(void) {}
59 * Generates a new secret key.
63 * @return A pointer to the ISecretKey interface, @n
64 * else @c null if the secret key generation fails
65 * @exception E_SUCCESS The method is successful.
66 * @exception E_OUT_OF_MEMORY The memory is insufficient.
67 * @exception E_SYSTEM A system error has occurred. @n
68 * The method has failed to operate with the OpenSSL library.
69 * @remarks The specific error code can be accessed using the GetLastResult() method.
71 virtual Tizen::Security::ISecretKey* GenerateKeyN(void) = 0;
75 // This method is for internal use only. Using this method can cause behavioral, security-related,
76 // and consistency-related issues in the application.
78 // This method is reserved and may change its name at any time without prior notice.
82 virtual void ISecretKeyGenerator_Reserved1(void) {}
85 }; //ISecretKeyGenerator
89 #endif // _FSEC_ISECRET_KEY_GENERATOR_H_