Merge "remove unnecessary implementations" into tizen_2.1
[platform/framework/native/appfw.git] / inc / FSecPkcsTypes.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                FSecPkcsTypes.h
20  * @brief               This header file contains the declarations of AlgorithmIdentifier and AttributeType OID List.
21  * @brief               This header file also contains the enum declaration of AlgorithmParameterType and Pkcs08TagValue.
22  *
23  * This header file contains the declarations of the AlgorithmIdentifier and AttributeType OID List.
24  * It also contains the enum declaration of AlgorithmParameterType and Pkcs08TagValue.
25  */
26
27 #ifndef _FSEC_PKCS_TYPES_H_
28 #define _FSEC_PKCS_TYPES_H_
29
30 #include <FBaseString.h>
31
32 namespace Tizen { namespace Security { namespace Pkcs
33 {
34
35 /**
36  * @enum    PkcsAlgorithmParameterType
37  *
38  * Defines the type of parameters.
39  *
40  * @since               2.1
41  */
42 enum PkcsAlgorithmParameterType
43 {
44         PKCS_ALGO_PARAM_TYPE_IV,              /**< parameter type is initial vector */
45         PKCS_ALGO_PARAM_TYPE_PKCS05_PBES02,   /**< parameter type is pkcs5 password based encryption scheme2 */
46         PKCS_ALGO_PARAM_TYPE_PKCS05_KDF02,    /**< parameter type is pkcs5 password based key derivation scheme2 */
47         PKCS_ALGO_PARAM_TYPE_PKCS05_MAC,      /**< parameter type is pkcs5 message authentication scheme */
48         PKCS_ALGO_PARAM_TYPE_RC2,             /**< parameter type is rc2 cbc */
49         PKCS_ALGO_PARAM_TYPE_UNKOWN = 0xFFFFFFFF  /**< Unknown parameter type */
50 }; //PkcsAlgorithmParameterType;
51
52 /**
53  * @enum        Pkcs08TagValue
54  *
55  * Defines the Asn1 tag type.
56  *
57  * @since 2.1
58  */
59 enum Pkcs08TagValue
60 {
61         PKCS08_TAG_RESERVED = 0, /**< reserved for use by the encoding rules. */
62         PKCS08_TAG_BOOLEAN = 1, /**< an arbitrary bool value. */
63         PKCS08_TAG_INTEGER = 2, /**< an arbitrary integer value. */
64         PKCS08_TAG_BITSTRING = 3, /**< an arbitrary string of bits. */
65         PKCS08_TAG_OCTETSTRING = 4, /**< an arbitrary string of octets. */
66         PKCS08_TAG_NULL = 5, /**< a null value. */
67         PKCS08_TAG_OBJECT_ID = 6, /**< object identifier. */
68         PKCS08_TAG_OBJECT_DES = 7, /**< object descriptor providing a brief description of an object. */
69         PKCS08_TAG_EXTERNAL = 8, /**< an arbitrary external value. */
70         PKCS08_TAG_REAL = 9, /**< an arbitrary real value. */
71         PKCS08_TAG_ENUM = 10, /**< an enumerated value. */
72         PKCS08_TAG_EMBEDDED = 11, /**< an embedded value. */
73         PKCS08_TAG_UTF8STRING = 12, /**< an arbitrary utf8 string. */
74         PKCS08_TAG_REL_OBJ_ID = 13, /**< relative object id. */
75         PKCS08_TAG_SEQUENCE = 16, /**< an ordered collection of one or more types. */
76         PKCS08_TAG_SET = 17, /**< an unordered collection of one or more types. */
77         PKCS08_TAG_CHAR_STRING = 18, /**< numeric string. */
78         PKCS08_TAG_PRINTABLE_STRING = 19, /**< an arbitrary string of printable characters. */
79         PKCS08_TAG_TELETEXT_STRING = 20, /**< teletext string, T61 string. */
80         PKCS08_TAG_VIDEOTEXT_STRING = 21, /**< videotex string. */
81         PKCS08_TAG_IA5STRING = 22, /**< an arbitrary string of IA5 (ASCII) characters.*/
82         PKCS08_TAG_UTC_TIME = 23, /**< a coordinated universal time" or Greenwich Mean Time (GMT) value. */
83         PKCS08_TAG_GEN_TIME = 24, /**< generalized time. */
84         PKCS08_TAG_GRAPHICS_STRING = 25, /**< graphic string. */
85         PKCS08_TAG_VISIBLE_STRING = 26, /**< visible string, ISO64 string. */
86         PKCS08_TAG_GENERAL_STRING = 27, /**< general string. */
87         PKCS08_TAG_UNIVERSAL_STRING = 28, /**< universal string. */
88         PKCS08_TAG_CHARACTER_STRING = 29, /**< an arbitrary character string. */
89         PKCS08_TAG_BMP_STRING = 30, /**< bmp string. */
90         PKCS08_TAG_UNKNOWN = -1 /**< unknown tag type. */
91 }; // Pkcs08TagValue;
92
93 /*
94 -- Basic object identifiers in Pkcs05 and Pkcs08
95 */
96
97 _OSP_EXPORT_ extern const wchar_t OID_PKCS_05[];    /**< object identifier for pkcs05. */
98 _OSP_EXPORT_ extern const wchar_t OID_PBKDF2[];  /**< object identifier for password based key derivation function scheme2. */
99 _OSP_EXPORT_ extern const wchar_t OID_PBES2[];   /**< object identifier for password based encryption scheme2. */
100 _OSP_EXPORT_ extern const wchar_t OID_PBMAC1[];  /**< object identifier for password based message authetication scheme1. */
101 _OSP_EXPORT_ extern const wchar_t OID_HMAC_SHA1[];  /**< object identifier for hmac-sha1. */
102 _OSP_EXPORT_ extern const wchar_t OID_HMAC_SHA2_224[];  /**< object identifier for hmac-sha224. */
103 _OSP_EXPORT_ extern const wchar_t OID_HMAC_SHA2_256[];  /**< object identifier for hmac-sha256. */
104 _OSP_EXPORT_ extern const wchar_t OID_HMAC_SHA2_384[]; /**< object identifier for hmac-sha384. */
105 _OSP_EXPORT_ extern const wchar_t OID_HMAC_SHA2_512[]; /**< object identifier for hmac-sha512. */
106 _OSP_EXPORT_ extern const wchar_t OID_DES_CBC[];  /**< object identifier for des-cbc mode. */
107 _OSP_EXPORT_ extern const wchar_t OID_DES_CBC_EDE3[];   /**< object identifier for des-cbc-ede3 mode. */
108 _OSP_EXPORT_ extern const wchar_t OID_AES_128_CBC[];    /**< object identifier for aes-128-cbc mode. */
109 _OSP_EXPORT_ extern const wchar_t OID_AES_192_CBC[];   /**< object identifier for aes-192-cbc mode. */
110 _OSP_EXPORT_ extern const wchar_t OID_AES_256_CBC[];   /**< object identifier for aes-256-cbc mode. */
111 _OSP_EXPORT_ extern const wchar_t OID_RC2_CBC[];    /**< object identifier for rc2-cbc mode. */
112 _OSP_EXPORT_ extern const wchar_t OID_PKCS_08[];    /**< object identifier for pkcs08. */
113 _OSP_EXPORT_ extern const wchar_t OID_RSA_ENCRYPTION[];   /**< object identifier for rsa encryption scheme. */
114
115
116 /*
117 -- Basic object identifiers in Pkcs08 for AttributeType
118 */
119
120 _OSP_EXPORT_ extern const wchar_t OID_ATTR_NAME[];  /**< object identifier for attribute type name. */
121 _OSP_EXPORT_ extern const wchar_t OID_ATTR_SURNAME[];    /**< object identifier for attribute type surname. */
122 _OSP_EXPORT_ extern const wchar_t OID_ATTR_GIVEN_NAME[]; /**< object identifier for attribute type of any given name. */
123 _OSP_EXPORT_ extern const wchar_t OID_ATTR_INITIAL[];   /**< object identifier for attribute type initial. */
124 _OSP_EXPORT_ extern const wchar_t OID_ATTR_GEN_QUALIFIER[];  /**< object identifier for attribute type generation qualifier. */
125 _OSP_EXPORT_ extern const wchar_t OID_ATTR_COMMON_NAME[]; /**< object identifier for attribute type common name. */
126 _OSP_EXPORT_ extern const wchar_t OID_ATTR_LOCALITY_NAME[];  /**< object identifier for attribute type locality name. */
127 _OSP_EXPORT_ extern const wchar_t OID_ATTR_STATE_OR_PROV_NAME[];   /**< object identifier for attribute type state/province name. */
128 _OSP_EXPORT_ extern const wchar_t OID_ATTR_ORG_NAME[]; /**< object identifier for attribute type of any orgnization name. */
129 _OSP_EXPORT_ extern const wchar_t OID_ATTR_ORG_UNIT_NAME[];    /**< object identifier for any orgnization unit name. */
130 _OSP_EXPORT_ extern const wchar_t OID_ATTR_TITLE[]; /**< object identifier for attribute type title. */
131 _OSP_EXPORT_ extern const wchar_t OID_ATTR_DN_QUALIFIER[];   /**< object identifier for distinguished name qualifier. */
132 _OSP_EXPORT_ extern const wchar_t OID_ATTR_COUNTRY_NAME[];    /**< object identifier for attribute type country name. */
133 _OSP_EXPORT_ extern const wchar_t OID_ATTR_SERIAL_NUMBER[];   /**< object identifier for attribute type serial number. */
134 _OSP_EXPORT_ extern const wchar_t OID_ATTR_PSEUDONYM[]; /**< object identifier for attribute type pseudonym. */
135 _OSP_EXPORT_ extern const wchar_t OID_ATTR_DOMAIN_COMPONENT[]; /**< object identifier for any domain component. */
136 _OSP_EXPORT_ extern const wchar_t OID_ATTR_EMAIL_ADDRESS[];  /**< object identifier for any email address. */
137
138 } } } // Tizen::Security::Pkcs
139
140
141
142
143 #endif // _FSEC_PKCS_TYPES_H_