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 FSecDesSecureRandom.h
19 * @brief This is the header file for the %DesSecureRandom class.
21 * This header file contains the declarations of the %DesSecureRandom class.
23 #ifndef _FSEC_DES_SECURE_RANDOM_H_
24 #define _FSEC_DES_SECURE_RANDOM_H_
26 #include <FSecISecureRandom.h>
29 namespace Tizen { namespace Security
33 * @class DesSecureRandom
34 * @brief This class provides a secure random object with Data Encryption Standard (DES) method.
38 * The %DesSecureRandom class generates a secure random object that can be used to seed deterministic, cryptographic algorithms.
39 * The DES method generates a user-defined number of random bytes. @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>.
44 * @see AesSecureRandom
45 * @see DesEdeSecureRandom
47 class _OSP_EXPORT_ DesSecureRandom
48 : public virtual ISecureRandom
49 , public Tizen::Base::Object
54 * This is the default constructor for this class.
58 DesSecureRandom(void);
61 * This destructor overrides Tizen::Base::Object::~Object().
65 virtual ~DesSecureRandom(void);
68 * Generates a user-specified number of random bytes.
72 * @return A pointer to the Tizen::Base::ByteBuffer class, @n
73 * else @c null if an error occurs
74 * @param[in] numBytes The number of random bytes to generate
75 * @exception E_SUCCESS The method is successful.
76 * @exception E_OUT_OF_MEMORY The memory is insufficient.
77 * @exception E_INVALID_ARG The specified @c numBytes is @c 0 or negative.
78 * @exception E_SYSTEM A system error has occurred. @n
79 * The Tizen::Base::ByteBuffer operation has failed.
81 virtual Tizen::Base::ByteBuffer* GenerateRandomBytesN(int numBytes);
86 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
90 DesSecureRandom(const DesSecureRandom& rhs);
93 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
97 DesSecureRandom& operator =(const DesSecureRandom& rhs);
100 class _DesSecureRandomImpl* __pDesSecureRandomImpl;
101 friend class _DesSecureRandomImpl;
105 } } //Tizen::Security
107 #endif // _FSEC_DES_SECURE_RANDOM_H_