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 FSecAesSecureRandom.h
20 * @brief This is the header file for the %AesSecureRandom class.
22 * This header file contains the declarations of the %AesSecureRandom class.
24 #ifndef _FSEC_AES_SECURE_RANDOM_H_
25 #define _FSEC_AES_SECURE_RANDOM_H_
27 #include <FSecISecureRandom.h>
30 namespace Tizen { namespace Security
34 * @class AesSecureRandom
35 * @brief This class generates a secure random object with the Advanced Encryption Standard (AES) method.
39 * The %AesSecureRandom class generates a secure random object for seeding cryptographic algorithms.
40 * The Advanced Encryption Standard (AES) method generates a user-defined number of random bytes. @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>.
45 * @see DesSecureRandom
46 * @see DesEdeSecureRandom
48 class _OSP_EXPORT_ AesSecureRandom
49 : public virtual ISecureRandom
50 , public Tizen::Base::Object
55 * This is the default constructor for this class.
59 AesSecureRandom(void);
62 * This destructor overrides Tizen::Base::Object::~Object().
66 virtual ~AesSecureRandom(void);
69 * Generates a user-defined number of random bytes.
73 * @return A pointer to the Tizen::Base::ByteBuffer class, @n
74 * else @c null if an error occurs
75 * @param[in] numBytes The number of random bytes to generate
76 * @exception E_SUCCESS The method is successful.
77 * @exception E_OUT_OF_MEMORY The memory is insufficient.
78 * @exception E_INVALID_ARG The specified @c numBytes is @c 0 or negative.
79 * @exception E_SYSTEM A system error has occurred.
80 * @remarks The specific error code can be accessed using the GetLastResult() method.
82 virtual Tizen::Base::ByteBuffer* GenerateRandomBytesN(int numBytes);
87 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
91 AesSecureRandom(const AesSecureRandom& rhs);
94 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
98 AesSecureRandom& operator =(const AesSecureRandom& rhs);
101 class _AesSecureRandomImpl* __pAesSecureRandomImpl;
102 friend class _AesSecureRandomImpl;
106 } } //Tizen::Security
108 #endif //_FSEC_AES_SECURE_RANDOM_H_