update doxygen comments
[platform/framework/native/appfw.git] / inc / FSecPkcsPkcs08Attribute.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                FSecPkcsPkcs08Attribute.h
20  * @brief               This is the header file for the %Pkcs08Attribute class.
21  *
22  * This header file contains the declarations of the %Pkcs08Attribute class.
23  */
24
25 #ifndef _FSEC_PKCS_PKCS_08_ATTRIBUTE_H_
26 #define _FSEC_PKCS_PKCS_08_ATTRIBUTE_H_
27
28 #include <FBaseByteBuffer.h>
29 #include <FBaseResult.h>
30 #include <FSecPkcsPkcs08AttributeValue.h>
31
32 namespace Tizen { namespace Security { namespace Pkcs
33 {
34
35 /**
36  * @class               Pkcs08Attribute
37  * @brief               This class implements the functionalities specified by the %Pkcs08Attribute class.
38  *
39  * @since               2.1
40  *
41  * The %Pkcs08Attribute class implements the functionalities specified by the %Pkcs08Attribute class. An Attribute object consists
42  *                                      of an attribute type (specified by an object identifier) and one or more attribute values. It acts as a
43  *                                      container for adding, inserting, removing, and encoding X.509 AttributeValue.
44  *
45  */
46
47 class _OSP_EXPORT_ Pkcs08Attribute
48         : public Tizen::Base::Object
49 {
50 public:
51         /**
52          * The object is not fully constructed after this constructor is called. @n
53          * For full construction, the Construct() method must be called right after calling this constructor.
54          *
55          * @since       2.1
56          */
57         Pkcs08Attribute(void);
58
59         /**
60          * This destructor overrides Tizen::Base::Object::~Object().
61          *
62          * @since       2.1
63          */
64         virtual ~Pkcs08Attribute(void);
65
66         /**
67          * Initializes this instance of %Pkcs08Attribute with the Tizen::Base::ByteBuffer that contains the X.509 attribute @n
68          * structure in ASN.1 DER format.
69          *
70          * @since               2.1
71          *
72          * @return              An error code
73          * @param[in]   encodedData                             The DER encoded Tizen::Base::ByteBuffer containing the X.509 attribute structure
74          * @exception   E_SUCCESS                                       The method is successful.
75          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
76          */
77         result Construct(const Tizen::Base::ByteBuffer& encodedData);
78
79         /**
80          * Initializes this instance of %Pkcs08Attribute with the specified attribute type.
81          *
82          * @since               2.1
83          *
84          * @return              An error code
85          * @param[in]   attributeType                   The object identifier of a particular X.509 attribute type @n Object IDs (for example, oid for name is 2.5.4.41) are defined by standard attribute bodies.
86          * @exception   E_SUCCESS                                       The method is successful.
87          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
88          */
89         result Construct(const Tizen::Base::String& attributeType);
90
91         /**
92          * Gets the attribute type. @n
93          * The %GetAttributeType() method implements GetAttributeType that returns the attribute type of this attribute instance.
94          *
95          * @since               2.1
96          *
97          * @return              Containing the object ID of attribute type in string format like 2.5.4.41
98          *
99          */
100         Tizen::Base::String GetAttributeType(void) const;
101
102         /**
103          * Adds an attribute value in the attribute value list.
104          *
105          * @since               2.1
106          *
107          * @return              An error code
108          * @param[in]   attributeValue                  An instance of Pkcs08AttributeValue to add an attribute in the list
109          */
110         result AddAttributeValue(const Pkcs08AttributeValue& attributeValue);
111
112         /**
113          * Removes an attribute value from the attribute value list.
114          *
115          * @since               2.1
116          *
117          * @return              An error code
118          * @param[in]   attributeValue                  An instance of Pkcs08AttributeValue to remove an attribute from the list
119          */
120         result RemoveAttributeValue(const Pkcs08AttributeValue& attributeValue);
121
122         /**
123          * Returns an array list containing the attribute values of type Pkcs08AttributeValue.
124          *
125          * @since               2.1
126          *
127          * @return              A reference to an ArrayList containing the list of attribute values
128          */
129         const Tizen::Base::Collection::ArrayList& GetAttributeValues(void) const;
130
131         /**
132          * Gets the encoded form of Pkcs08Attribute.
133          * It is assumed that each %Pkcs08Attribute will have only a single form of encoding, for example ASN.1 DER.
134          *
135          * @since               2.1
136          *
137          * @return              A pointer to the Tizen::Base::ByteBuffer class that contains the output, @n
138          *                                              else @c null if an error occurs
139          *
140          * @exception   E_SUCCESS                                               The method is successful.
141          * @exception   E_SYSTEM                                                The method cannot proceed due to a severe system error.
142          * @remarks             The specific error code can be accessed using the GetLastResult() method.
143          */
144         Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
145
146 private:
147         // This copy constructor is intentionally declared as private to prohibit @n
148         // copying of objects by users.
149         //
150         // @since               2.1
151         Pkcs08Attribute(const Pkcs08Attribute& rhs);
152
153         // The implementation of this copy assignment operator is intentionally blank and @n
154         // declared as private to prohibit copying of objects.
155         //
156         // @since               2.1
157         Pkcs08Attribute& operator =(const Pkcs08Attribute& rhs);
158
159 private:
160         class _Pkcs08AttributeImpl* __pPkcs08AttributeImpl;
161         friend class _Pkcs08AttributeImpl;
162
163 }; //Pkcs08Attribute
164
165 }}} // Tizen::Security::Pkcs
166
167 #endif // _FSEC_PKCS_PKCS_08_ATTRIBUTE_H_