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 FSecDesSecureRandom.h
20 * @brief This is the header file for the %DesSecureRandom class.
22 * This header file contains the declarations of the %DesSecureRandom class.
24 #ifndef _FSEC_DES_SECURE_RANDOM_H_
25 #define _FSEC_DES_SECURE_RANDOM_H_
27 #include <FSecISecureRandom.h>
30 namespace Tizen { namespace Security
34 * @class DesSecureRandom
35 * @brief This class provides a secure random object with Data Encryption Standard (DES) method.
39 * The %DesSecureRandom class generates a secure random object that can be used to seed deterministic, cryptographic algorithms.
40 * The DES 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 AesSecureRandom
46 * @see DesEdeSecureRandom
48 class _OSP_EXPORT_ DesSecureRandom
49 : public virtual ISecureRandom
50 , public Tizen::Base::Object
55 * This is the default constructor for this class.
59 DesSecureRandom(void);
62 * This destructor overrides Tizen::Base::Object::~Object().
66 virtual ~DesSecureRandom(void);
69 * Generates a user-specified 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. @n
80 * The Tizen::Base::ByteBuffer operation has failed.
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 DesSecureRandom(const DesSecureRandom& rhs);
94 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
98 DesSecureRandom& operator =(const DesSecureRandom& rhs);
101 class _DesSecureRandomImpl* __pDesSecureRandomImpl;
102 friend class _DesSecureRandomImpl;
106 } } //Tizen::Security
108 #endif // _FSEC_DES_SECURE_RANDOM_H_