update doxygen comments
[platform/framework/native/appfw.git] / inc / FSecPkcsPkcs08AttributeValue.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FSecPkcsPkcs08AttributeValue.h
20  * @brief               This is the header file for the %Pkcs08AttributeValue class.
21  *
22  * This header file contains the declarations of the %Pkcs08AttributeValue class.
23  */
24
25 #ifndef _FSEC_PKCS_PKCS_08_ATTRIBUTE_VALUE_H_
26 #define _FSEC_PKCS_PKCS_08_ATTRIBUTE_VALUE_H_
27
28 #include <FBaseByteBuffer.h>
29 #include <FBaseResult.h>
30 #include <FSecPkcsTypes.h>
31
32 namespace Tizen { namespace Security { namespace Pkcs
33 {
34
35 /**
36  * @class               Pkcs08AttributeValue
37  * @brief               This class implements the functionalities specified by the %Pkcs08AttributeValue class.
38  * 
39  * @since               2.1
40  *
41  * The %Pkcs08AttributeValue class implements the functionalities specified by the %Pkcs08AttributeValue class.
42  * The %Pkcs08AttributeValue object consists of an attribute value and a tag value.
43  *
44  */
45 class _OSP_EXPORT_ Pkcs08AttributeValue
46         : public Tizen::Base::Object
47 {
48 public:
49         /**
50          * The object is not fully constructed after this constructor is called. @n
51          * For full construction, the Construct() method must be called right after calling this constructor.
52          *
53          * @since       2.1
54          */
55         Pkcs08AttributeValue(void);
56
57         /**
58          * This destructor overrides Tizen::Base::Object::~Object().
59          *
60          * @since       2.1
61          */
62         virtual ~Pkcs08AttributeValue(void);
63
64         /**
65          * Initializes this instance of %Pkcs08AttributeValue with the Tizen::Base::ByteBuffer that contains the AttributeValue @n
66          * (contain tag, that is, Ans1_Type and the value).
67          *
68          * @since               2.1
69          *
70          * @return              An error code
71          * @param[in]   encodedData                             The DER encoded Tizen::Base::ByteBuffer of AttributeValue
72          * @exception   E_SUCCESS                                       The method is successful.
73          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
74          */
75         result Construct(const Tizen::Base::ByteBuffer& encodedData);
76
77         /**
78          * Initializes this instance of %Pkcs08AttributeValue with the specified parameters. @n
79          * The %Construct() method initializes the attribute value instance based on the byte buffer passed.
80          *
81          * @since               2.1
82          *
83          * @return              An error code
84          * @param[in]   value                                   An instance of Tizen::Base::ByteBuffer holding raw value
85          * @param[in]   tag                                             A tag holding the tag type @n This tag number is assigned by ASN1 standards for @n
86          *                                                                                                      basic data types.
87          * @exception   E_SUCCESS                               The method is successful.
88          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
89          */
90         result Construct(const Tizen::Base::ByteBuffer& value, const Pkcs08TagValue tag);
91
92         /**
93          * Gets a reference to Tizen::Base::ByteBuffer that contains the attribute value.
94          *
95          * @since               2.1
96          *
97          * @return              A reference to Tizen::Base::ByteBuffer containing raw value
98          * @remarks             The specific error code can be accessed using the GetLastResult() method.
99          */
100         const Tizen::Base::ByteBuffer& GetValue(void) const;
101
102         /**
103          * Gets the tag value of an attribute. @n
104          * This tag number is assigned by ASN1 standards for basic data types.
105          *
106          * @since               2.1
107          *
108          * @return              The tag value that is assigned by ASN1 standards for basic data types
109          */
110         Pkcs08TagValue GetTag(void) const;
111
112         /**
113          * Gets a pointer to Tizen::Base::ByteBuffer that contains the attribute value in encoded format. @n
114          * It is assumed that each Pkcs08Attribute will have only a single form of encoding, for example, ASN.1 DER.
115          *
116          * @since               2.1
117          *
118          * @return              A pointer to the Tizen::Base::ByteBuffer class that contains the output, @n
119          *                                              else @c null if an error occurs
120          * @exception   E_SUCCESS                               The method is successful.
121          * @exception   E_SYSTEM                                The method cannot proceed due to a severe system error.
122          * @remarks             The specific error code can be accessed using the GetLastResult() method.
123          */
124         Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
125
126 private:
127         // This copy constructor is intentionally declared as private to prohibit @n
128         // copying of objects by users.
129         //
130         // @since               2.1
131         Pkcs08AttributeValue(const Pkcs08AttributeValue& rhs);
132
133         // The implementation of this copy assignment operator is intentionally blank and @n
134         // declared as private to prohibit copying of objects.
135         //
136         // @since               2.1
137         Pkcs08AttributeValue& operator =(const Pkcs08AttributeValue& rhs);
138
139 private:
140         class _Pkcs08AttributeValueImpl* __pPkcs08AttributeValueImpl;
141         friend class _Pkcs08AttributeValueImpl;
142
143 }; //Pkcs08AttributeValue
144
145 }}} //Tizen::Security::Pkcs
146
147 #endif // _FSEC_PKCS_PKCS_08_ATTRIBUTE_VALUE_H_