//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
#include <FSecISecureRandom.h>
#include <FSecIKeyParameters.h>
-
namespace Tizen { namespace Security
{
result Construct(int modulusBitSize, const Tizen::Base::String algorithm);
/**
- * Generates the key parameters based on the underlying key pair algorithm. @n
- * For example, in case of the DH or KEA algorithm, this method generates key parameters based on the DSA
- * algorithm (X186.3 specification).
- * The supported algorithms are RSA, DH, and KEA.
- * The generated key parameters may be required to create a key pair. The RSA algorithm
- * does not call this method to generate a key pair.
- *
- * @since 2.0
- *
- * @return A pointer to the IKeyParameters class that contains a subset of the domain parameters ('p' prime
- * number, 'g' generator) that are used to generate a key pair, @n
- * else @c null if the method fails to create the key parameters
- * @param[in] lInBits The size of 'p', a prime number in bits @n
- * The size must be @c 1024 bits, @c 2048 bits, or @c 3072 bits.
- * @param[in] nInBits The size of 'g', a generator value in bits @n
- * The size must be:
- * - 160 bits, when @c lInBits is @c 1024 bits.
- * - 254 or 256 bits, when @c lInBits is @c 2048 bits.
- * - 256 bits, when @c lInBits is @c 3072 bits.
- * @exception E_SUCCESS The method is successful.
- * @exception E_UNSUPPORTED_ALGORITHM The requested algorithm is not supported.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_SYSTEM A system error has occurred. @n
- * The method has failed to operate with the OpenSSL library, or the Tizen::Base::ByteBuffer operation has failed.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
- */
+ * Generates the key parameters based on the underlying key pair algorithm. @n
+ * For example, in case of the DH or KEA algorithm, this method generates key parameters based on the DSA
+ * algorithm (X186.3 specification).
+ * The supported algorithms are RSA, DH, and KEA.
+ * The generated key parameters may be required to create a key pair. The RSA algorithm
+ * does not call this method to generate a key pair.
+ *
+ * @since 2.0
+ *
+ * @return A pointer to the IKeyParameters class that contains a subset of the domain parameters ('p' prime
+ * number, 'g' generator) that are used to generate a key pair, @n
+ * else @c null if the method fails to create the key parameters
+ * @param[in] lInBits The size of 'p', a prime number in bits @n
+ * The size must be @c 1024 bits, @c 2048 bits, or @c 3072 bits.
+ * @param[in] nInBits The size of 'g', a generator value in bits @n
+ * The size must be:
+ * - 160 bits, when @c lInBits is @c 1024 bits.
+ * - 254 or 256 bits, when @c lInBits is @c 2048 bits.
+ * - 256 bits, when @c lInBits is @c 3072 bits.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error. @n
+ * The method has failed to operate with the OpenSSL library, or the Tizen::Base::ByteBuffer operation has failed.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
Tizen::Security::IKeyParameters* GenerateKeyParametersN(int lInBits = 1024, int nInBits = 160) const;
/**
* @param[in] pKeyParams The domain parameters of the key exchange algorithm @n
* These parameters are instantiated.
* @exception E_SUCCESS The method is successful.
- * @exception E_UNSUPPORTED_ALGORITHM The requested algorithm is not supported.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_SYSTEM A system error has occurred. @n
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error. @n
* The method has failed to operate with the OpenSSL library, or the Tizen::Base::ByteBuffer operation has failed.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
* @since 2.0
*
* @return A pointer to the KeyPair class, @n
- else @c null if the method fails to create the key pair
+ else @c null if the method fails to create the key pair.
+ * Default key format will be pkcs1 for private key and x509 for public key.
* @exception E_SUCCESS The method is successful.
- * @exception E_UNSUPPORTED_ALGORITHM The requested algorithm is not supported.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_SYSTEM A system error has occurred. @n
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error. @n
* The method has failed to operate with the OpenSSL library, or the Tizen::Base::ByteBuffer operation has failed.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
virtual Tizen::Security::KeyPair* GenerateKeyPairN(void) const;
private:
-
//
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
//
class _KeyPairGeneratorImpl* __pKeyPairGeneratorImpl;
friend class _KeyPairGeneratorImpl;
-}; //KeyPairGenerator
+}; //KeyPairGenerator
} } //Tizen::Security