Add to retry to read DUID.
[platform/framework/native/appfw.git] / inc / FSecRsaKeyConverter.h
old mode 100644 (file)
new mode 100755 (executable)
index dda7168..1cf437a
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -34,25 +33,28 @@ namespace Tizen { namespace Security
 /**
  * @enum    RsaKeyFormat
  *
- * Defines the type of rsa key format.
+ * Defines the types of rsa key format.
  *
  * @since              2.1
  */
 enum RsaKeyFormat
 {
-       RSA_KEY_FORMAT_PKCS01_PRIVATE_KEY = 0,     /**< % rsa key format is pkcs1 private key. */
-       RSA_KEY_FORMAT_PKCS01_PUBLIC_KEY = 1,      /**< % rsa key format is pkcs1 public key. */
-       RSA_KEY_FORMAT_PKCS08_PRIVATE_KEY = 2,     /**< % rsa key format is pkcs8 private key. */
-       RSA_KEY_FORMAT_X509_PUBLIC_KEY = 3,      /**< % rsa key format is X509 public key. */
-       RSA_KEY_FORMAT_UNKNOWN = 0xffffffff       /**< % rsa key format is unknown. */
+       RSA_KEY_FORMAT_PKCS01_PRIVATE_KEY = 0,     /**< The rsa key format is PKCS1 private key */
+       RSA_KEY_FORMAT_PKCS01_PUBLIC_KEY = 1,      /**< The rsa key format is PKCS1 public key */
+       RSA_KEY_FORMAT_PKCS08_PRIVATE_KEY = 2,     /**< The rsa key format is PKCS8 private key */
+       RSA_KEY_FORMAT_X509_PUBLIC_KEY = 3,      /**< The rsa key format is X509 public key */
+       RSA_KEY_FORMAT_UNKNOWN = 0xffffffff       /**< The rsa key format is unknown */
 }; //RsaKeyFormat;
 
 /**
  *  @class             RsaKeyConverter
  *  @brief             This class provides support for converting the RSA public/private key in multiple key formats and multiple encoding formats.
- *                             Supported RSA key formats are PKCS1/PKCS8/X509.
- *                             Supported encoding formats are DER/PEM.
+ *
  *  @since      2.1
+ *
+ *  The %RsaKeyConverter class provides support for converting the RSA public/private key in multiple key formats and multiple encoding formats. @n
+ *                             Supported RSA key formats are PKCS1/PKCS8/X509. @n
+ *                             Supported encoding formats are DER/PEM.
  */
 
 class _OSP_EXPORT_ RsaKeyConverter
@@ -60,37 +62,37 @@ class _OSP_EXPORT_ RsaKeyConverter
 
 public:
        /**
-        *      Generates a RSA encoded private key in the passed input RSA key format.
-        *      If the input private key is in PEM encoded format then the output RSA private key will be PEM encoded and if it is in DER encoded format
+        *      Generates a RSA encoded private key in the passed input RSA key format. @n
+        *      If the input private key is in PEM encoded format, then the output RSA private key will be PEM encoded; if it is in DER encoded format,
         *      then the output RSA private key will be DER encoded.
         *
         *      @since          2.1
         *
-        *      @return         A pointer to the encoded %ByteBuffer instance, @n
-        *                          else @c null if the method fails to convert the private key in the passed input format.
-        *      @param[in]      format                          An enum value contains the RSA private key format.
-        *                                                                      Valid values for the supported output RSA private key formats are only RSA_KEY_FORMAT_PKCS01_PRIVATE_KEY, RSA_KEY_FORMAT_PKCS08_PRIVATE_KEY.
-        *      @param[in]      key                                     An instance of IPrivateKey.
+        *      @return         A pointer to the encoded Tizen::Base::ByteBuffer instance, @n
+        *                          else @c null if the method fails to convert the private key in the passed input format
+        *      @param[in]      format                          An enum value that contains the RSA private key format @n
+        *                                                                      Valid values for the supported output RSA private key formats are only @c RSA_KEY_FORMAT_PKCS01_PRIVATE_KEY and @c RSA_KEY_FORMAT_PKCS08_PRIVATE_KEY.
+        *      @param[in]      key                                     An instance of IPrivateKey
         *      @exception      E_SUCCESS                                       The method is successful.
-        *      @exception      E_INVALID_ARG           The specified input parameter is invalid.
+        *      @exception      E_INVALID_ARG           A specified input parameter is invalid.
         *  @remarks    The specific error code can be accessed using the GetLastResult() method.
         */
        static Tizen::Base::ByteBuffer* ConvertPrivateKeyFormatN(RsaKeyFormat format, const IPrivateKey& key);
 
        /**
-        *      Generates a RSA encoded public key in the passed input RSA key format.
-        *      If the input public key is in PEM encoded format then the output RSA public key will be PEM encoded and if it is in DER encoded format
+        *      Generates a RSA encoded public key in the passed input RSA key format. @n
+        *      If the input public key is in PEM encoded format, then the output RSA public key will be PEM encoded; if it is in DER encoded format,
         *      then the output RSA public key will be DER encoded.
         *
         *      @since          2.1
         *
-        *      @return         A pointer to the encoded %ByteBuffer instance, @n
-        *                              else @c null if the method fails to convert the public key in the passed input format.
-        *      @param[in]      format                          An enum value contains the RSA public key format.
-        *                                                                      Valid values for the supported output RSA public key formats are only RSA_KEY_FORMAT_PKCS01_PUBLIC_KEY, RSA_KEY_FORMAT_X509_PUBLIC_KEY.
-        *      @param[in]      key                                     An instance of IPublicKey.
+        *      @return         A pointer to the encoded Tizen::Base::ByteBuffer instance, @n
+        *                              else @c null if the method fails to convert the public key in the passed input format
+        *      @param[in]      format                          An enum value that contains the RSA public key format @n
+        *                                                                      Valid values for the supported output RSA public key formats are only @c RSA_KEY_FORMAT_PKCS01_PUBLIC_KEY and @c RSA_KEY_FORMAT_X509_PUBLIC_KEY.
+        *      @param[in]      key                                     An instance of IPublicKey
         *      @exception      E_SUCCESS                                       The method is successful.
-        *      @exception      E_INVALID_ARG           The specified input parameter is invalid.
+        *      @exception      E_INVALID_ARG           A specified input parameter is invalid.
         *      @remarks    The specific error code can be accessed using the GetLastResult() method.
         */
        static Tizen::Base::ByteBuffer* ConvertPublicKeyFormatN(RsaKeyFormat format, const IPublicKey& key);
@@ -100,12 +102,12 @@ public:
         *
         *      @since          2.1
         *
-        *      @return         A pointer to the PEM encoded %ByteBuffer instance, @n
-                                       else @c null if the method fails to convert the key in the pem encoded format.
-        *      @param[in]      format                          An enum value contains the RSA key format of the input key.
-        *      @param[in]      key                                     An instance of IKey.
+        *      @return         A pointer to the PEM encoded Tizen::Base::ByteBuffer instance, @n
+        *                              else @c null if the method fails to convert the key in the PEM encoded format
+        *      @param[in]      format                          An enum value that contains the RSA key format of the input key
+        *      @param[in]      key                                     An instance of IKey
         *      @exception      E_SUCCESS                                       The method is successful.
-        *      @exception      E_INVALID_ARG           The specified input parameter is invalid.
+        *      @exception      E_INVALID_ARG           A specified input parameter is invalid.
         *      @remarks    The specific error code can be accessed using the GetLastResult() method.
         */
        static Tizen::Base::ByteBuffer* ConvertDerToPemN(RsaKeyFormat format, const IKey& key);
@@ -115,12 +117,12 @@ public:
         *
         *      @since          2.1
         *
-        *      @return         A pointer to the DER encoded %ByteBuffer instance, @n
-                                           else @c null if the method fails to convert the key in the der encoded format.
-        *      @param[in]      format                          An enum value contains the RSA key format of the input key.
-        *      @param[in]      key                                     An instance of IKey,
+        *      @return         A pointer to the DER encoded Tizen::Base::ByteBuffer instance, @n
+        *                                  else @c null if the method fails to convert the key in the DER encoded format
+        *      @param[in]      format                          An enum value that contains the RSA key format of the input key
+        *      @param[in]      key                                     An instance of IKey
         *      @exception      E_SUCCESS                                       The method is successful.
-        *      @exception      E_INVALID_ARG           The specified input parameter is invalid.
+        *      @exception      E_INVALID_ARG           A specified input parameter is invalid.
         *  @remarks    The specific error code can be accessed using the GetLastResult() method.
         */
        static Tizen::Base::ByteBuffer* ConvertPemToDerN(RsaKeyFormat format, const IKey& key);