Merge "remove unnecessary implementations" into tizen_2.1
[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  * @brief               Pkcs08AttributeValue object will consist of the value of an attribute and the tag value.
39  * @since               2.1
40  *
41  */
42 class _OSP_EXPORT_ Pkcs08AttributeValue
43         : public Tizen::Base::Object
44 {
45 public:
46         /**
47          * The object is not fully constructed after this constructor is called. @n
48          * For full construction, the Construct() method must be called right after calling this constructor.
49          *
50          * @since       2.1
51          */
52         Pkcs08AttributeValue(void);
53
54         /**
55          * This destructor overrides Tizen::Base::Object::~Object().
56          *
57          * @since       2.1
58          */
59         virtual ~Pkcs08AttributeValue(void);
60
61         /**
62          * Intializes this instance of %Pkcs08AttributeValue with the Bytebuffer which contain  AttributeValue @n
63          * (contain tag i.e. Ans1_Type and the value)
64          *
65          * @since               2.1
66          *
67          * @return              An error code
68          * @param[in]   encodedData                             DER encoded Bytebuffer of AttrributeValue.
69          * @exception   E_SUCCESS                                       The method is successful.
70          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
71          */
72         result Construct(const Tizen::Base::ByteBuffer& encodedData);
73
74         /**
75          * Intializes this instance of %Pkcs08AttributeValue with specified parameters.
76          * This API implements the Construct API which initializes the attribute value instance based on passed byte buffer.
77          *
78          * @since               2.1
79          *
80          * @return              An error code
81          * @param[in]   value                                   An instance of ByteBuffer, holding raw value. @n
82          * @param[in]   tag                                             Tag holding the tag type. This tag number is assigned by ASN1 standards for @n
83          *                                                                                                      basic data types.
84          * @exception   E_SUCCESS                               The method is successful.
85          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
86          */
87         result Construct(const Tizen::Base::ByteBuffer& value, const Pkcs08TagValue tag);
88
89         /**
90          * Get the reference to the ByteBuffer contains the attribute value.
91          *
92          * @since               2.1
93          *
94          * @return              A reference to ByteBuffer,containing raw value.
95          * @remarks             The specific error code can be accessed using the GetLastResult() method.
96          */
97         const Tizen::Base::ByteBuffer& GetValue(void) const;
98
99         /**
100          * Get the tag value of an attribute.
101          * This tag number is assigned by ASN1 standards for basic data types..
102          *
103          * @since               2.1
104          *
105          * @return              Tag value that is assigned by ASN1 standards for basic data types.
106          */
107         Pkcs08TagValue GetTag(void) const;
108
109         /**
110          * Gets the pointer to the ByteBuffer that contains the attribute value in encoded format.
111          * It is assumed that each Pkcs08Attribute will have only a single form of encoding example ASN.1 DER.
112          *
113          * @since               2.1
114          *
115          * @return              A pointer to the ByteBuffer class that contains the output, @n
116          *                                              else @c null if an error occurs.
117          * @exception   E_SUCCESS                               The method is successful.
118          * @exception   E_SYSTEM                                The method cannot proceed due to a severe system error.
119          * @remarks             The specific error code can be accessed using the GetLastResult() method.
120          */
121         Tizen::Base::ByteBuffer* GetEncodedDataN(void) const;
122
123 private:
124         // This copy constructor is intentionally declared as private to prohibit @n
125         // copying of objects by users.
126         //
127         // @since               2.1
128         Pkcs08AttributeValue(const Pkcs08AttributeValue& rhs);
129
130         // The implementation of this copy assignment operator is intentionally blank and @n
131         // declared as private to prohibit copying of objects.
132         //
133         // @since               2.1
134         Pkcs08AttributeValue& operator =(const Pkcs08AttributeValue& rhs);
135
136 private:
137         class _Pkcs08AttributeValueImpl* __pPkcs08AttributeValueImpl;
138         friend class _Pkcs08AttributeValueImpl;
139
140 }; //Pkcs08AttributeValue
141
142 }}} //Tizen::Security::Pkcs
143
144 #endif // _FSEC_PKCS_PKCS_08_ATTRIBUTE_VALUE_H_