X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inc%2FFSecKeyPairGenerator.h;h=56195de004aa06f38bfcb2f8aa3183ecd4805b71;hb=ee0dd6e4ea27209f7f29314d4f924c415ec06c30;hp=c3ad392c4ccbe665447d7ca34feb8a41b0ab19eb;hpb=6b44196c40a66b895028f7ba2e9b5e41bc715ab2;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/inc/FSecKeyPairGenerator.h b/inc/FSecKeyPairGenerator.h old mode 100644 new mode 100755 index c3ad392..56195de --- a/inc/FSecKeyPairGenerator.h +++ b/inc/FSecKeyPairGenerator.h @@ -1,5 +1,4 @@ // -// Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); @@ -28,7 +27,6 @@ #include #include - namespace Tizen { namespace Security { @@ -96,35 +94,34 @@ public: * The modulus size must be at least greater than or equal to @c 1024 bits @n * to generate cryptographically secure keys. */ - result Construct(int modulusBitSize, const Tizen::Base::String algorithm); + result Construct(int modulusBitSize, 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; /** @@ -137,9 +134,8 @@ public: * @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. */ @@ -151,18 +147,17 @@ public: * @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. // @@ -184,7 +179,7 @@ private: class _KeyPairGeneratorImpl* __pKeyPairGeneratorImpl; friend class _KeyPairGeneratorImpl; -}; //KeyPairGenerator +}; //KeyPairGenerator } } //Tizen::Security