Remove the memory leak on osp-security-service
[platform/framework/native/appfw.git] / inc / FSecCertICertificate.h
index 3af1399..dd17a75 100755 (executable)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -34,31 +33,31 @@ namespace Tizen { namespace Security { namespace Cert
 /**
  * @enum CertificateType
  *
- * Defines the type of certificate.
+ * Defines the type of security certificate.
  *
  * @since              2.0
  */
 enum CertificateType
 {
        ROOT_CA,                        /**< The Factory-supplied certificates for SSL: ROOT CA */
-       OPERATOR_DOMAIN,                /**< The Operator Domain */
-       TRUSTED_THIRD_PARTY_DOMAIN,     /**< The Trusted Third Party Domain */
-       USER_CERT,                      /**< The User Certificates */
-       UNKNOWN_TYPE = 10,              /**< The unknown type */
+       OPERATOR_DOMAIN,                /**< The operator domain certificate */
+       TRUSTED_THIRD_PARTY_DOMAIN,     /**< The trusted third party domain certificate*/
+       USER_CERT,                      /**< The user certificate */
+       UNKNOWN_TYPE = 10,              /**< The unknown type certificate*/
 }; //CertificateType
 
 /**
  * @enum ValidityPeriod
  *
- * Defines the validity period.
+ * Defines the certificate validity period.
  *
  * @since              2.0
  */
 enum ValidityPeriod
 {
-       VALIDITY_PERIOD_VALID,          /**< The validity period */
-       VALIDITY_PERIOD_EXPIRED,        /**< The expiry period */
-       VALIDITY_PERIOD_NOT_YET_VALID,  /**< The period that is not yet valid */
+       VALIDITY_PERIOD_VALID,          /**< The certificate is valid */
+       VALIDITY_PERIOD_EXPIRED,        /**< The certificate has expired */
+       VALIDITY_PERIOD_NOT_YET_VALID,  /**< The certificate period is not yet valid */
 }; //ValidityPeriod
 
 /**
@@ -67,8 +66,9 @@ enum ValidityPeriod
  *
  * @since              2.0
  *
- * The %ICertificate interface is an abstraction for certificates having different formats. For example, different types of certificates, such as X.509 and PGP, share
- * general functionalities, namely encoding and verifying, and some type of information like public keys. Despite containing different sets of information and having different ways for storing, and retrieving them,
+ * The %ICertificate interface is an abstraction for certificates having different formats. For example, different types of 
+ * certificates, such as X.509 and PGP, share general functionalities, namely encoding and verifying, and information like 
+ * public keys. Despite containing different sets of information and having different ways for storing and retrieving them, 
  * the X.509, X.968, and WTLS certificates can all be implemented by using the %ICertificate interface.
  *
  * An identity certificate is a binding of a principal to a public key, which is vouched for by another principal.
@@ -185,7 +185,7 @@ public:
         *
         * @since               2.0
         *
-        * @return              The format of this certificate
+        * @return              The certificate format
         */
        virtual Tizen::Base::String GetFormat(void) const = 0;
 
@@ -194,11 +194,12 @@ public:
         *
         * @since               2.0
         *
-        * @return              The type of this certificate
+        * @return              The certificate type
         * @exception   E_SUCCESS               The method is successful.
-        * @exception   E_SYSTEM                A system error has occurred. @n
-        *                              The certificate link list operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                Either of the following conditions has occurred:
+        *                                                              - A system error has occurred.
+        *                                                              - The certificate link list operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual CertificateType GetType(void) const = 0;
 
@@ -212,16 +213,17 @@ public:
         *                              else @c null if an error occurs
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                  The certificate link list operation or the
-        *                                  Tizen::Base::ByteBuffer operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The certificate link list operation has failed.
+        *                                                                      - The Tizen::Base::ByteBuffer operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::ByteBuffer* GetEncodedDataN(void) const = 0;
 
        /**
         * Gets the fingerprint of the certificate. @n
-        * It is the hashed value of the encoding of the certificate.
+        * It is the hash value of the encoding of the certificate.
         *
         * @since               2.0
         *
@@ -229,10 +231,11 @@ public:
         *                              else @c null if an error occurs
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The certificate parsing operation or
-        *                                                                      the Tizen::Base::ByteBuffer operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The certificate parsing operation has failed.
+        *                                                                      - The Tizen::Base::ByteBuffer operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::ByteBuffer* GetFingerprintN(void) const = 0;
 
@@ -247,9 +250,10 @@ public:
         *      @exception      E_SUCCESS                       The method is successful.
         *      @exception      E_INVALID_ARG           The specified @c publicKey is invalid or empty.
         *      @exception      E_OUT_OF_MEMORY         The memory is insufficient.
-        *      @exception      E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The certificate parsing operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        *      @exception      E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The certificate parsing operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual bool Verify(const Tizen::Security::IPublicKey& publicKey) = 0;
 
@@ -263,16 +267,17 @@ public:
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
         * @exception   E_KEY_NOT_FOUND         The key is not found.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The Tizen::Base::ByteBuffer operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                      - A system error has occurred.
+        *                                                      - The Tizen::Base::ByteBuffer operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Security::IPublicKey* GetPublicKeyN(void) const = 0;
 
        /**
-        * Gets the @c serialNumber value from the certificate. @n
-        * The serial number is an integer assigned by the Certification Authority (CA) to each certificate. It is unique for each certificate issued by a
-        * given CA (that is, the issuer name and serial number must identify a unique certificate). @n
+        * Gets the serial number of the certificate. @n
+        * The serial number is a unique integer assigned by the Certification Authority (CA) to each certificate (that is, the issuer name and serial number 
+        * must identify a unique certificate). @n
         *
         * This is defined in ASN.1 as demonstrated in the following code:
         *
@@ -282,23 +287,25 @@ public:
         *      CertificateSerialNumber  ::=  INTEGER
         *  @endcode
         *
-        * Since the serial number can be greater than the system's maximum value for @c int, the output parameter type is @c ByteBuffer, instead of @c int.
+        * Since the serial number can be greater than the system's maximum defined value for @c int, the output parameter type 
+        * is @c ByteBuffer, instead of @c int.
         *
         * @since               2.0
         *
         * @return              The serial number of the certificate
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                  The method has failed to get the certificate serial number information.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                      - A system error has occurred.
+        *                                                      - The method has failed to get the certificate serial number information.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::String GetSerialNumber(void) const = 0;
 
        /**
         * Checks whether the certificate is currently valid. @n
-        * It is valid if the current date and time are within the validity period given in the certificate. @n
-        * The validity period consists of two date and time values: the initial date and time, and the final date and time until the validity of the certificate. @n
+        * It is valid if the current date and time are within the validity period of the certificate. The validity period consists 
+        * of two date and time values: the initial date and time, and the final date and time for the validity of the certificate. @n
         *
         * This is defined in ASN.1 as demonstrated in the following code:
         *
@@ -314,29 +321,31 @@ public:
         *              generalTime    GeneralizedTime }
         *  @endcode
         *
-        * @since                       2.0
+        * @since               2.0
         *
         * @return              The validity period of the certificate
         * @exception   E_SUCCESS                       The method is successful.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The certificate link list operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The certificate link list operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual ValidityPeriod CheckValidityPeriod(void) = 0;
 
 
        /**
         * Gets the notBefore value of Tizen::Base::String type from the validity period of the certificate. @n
-        *      This value represents the date and time before which the certificate is not valid.
+        * This value represents the date and time before which the certificate is not valid.
         *
         * @since               2.0
         *
         * @return              A string representing the date and time value before which the certificate is not valid
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The method has failed to get the certificate validity information.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The method has failed to get the certificate validity information.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         * @see                 Tizen::Security::Cert::X509Certificate::CheckValidityPeriod() for relevant ASN.1 definitions
         */
        virtual Tizen::Base::String GetNotBefore(void) const = 0;
@@ -344,16 +353,17 @@ public:
 
        /**
         * Gets the notAfter value of Tizen::Base::String type from the validity period of the certificate. @n
-        *      This value represents the date and time after which the certificate is not valid.
+        * This value represents the date and time after which the certificate is not valid.
         *
         * @since               2.0
         *
         * @return              A string representing the date and time value after which the certificate is not valid
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The method has failed to get the certificate validity information.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The method has failed to get the certificate validity information.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         * @see                 Tizen::Security::Cert::X509Certificate::CheckValidityPeriod() for relevant ASN.1 definitions
         */
        virtual Tizen::Base::String GetNotAfter(void) const = 0;
@@ -366,9 +376,10 @@ public:
         * @return              The name of the issuer of the certificate
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                  The method has failed to get the certificate issuer information.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The method has failed to get the certificate issuer information.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::String GetIssuer(void) const = 0;
 
@@ -380,9 +391,10 @@ public:
         * @return              The subject name of the certificate
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The method has failed to get the certificate issuer information.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The method has failed to get the certificate issuer information.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::String GetSubject(void) const = 0;
 
@@ -395,10 +407,11 @@ public:
         *                              else @c null if an error occurs
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        * @exception   E_SYSTEM                        A system error has occurred. @n
-        *                                                                      The certificate link list operation or
-        *                                                                      the Tizen::Base::ByteBuffer operation has failed.
-        * @remarks        The specific error code can be accessed using the GetLastResult() method.
+        * @exception   E_SYSTEM                        Either of the following conditions has occurred:
+        *                                                                      - A system error has occurred.
+        *                                                                      - The certificate link list operation has failed.
+        *                                                                      - The Tizen::Base::ByteBuffer operation has failed.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         */
        virtual Tizen::Base::ByteBuffer* GetSignatureN(void) const = 0;