• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is part of the openHiTLS project.
3  *
4  * openHiTLS is licensed under the Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *
8  *     http://license.coscl.org.cn/MulanPSL2
9  *
10  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13  * See the Mulan PSL v2 for more details.
14  */
15 
16 /**
17  * @defgroup bsl_obj
18  * @ingroup bsl
19  * @brief object module
20  */
21 
22 #ifndef BSL_OBJ_H
23 #define BSL_OBJ_H
24 
25 #include <stdbool.h>
26 #include <stdint.h>
27 #include "bsl_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /**
34  * @ingroup bsl_obj
35  * All algorithm ID
36  */
37 typedef enum {
38     BSL_CID_UNKNOWN = 0,       /**< Unknown alg id */
39 
40     BSL_CID_RC4 = 1,          /* identifies the RC4 algorithm */
41     BSL_CID_DES_ECB = 2,      /* identifies DES algorithm in ECB mode */
42     BSL_CID_DES_CBC = 3,      /* identifies DES algorithm in CBC mode */
43     BSL_CID_DES_OFB = 4,      /* identifies DES algorithm in OFB mode */
44     BSL_CID_DES_CFB = 5,      /* identifies DES algorithm in CFB mode */
45     BSL_CID_SCB2_128_ECB = 6, /* identifies SCB2-128 algorithm in ECB mode */
46     BSL_CID_SCB2_128_CBC = 7, /* identifies SCB2-128 algorithm in CBC mode */
47     BSL_CID_SCB2_256_ECB = 8, /* identifies SCB2-256 algorithm in ECB mode */
48     BSL_CID_SCB2_256_CBC = 9,
49 
50     BSL_CID_DES_EDE_ECB = 10,  /* identifies 2 key triple DES algorithm in ECB mode */
51     BSL_CID_DES_EDE_CBC = 11,  /* identifies 2 key triple DES algorithm in CBC mode */
52     BSL_CID_DES_EDE_OFB = 12,  /* identifies 2 key triple DES algorithm in OFB mode */
53     BSL_CID_DES_EDE_CFB = 13,  /* identifies 2 key triple DES algorithm in CFB mode */
54     BSL_CID_DES_EDE3_ECB = 14, /* identifies 3 key triple DES algorithm in ECB mode */
55     BSL_CID_DES_EDE3_CBC = 15, /* identifies 3 key triple DES algorithm in CBC mode */
56     BSL_CID_DES_EDE3_OFB = 16, /* identifies 3 key triple DES algorithm in OFB mode */
57     BSL_CID_DES_EDE3_CFB = 17, /* identifies 3 key triple DES algorithm in CFB mode */
58     BSL_CID_AES128_ECB = 18,   /* identifies AES-128 algorithm in ECB mode */
59     BSL_CID_AES128_CBC = 19,   /* identifies AES-128 algorithm in CBC mode */
60     BSL_CID_AES128_OFB = 20,   /* identifies AES-128 algorithm in OFB mode */
61     BSL_CID_AES128_CFB = 21,   /* identifies AES-128 algorithm in CFB mode */
62     BSL_CID_AES192_ECB = 22,   /* identifies AES-192 algorithm in ECB mode */
63     BSL_CID_AES192_CBC = 23,   /* identifies AES-192 algorithm in CBC mode */
64     BSL_CID_AES192_OFB = 24,   /* identifies AES-192 algorithm in OFB mode */
65     BSL_CID_AES192_CFB = 25,   /* identifies AES-192 algorithm in CFB mode */
66     BSL_CID_AES256_ECB = 26,   /* identifies AES-256 algorithm in ECB mode */
67     BSL_CID_AES256_CBC = 27,   /* identifies AES-256 algorithm in CBC mode */
68     BSL_CID_AES256_OFB = 28,   /* identifies AES-256 algorithm in OFB mode */
69     BSL_CID_AES256_CFB = 29,   /* identifies AES-256 algorithm in CFB mode */
70     BSL_CID_KASUMI_ECB = 30,   /* identifies Kasumi algorithm in ECB mode */
71     BSL_CID_KASUMI_CBC = 31,   /* identifies Kasumi algorithm in CBC mode */
72     BSL_CID_KASUMI_OFB = 32,   /* identifies Kasumi algorithm in OFB mode */
73     BSL_CID_KASUMI_CFB = 33,   /* identifies Kasumi algorithm in CFB mode */
74     BSL_CID_RSA = 34,          /* identifies the RSA algorithm */
75     BSL_CID_DSA = 35,          /* identifies the DSA algorithm */
76     BSL_CID_ECDSA = 36,        /* identifies the ECDSA algorithm */
77     BSL_CID_ECDSA192 = 37,     /* identifies the ECDSA192 algorithm */
78     BSL_CID_DH = 38,           /* identifies the Diffie-Hellman algorithm */
79     BSL_CID_ECDH = 39,         /* identifies the EC Diffie-Hellman algorithm */
80     BSL_CID_MD5 = 40,          /* identifies the MD5 hash algorithm */
81     BSL_CID_SHA1 = 41,         /* identifies the SHA1 hash algorithm */
82     BSL_CID_SHA224 = 42,       /* identifies the SHA224 hash algorithm */
83     BSL_CID_SHA256 = 43,       /* identifies the SHA256 hash algorithm */
84     BSL_CID_SHA384 = 44,       /* identifies the SHA384 hash algorithm */
85     BSL_CID_SHA512 = 45,       /* identifies the SHA512 hash algorithm */
86     BSL_CID_HMAC_MD5 = 46,     /* identifies hmac with MD5 */
87     BSL_CID_HMAC_SHA1 = 47,    /* identifies hmac with SHA1 */
88     BSL_CID_HMAC_SHA224 = 48,  /* identifies hmac with SHA224 */
89     BSL_CID_HMAC_SHA256 = 49,  /* identifies hmac with SHA256 */
90     BSL_CID_HMAC_SHA384 = 50,  /* identifies hmac with SHA384 */
91     BSL_CID_HMAC_SHA512 = 51,  /* identifies hmac with SHA512 */
92 
93     BSL_CID_MD5WITHRSA = 52,   /* identifies signature using MD5 and RSA */
94     BSL_CID_SHA1WITHRSA = 53,  /* identifies signature using SHA1 and RSA */
95     BSL_CID_SHA1WITHRSAOLD = 54,     /* identifies signature using SHA1 and RSA (coresponds to old Oid) */
96     BSL_CID_DSAWITHSHA1 = 55,        /* identifies signature using SHA1 and DSA */
97     BSL_CID_DSAWITHSHA1_2 = 56,      /* identifies signature using SHA1 and DSA */
98     BSL_CID_ECDSAWITHSHA1 = 57,      /* identifies signature using SHA1 and ECDSA */
99     BSL_CID_ECDSAWITHSHA224 = 58,    /* identifies signature using SHA224 and ECDSA */
100     BSL_CID_ECDSAWITHSHA256 = 59,    /* identifies signature using SHA256 and ECDSA */
101     BSL_CID_ECDSAWITHSHA384 = 60,    /* identifies signature using SHA384 and ECDSA */
102     BSL_CID_ECDSAWITHSHA512 = 61,    /* identifies signature using SHA512 and ECDSA */
103     BSL_CID_ECDSA192WITHSHA256 = 62, /* identifies signature using SHA256 and ECDSA-192 bit */
104 
105     BSL_CID_SHA256WITHRSAENCRYPTION = 63, /* identifies signature using SHA256 and RSA */
106 
107     BSL_CID_SHA384WITHRSAENCRYPTION = 64, /* identifies signature using SHA384 and RSA */
108     BSL_CID_SHA512WITHRSAENCRYPTION = 65, /* identifies signature using SHA512 and RSA */
109 
110     /* RFC 3279 */
111     BSL_CID_KEYEXCHANGEALGORITHM = 66,     /* identifies Key exchange algorithm */
112     BSL_CID_PKCS1 = 67,                    /* identifies PKCS1 */
113     BSL_CID_ANSI_X9_62 = 68,               /* identifies ANSI_X9_62 */
114     BSL_CID_ECSIGTYPE = 69,                /* identifies ECSIGTYPE */
115     BSL_CID_FIELDTYPE = 70,                /* identifies Field Type */
116     BSL_CID_PRIME_FIELD = 71,              /* identifies PRIME Field */
117     BSL_CID_CHARACTERISTIC_TWO_FIELD = 72, /* identifies Characterstic Two field */
118     BSL_CID_CHARACTERISTIC_TWO_BASIS = 73, /* identifies Characterstic Two Basis */
119     BSL_CID_GNBASIS = 74,                  /* identifies GNBASIS */
120     BSL_CID_TPBASIS = 75,                  /* identifies TPBASIS */
121     BSL_CID_PPBASIS = 76,                  /* identifies PPBASIS */
122     BSL_CID_PUBLICKEYTYPE = 77,            /* identifies PUBLICKEYTYPE */
123     BSL_CID_ELLIPTICCURVE = 78,            /* identifies ELLIPTICCURVE */
124     BSL_CID_C_TWOCURVE = 79,               /* identifies C_TWOCURVE */
125     BSL_CID_C2PNB163V1 = 80,               /* identifies C2PNB163V1 */
126     BSL_CID_C2PNB163V2 = 81,               /* identifies C2PNB163V2 */
127     BSL_CID_C2PNB163V3 = 82,               /* identifies C2PNB163V3 */
128     BSL_CID_C2PNB176W1 = 83,               /* identifies C2PNB176W1 */
129     BSL_CID_C2TNB191V1 = 84,               /* identifies C2TNB191V1 */
130     BSL_CID_C2TNB191V2 = 85,               /* identifies C2TNB191V2 */
131     BSL_CID_C2TNB191V3 = 86,               /* identifies C2TNB191V3 */
132     BSL_CID_C2ONB191V4 = 87,               /* identifies C2ONB191V4 */
133     BSL_CID_C2ONB191V5 = 88,               /* identifies C2ONB191V5 */
134     BSL_CID_C2PNB208W1 = 89,               /* identifies C2PNB208W1 */
135     BSL_CID_C2TNB239V1 = 90,               /* identifies C2TNB239V1 */
136     BSL_CID_C2TNB239V2 = 91,               /* identifies C2TNB239V2 */
137     BSL_CID_C2TNB239V3 = 92,               /* identifies C2TNB239V3 */
138     BSL_CID_C2ONB239V4 = 93,               /* identifies C2ONB239V4 */
139     BSL_CID_C2ONB239V5 = 94,               /* identifies C2ONB239V5 */
140     BSL_CID_C2PNB272W1 = 95,               /* identifies C2PNB272W1 */
141     BSL_CID_C2PNB304W1 = 96,               /* identifies C2PNB304W1 */
142     BSL_CID_C2TNB359V1 = 97,               /* identifies C2TNB359V1 */
143     BSL_CID_C2PNB368W1 = 98,               /* identifies C2PNB368W1 */
144     BSL_CID_C2TNB431R1 = 99,               /* identifies C2TNB431R1 */
145     BSL_CID_PRIMECURVE = 100,               /* identifies PRIMECURVE */
146     BSL_CID_PRIME192V1 = 101,               /* identifies PRIME192V1 */
147     BSL_CID_PRIME192V2 = 102,               /* identifies PRIME192V2 */
148     BSL_CID_PRIME192V3 = 103,               /* identifies PRIME192V3 */
149     BSL_CID_PRIME239V1 = 104,               /* identifies PRIME239V1 */
150     BSL_CID_PRIME239V2 = 105,               /* identifies PRIME239V2 */
151     BSL_CID_PRIME239V3 = 106,               /* identifies PRIME239V3 */
152     BSL_CID_PRIME256V1 = 107,               /* identifies PRIME256V1 */
153     /* SCEP */
154     BSL_CID_VERISIGN = 108,       /* identifies VERISIGN */
155     BSL_CID_PKI = 109,            /* identifies PKI */
156     BSL_CID_ATTRIBUTES = 110,     /* identifies ATTRIBUTES */
157     BSL_CID_MESSAGETYPE = 111,    /* identifies MESSAGETYPE */
158     BSL_CID_PKISTATUS = 112,      /* identifies PKISTATUS */
159     BSL_CID_FAILINFO = 113,       /* identifies FAILINFO */
160     BSL_CID_SENDERNONCE = 114,    /* identifies SENDERNONCE */
161     BSL_CID_RECIPIENTNONCE = 115, /* identifies RECIPIENTNONCE */
162     BSL_CID_TRANSID = 116,        /* identifies TRANSID */
163     BSL_CID_EXTENSIONREQ = 117,   /* identifies EXTENSIONREQ */
164     /* PKCS 5 */
165     BSL_CID_RSADSI = 118, /* identifies RSADSI */
166     BSL_CID_PKCS = 119,   /* identifies PKCS */
167     BSL_CID_PKCS5 = 120,  /* identifies PKCS5 */
168     BSL_CID_PBKDF2 = 121, /* identifies PBKDF2 */
169     BSL_CID_PBE_MD2WITHDESCBC  = 122,
170     BSL_CID_PBE_MD2WITHRC2CBC = 123,
171     BSL_CID_PBE_MD5WITHDESCBC = 124, /* identifies PBE_MD5WITHDESCBC */
172     BSL_CID_PBE_MD5WITHRC2CBC = 125,
173     BSL_CID_PBE_SHA1WITHDESCBC = 126, /* identifies PBE_SHA1WITHDESCBC */
174     BSL_CID_PBE_SHA1WITHRC2CBC = 127,
175     BSL_CID_PBES2 = 128,               /* identifies PBES2 */
176     BSL_CID_PBMAC1 = 129,              /* identifies PBMAC1 */
177     BSL_CID_DIGESTALGORITHM = 130,     /* identifies DIGESTALGORITHM */
178     BSL_CID_ENCRYPTIONALGORITHM = 131, /* identifies ENCRYPTIONALGORITHM */
179     BSL_CID_RC2CBC = 132,              /* identifies RC2CBC */
180     BSL_CID_RC5_CBC_PAD = 133,         /* identifies RC5_CBC_PAD */
181     BSL_CID_RSAES_OAEP = 134,          /* from pkcs1 */ /* identifies RSAES_OAEP */
182 
183     /* OCSP */
184     BSL_CID_PKIX_OCSP_BASIC = 135,           /* identifies OCSP_BASIC */
185     BSL_CID_PKIX_OCSP_NONCE = 136,           /* identifies OCSP_NONCE */
186     BSL_CID_PKIX_OCSP_CRL = 137,             /* identifies OCSP_CRL */
187     BSL_CID_PKIX_OCSP_RESPONSE = 138,        /* identifies OCSP_RESPONSE */
188     BSL_CID_PKIX_OCSP_NOCHECK = 139,         /* identifies OCSP_NOCHECK */
189     BSL_CID_PKIX_OCSP_ARCHIVE_CUTOFF = 140,  /* identifies OCSP_ARCHIVE_CUTOFF */
190     BSL_CID_PKIX_OCSP_SERVICE_LOCATOR = 141, /* identifies OCSP_SERVICE_LOCATOR */
191     /* PKCS 10 */
192     BSL_CID_CHALLENGE_PWD_ATTR = 142, /* identifies Challenge PWD Attr */
193     BSL_CID_EXTENSIONREQUEST = 143,   /* identifies EXTENSIONREQUEST */
194     /* FROM PKIXEXPLICIT */
195     BSL_CID_PKIX = 144,                      /* identifies PKIX */
196     BSL_CID_PE = 145,                        /* identifies PE */
197     BSL_CID_QT = 146,                        /* identifies QT */
198     BSL_CID_KP = 147,                        /* identifies KP */
199     BSL_CID_AD = 148,                        /* identifies AD */
200     BSL_CID_QT_CPS = 149,                    /* identifies CPS */
201     BSL_CID_QT_UNOTICE = 150,                /* identifies UNOTICE */
202     BSL_CID_AD_OCSP = 151,                   /* identifies OCSP */
203     BSL_CID_AD_CAISSUERS = 152,              /* identifies CAISSUERS */
204     BSL_CID_AD_TIMESTAMPING = 153,           /* identifies TIMESTAMPING */
205     BSL_CID_AD_CAREPOSITORY = 154,           /* identifies CAREPOSITORY */
206     BSL_CID_AT = 155,                        /* identifies AT */
207     BSL_CID_AT_NAME = 156,                   /* identifies NAME */
208     BSL_CID_AT_SURNAME = 157,                /* identifies SURNAME */
209     BSL_CID_AT_GIVENNAME = 158,              /* identifies GIVENNAME */
210     BSL_CID_AT_INITIALS = 159,               /* identifies INITIALS */
211     BSL_CID_AT_GENERATIONQUALIFIER = 160,    /* identifies GENERATIONQUALIFIER */
212     BSL_CID_AT_COMMONNAME = 161,             /* identifies COMMONNAME */
213     BSL_CID_AT_LOCALITYNAME = 162,           /* identifies LOCALITYNAME */
214     BSL_CID_AT_STATEORPROVINCENAME = 163,    /* identifies STATEORPROVINCENAME */
215     BSL_CID_AT_ORGANIZATIONNAME = 164,       /* identifies ORGANIZATIONNAME */
216     BSL_CID_AT_ORGANIZATIONALUNITNAME = 165, /* identifies ORGANIZATIONALUNITNAME */
217     BSL_CID_AT_TITLE = 166,                  /* identifies TITLE */
218     BSL_CID_AT_DNQUALIFIER = 167,            /* identifies DNQUALIFIER */
219     BSL_CID_AT_COUNTRYNAME = 168,            /* identifies COUNTRYNAME */
220     BSL_CID_AT_SERIALNUMBER = 169,           /* identifies SERIALNUMBER */
221     BSL_CID_AT_PSEUDONYM = 170,              /* identifies PSEUDONYM */
222     BSL_CID_DOMAINCOMPONENT = 171,           /* identifies DOMAINCOMPONENT */
223     BSL_CID_EMAILADDRESS = 172,              /* identifies EMAILADDRESS */
224     /* PKIXIMPLICIT */
225     BSL_CID_CE = 173,                            /* identifies CE */
226     BSL_CID_CE_AUTHORITYKEYIDENTIFIER = 174,     /* identifies AUTHORITYKEYIDENTIFIER */
227     BSL_CID_CE_SUBJECTKEYIDENTIFIER = 175,       /* identifies SUBJECTKEYIDENTIFIER */
228     BSL_CID_CE_KEYUSAGE = 176,                   /* identifies KEYUSAGE */
229     BSL_CID_CE_PRIVATEKEYUSAGEPERIOD = 177,      /* identifies PRIVATEKEYUSAGEPERIOD */
230     BSL_CID_CE_CERTIFICATEPOLICIES = 178,        /* identifies CERTIFICATEPOLICIES */
231     BSL_CID_ANYPOLICY = 179,                     /* identifies ANYPOLICY */
232     BSL_CID_CE_POLICYMAPPINGS = 180,             /* identifies POLICYMAPPINGS */
233     BSL_CID_CE_SUBJECTALTNAME = 181,             /* identifies SUBJECTALTNAME */
234     BSL_CID_CE_ISSUERALTNAME = 182,              /* identifies ISSUERALTNAME */
235     BSL_CID_CE_SUBJECTDIRECTORYATTRIBUTES = 183, /* identifies SUBJECTDIRECTORYATTRIBUTES */
236     BSL_CID_CE_BASICCONSTRAINTS = 184,           /* identifies BASICCONSTRAINTS */
237     BSL_CID_CE_NAMECONSTRAINTS = 185,            /* identifies NAMECONSTRAINTS */
238     BSL_CID_CE_POLICYCONSTRAINTS = 186,          /* identifies POLICYCONSTRAINTS */
239     BSL_CID_CE_CRLDISTRIBUTIONPOINTS = 187,      /* identifies CRLDISTRIBUTIONPOINTS */
240     BSL_CID_CE_EXTKEYUSAGE = 188,                /* identifies EXTKEYUSAGE */
241     BSL_CID_ANYEXTENDEDKEYUSAGE = 189,           /* identifies ANYEXTENDEDKEYUSAGE */
242     BSL_CID_KP_SERVERAUTH = 190,                 /* identifies SERVERAUTH */
243     BSL_CID_KP_CLIENTAUTH = 191,                 /* identifies CLIENTAUTH */
244     BSL_CID_KP_CODESIGNING = 192,                /* identifies CODESIGNING */
245     BSL_CID_KP_EMAILPROTECTION = 193,            /* identifies EMAILPROTECTION */
246     BSL_CID_KP_TIMESTAMPING = 194,               /* identifies TIMESTAMPING */
247     BSL_CID_KP_OCSPSIGNING = 195,                /* identifies OCSPSIGNING */
248     BSL_CID_KP_IPSECIKE = 196,                   /* identifies IPSECIKE */
249     BSL_CID_CE_INHIBITANYPOLICY = 197,           /* identifies INHIBITANYPOLICY */
250     BSL_CID_CE_FRESHESTCRL = 198,                /* identifies FRESHESTCRL */
251     BSL_CID_PE_AUTHORITYINFOACCESS = 199,        /* identifies AUTHORITYINFOACCESS */
252     BSL_CID_PE_SUBJECTINFOACCESS = 200,          /* identifies SUBJECTINFOACCESS */
253     BSL_CID_CE_CRLNUMBER = 201,                  /* identifies CRLNUMBER */
254     BSL_CID_CE_ISSUINGDISTRIBUTIONPOINT = 202,   /* identifies ISSUINGDISTRIBUTIONPOINT */
255     BSL_CID_CE_DELTACRLINDICATOR = 203,          /* identifies DELTACRLINDICATOR */
256     BSL_CID_CE_CRLREASONS = 204,                 /* identifies CRLREASONS */
257     BSL_CID_CE_CERTIFICATEISSUER = 205,          /* identifies CERTIFICATEISSUER */
258     BSL_CID_CE_HOLDINSTRUCTIONCODE = 206,        /* identifies HOLDINSTRUCTIONCODE */
259     BSL_CID_HOLDINSTRUCTION = 207,               /* identifies HOLDINSTRUCTION */
260     BSL_CID_HOLDINSTRUCTION_NONE = 208,          /* identifies HOLDINSTRUCTION_NONE */
261     BSL_CID_HOLDINSTRUCTION_CALLISSUER = 209,    /* identifies HOLDINSTRUCTION_CALLISSUER */
262     BSL_CID_HOLDINSTRUCTION_REJECT = 210,        /* identifies HOLDINSTRUCTION_REJECT */
263     BSL_CID_CE_INVALIDITYDATE = 211,             /* identifies INVALIDITYDATE */
264     BSL_CID_PDA_DATEOFBIRTH = 212,               /* identifies DATEOFBIRTH */
265     BSL_CID_PDA_PLACEOFBIRTH = 213,              /* identifies PLACEOFBIRTH */
266     BSL_CID_PDA_GENDER = 214,                    /* identifies GENDER */
267     BSL_CID_PDA_COUNTRYOFCITIZENSHIP = 215,      /* identifies COUNTRYOFCITIZENSHIP */
268     BSL_CID_PDA_COUNTRYOFRESIDENCE = 216,        /* identifies COUNTRYOFRESIDENCE */
269     BSL_CID_PDA = 217,                           /* identifies PDA */
270     BSL_CID_ON_PERMANENTIDENTIFIER = 218,        /* identifies PERMANENTIDENTIFIER */
271     BSL_CID_ON = 219,                            /* identifies ON */
272     BSL_CID_CE_DOMAININFO = 220,                 /* identifies DOMAININFO */
273     /* CMP */
274     BSL_CID_PASSWORDBASEDMAC = 221, /* identifies PWD Based MAC */
275     BSL_CID_DHBASEDMAC = 222,       /* identifies DH Based MAC */
276     BSL_CID_IT = 223,               /* identifies IT */
277     BSL_CID_CAPROTENCCERT = 224,    /* identifies CAPROTENCCERT */
278     BSL_CID_SIGNKEYPAIRTYPES = 225, /* identifies Sign KeyPair Types */
279     BSL_CID_ENCKEYPAIRTYPES = 226,  /* identifies KeyPair Types */
280     BSL_CID_PREFERREDSYMMALG = 227, /* identifies Preferred Symmetric Algo */
281     BSL_CID_CAKEYUPDATEINFO = 228,  /* identifies CA Key Update Info */
282     BSL_CID_CURRENTCRL = 229,       /* identifies Current CRL */
283     BSL_CID_CONFIRMWAITTIME = 230,  /* identifies ConfirmWaitTime */
284     /* CRMF */
285     BSL_CID_PKIP = 231,                       /* identifies PKIP */
286     BSL_CID_REGCTRL = 232,                    /* identifies REGCTRL */
287     BSL_CID_REGCTRL_REGTOKEN = 233,           /* identifies REGTOKEN */
288     BSL_CID_REGCTRL_AUTHENTICATOR = 234,      /* identifies AUTHENTICATOR */
289     BSL_CID_REGCTRL_PKIPUBLICATIONINFO = 235, /* identifies PKIPUBLICATIONINFO */
290     BSL_CID_REGCTRL_PKIARCHIVEOPTIONS = 236,  /* identifies PKIARCHIVEOPTIONS */
291     BSL_CID_REGCTRL_OLDCERTID = 237,          /* identifies OLDCERTID */
292     BSL_CID_REGCTRL_PROTOCOLENCRKEY = 238,    /* identifies PROTOCOLENCRKEY */
293     BSL_CID_REGINFO = 239,                    /* identifies REGINFO */
294     BSL_CID_REGINFO_UTF8PAIRS = 240,          /* identifies UTF8PAIRS */
295     BSL_CID_REGINFO_CERTREQ = 241,            /* identifies CERTREQ */
296     /* PKCS12 */
297     BSL_CID_PKCS12 = 242,                        /* identifies PKCS12 */
298     BSL_CID_PKCS12PBEIDS = 243,                  /* identifies PKCS12 PBE */
299     BSL_CID_PBE_SHAWITH128BITRC4 = 244,          /* identifies PBE Algo (SHAWITH128BITRC4) */
300     BSL_CID_PBE_SHAWITH40BITRC4 = 245,           /* identifies PBE Algo (SHAWITH40BITRC4) */
301     BSL_CID_PBE_SHAWITH3KEY_TRIPLE_DESCBC = 246, /* identifies PBE Algo (SHAWITH3KEY_TRIPLE_DESCBC) */
302     BSL_CID_PBE_SHAWITH2KEY_TRIPLE_DESCBC = 247, /* identifies PBE Algo (SHAWITH2KEY_TRIPLE_DESCBC) */
303     BSL_CID_PBE_SHAWITH128BIT_RC2CBC = 248,      /* identifies PBE Algo (SHAWITH128BIT_RC2CBC) */
304     BSL_CID_PBE_SHAWITH40BIT_RC2CBC = 249, /* identifies PBE Algo (SHAWITH40BIT_RC2CBC) */
305     BSL_CID_BAGTYPES = 250,                /* identifies Bag Types */
306     BSL_CID_KEYBAG = 251,                  /* identifies Key Bag */
307     BSL_CID_PKCS8SHROUDEDKEYBAG = 252,     /* identifies Bag Types */
308     BSL_CID_CERTBAG = 253,                 /* identifies CERT Bag */
309     BSL_CID_CRLBAG = 254,                  /* identifies CRL Bag */
310     BSL_CID_SECRETBAG = 255,               /* identifies Secret Bag */
311     BSL_CID_SAFECONTENTSBAG = 256,         /* identifies Safe Content Bag */
312     BSL_CID_X509CERTIFICATE = 257,         /* identifies x509 Certificate */
313     BSL_CID_SDSICERTIFICATE = 258,         /* identifies SDSI Certificate */
314     BSL_CID_FRIENDLYNAME = 259,            /* identifies Freidnly Name */
315     BSL_CID_LOCALKEYID = 260,              /* identifies Local Key ID */
316     /* auth_frame */
317     BSL_CID_CERTIFICATEREVOCATIONLIST = 261, /* identifies Certificate Revocation List */
318     /* PKCS7 & 9 */
319     BSL_CID_PKCS7 = 262,                      /* identifies PKCS7 */
320     BSL_CID_PKCS7_SIMPLEDATA = 263,           /* identifies PKCS7 Simple Data */
321     BSL_CID_PKCS7_SIGNEDDATA = 264,           /* identifies PKCS7 Signed Data */
322     BSL_CID_PKCS7_ENVELOPEDDATA = 265,        /* identifies PKCS7 Enveloped Data */
323     BSL_CID_PKCS7_SIGNED_ENVELOPEDDATA = 266, /* identifies PKCS7 Signed Enveloped Data */
324     BSL_CID_PKCS7_DIGESTEDDATA = 267,         /* identifies PKCS7 Degested Data */
325     BSL_CID_PKCS7_ENCRYPTEDDATA = 268,        /* identifies PKCS7 Encrypted Data */
326     BSL_CID_PKCS9 = 269,                      /* identifies PKCS9 */
327     BSL_CID_PKCS9_AT_CONTENTTYPE = 270,       /* identifies PKCS9 Content Type */
328     BSL_CID_PKCS9_AT_MESSAGEDIGEST = 271,     /* identifies PKCS9 Message Digest */
329     BSL_CID_PKCS9_AT_SIGNINGTIME = 272,       /* identifies PKCS9 Signing time */
330     BSL_CID_PKCS9_AT_COUNTERSIGNATURE = 273,  /* identifies PKCS9 Counter Signature */
331     BSL_CID_PKCS9_AT_RANDOMNONCE = 274,       /* identifies PKCS9 Signed Enveloped Data */
332     BSL_CID_PKCS9_AT_SEQUENCENUMBER = 275,    /* identifies PKCS9 Sequence number */
333 
334     BSL_CID_MD4 = 276,       /* identifies MD4 hash algorithm */
335     BSL_CID_HMAC_MD4 = 277,  /* identifies hmac with MD4 */
336     BSL_CID_CMAC_AES = 278,  /* identifies CMAC-AES */
337     BSL_CID_CMAC_TDES = 279, /* identifies CMAC-Triple DES */
338     BSL_CID_RNG_HW = 280,    /* identifies TRNG */
339     BSL_CID_RNG_SW = 281,    /* identifies PRNG */
340     BSL_CID_XCBC_AES = 282,  /* identifies XCBC-MAC-AES */
341     BSL_CID_RC2_ECB = 283,   /* identifies RC2 algorithm in ECB mode */
342     BSL_CID_RC2_CBC = 284,   /* identifies RC2 algorithm in CBC mode */
343     BSL_CID_RC2_OFB = 285,   /* identifies RC2 algorithm in OFB mode */
344     BSL_CID_RC2_CFB = 286,   /* identifies RC2 algorithm in CFB mode */
345 
346     BSL_CID_MD5_SHA1 = 287,
347 
348     BSL_CID_SECP384R1 = 288,         /* identifies NIST prime curve 384 */
349     BSL_CID_SECP521R1 = 289,         /* identifies NIST prime curve 521 */
350     BSL_CID_SM3 = 290,               /* identifies SM3 hash algorithm */
351     BSL_CID_HMAC_SM3 = 291,          /* identifies hmac with SM3 */
352     BSL_CID_SM2DSAWITHSM3 = 292,     /* identifies BSL_CID_SM2DSAWITHSM3 */
353     BSL_CID_SM2DSAWITHSHA1 = 293,    /* identifies BSL_CID_SM2DSAWITHSHA1 */
354     BSL_CID_SM2DSAWITHSHA256 = 294,  /* identifies BSL_CID_SM2DSAWITHSHA256 */
355     BSL_CID_SM2PRIME256 = 295,       /* identifies BSL_CID_PRIME256SM2 */
356     BSL_CID_SM2DSA = 296,            /* identifies SM2 DSA */
357     BSL_CID_SM2KEP = 297,            /* BSL_CID_SM2KEP */
358     BSL_CID_SM2PKEA = 298,           /* BSL_CID_SM2PKEA */
359     BSL_CID_AES128_GCM = 299,        /* Identifies the AES128 algorithm in GCM mode */
360     BSL_CID_AES192_GCM = 300,        /* Identifies the AES128 algorithm in GCM mode */
361     BSL_CID_AES256_GCM = 301,        /* Identifies the AES256 algorithm in GCM mode */
362     BSL_CID_AES128_CTR = 302,        /* Identifies the AES128 algorithm in CTR mode */
363     BSL_CID_AES192_CTR = 303,        /* Identifies the AES128 algorithm in CTR mode */
364     BSL_CID_AES256_CTR = 304,        /* Identifies the AES128 algorithm in CTR mode */
365     BSL_CID_UNSTRUCTURED_NAME = 305, /* identifies unstructuredName */
366     BSL_CID_UNSTRUCTURED_ADDR = 306, /* identifies unstructuredAddress */
367     BSL_CID_BF_ECB = 307,            /* Identifies the Blowfish algorithm in ECB mode */
368     BSL_CID_BF_CBC = 308,            /* Identifies the Blowfish algorithm in CBC mode */
369     BSL_CID_BF_CFB = 309,            /* Identifies the Blowfish algorithm in CFB mode */
370     BSL_CID_BF_OFB = 310,            /* Identifies the Blowfish algorithm in OFB mode */
371     BSL_CID_AES128_CCM = 311,
372     BSL_CID_AES192_CCM = 312,
373     BSL_CID_AES256_CCM = 313,
374 
375     BSL_CID_AT_STREETADDRESS = 314,       /* Identifies the streetAddress in EV certs */
376     BSL_CID_AT_BUSINESSCATEGORY = 315,    /* Identifies the businessCategory in EV certs */
377     BSL_CID_AT_POSTALCODE = 316,          /* Identifies the postalCode in EV certs */
378     BSL_CID_JD_LOCALITYNAME = 317,        /* Identifies the streetAddress in EV certs */
379     BSL_CID_JD_STATEORPROVINCENAME = 318, /* Identifies the jurisdictionLocalityName in EV certs */
380     BSL_CID_JD_COUNTRYNAME = 319,         /* Identifies the jurisdictionCountryName in EV certs */
381     BSL_CID_HMAC_SHA1_DIGEST = 320,
382 
383     BSL_CID_NIST_PRIME224 = 321,  /* NIST Curve P-224 */
384     BSL_CID_NIST_C2PNB163K = 322, /* NIST Binary Curve 163K */
385     BSL_CID_NIST_C2PNB163B = 323, /* NIST Binary Curve 163B */
386     BSL_CID_NIST_C2TNB233K = 324, /* NIST Binary Curve 233K */
387     BSL_CID_NIST_C2TNB233B = 325, /* NIST Binary Curve 233B */
388     BSL_CID_NIST_C2PNB283K = 326, /* NIST Binary Curve 283K */
389     BSL_CID_NIST_C2PNB283B = 327, /* NIST Binary Curve 283B */
390     BSL_CID_NIST_C2TNB409K = 328, /* NIST Binary Curve 409K */
391     BSL_CID_NIST_C2TNB409B = 329, /* NIST Binary Curve 409B */
392     BSL_CID_NIST_C2PNB571K = 330, /* NIST Binary Curve 571K */
393     BSL_CID_NIST_C2PNB571B = 331, /* NIST Binary Curve 571B */
394     BSL_CID_PBE_HMACSHA512WITHAES256_CBC = 332,
395 
396     BSL_CID_CE_SKAE = 333,   /* Identifies SKAE extension */
397     BSL_CID_ED25519 = 334,   /* Identifies ED25519 algorithm */
398     BSL_CID_X25519 = 335,    /* Identifies X25519 algorithm */
399     BSL_CID_RSASSAPSS = 336, /* Identifies RSASSAPSS algorithm */
400     BSL_CID_MGF1 = 337,      /* Identifies MaskGen algorithm */
401 
402     BSL_CID_SCRYPT = 338,    /* Identifieds Scrypt KDF algorithm */
403     BSL_CID_PBES1 = 339,     /* Identifieds PBES1 KDF algorithm */
404     BSL_CID_KDF2 = 340,      /* Identifieds KDF2 KDF algorithm */
405     BSL_CID_DOT16KDF = 341,  /* Identifieds dot16 KDF algorithm */
406 
407     BSL_CID_SM4 = 342,        /* Identifieds SM4 algorithm */
408     BSL_CID_SM4_ECB = 343,    /* Identifieds SM4 ECB algorithm */
409     BSL_CID_SM4_CBC = 344,    /* Identifieds SM4 CBC algorithm */
410     BSL_CID_KWRAP_AES = 345,  /* Identifieds AES KWRAP algorithm */
411     BSL_CID_KWRAP_SM4 = 346,  /* Identifieds SM4 KWRAP algorithm */
412     BSL_CID_CMAC_SM4 = 347,   /* identifies CMAC SM4 */
413 
414     BSL_CID_SM3WITHRSAENCRYPTION = 348,  /* identifies signature using SM3 and RSA */
415     BSL_CID_HARDWAREMODULENAME = 349,
416     BSL_CID_AT_DESCRIPTION = 350,
417 
418     BSL_CID_DECODE_UNKNOWN = 1000,
419     BSL_CID_NULL = 1001,
420 
421     BSL_CID_HMAC_SHA3_224 = 2000,        /* identifies hmac with SHA3_224 */
422     BSL_CID_HMAC_SHA3_256 = 2001,        /* identifies hmac with SHA3_256 */
423     BSL_CID_HMAC_SHA3_384 = 2002,        /* identifies hmac with SHA3_384 */
424     BSL_CID_HMAC_SHA3_512 = 2003,        /* identifies hmac with SHA3_512 */
425 
426     BSL_CID_DSAWITHSHA256 = 2004,        /* identifies signature using SHA256 and DSA */
427     BSL_CID_DSAWITHSHA224 = 2005,        /* identifies signature using SHA224 and DSA */
428     BSL_CID_DSAWITHSHA384 = 2006,        /* identifies signature using SHA384 and DSA */
429     BSL_CID_DSAWITHSHA512 = 2007,        /* identifies signature using SHA512 and DSA */
430     BSL_CID_SHA224WITHRSAENCRYPTION = 2008, /* identifies signature using SHA224 and RSA */
431 
432     BSL_CID_SHA3_224 = 2009,
433     BSL_CID_SHA3_256 = 2010,
434     BSL_CID_SHA3_384 = 2011,
435     BSL_CID_SHA3_512 = 2012,
436     BSL_CID_SHAKE128 = 2013,
437     BSL_CID_SHAKE256 = 2014,
438 
439     BSL_CID_HMAC_MD5_SHA1 = 2015,
440     BSL_CID_CMAC_AES128 = 2016,
441     BSL_CID_CMAC_AES192 = 2017,
442     BSL_CID_CMAC_AES256 = 2018,
443     BSL_CID_GMAC_AES128 = 2019,
444     BSL_CID_GMAC_AES192 = 2020,
445     BSL_CID_GMAC_AES256 = 2021,
446 
447     BSL_CID_AES128_XTS = 2022,
448     BSL_CID_AES256_XTS = 2023,
449     BSL_CID_AES128_WRAP_NOPAD = 2024,
450     BSL_CID_AES192_WRAP_NOPAD = 2025,
451     BSL_CID_AES256_WRAP_NOPAD = 2026,
452     BSL_CID_AES128_WRAP_PAD = 2027,
453     BSL_CID_AES192_WRAP_PAD = 2028,
454     BSL_CID_AES256_WRAP_PAD = 2029,
455     BSL_CID_CHACHA20_POLY1305 = 2030,
456     BSL_CID_SM4_XTS = 2031,
457     BSL_CID_SM4_CTR = 2032,
458     BSL_CID_SM4_GCM = 2033,
459     BSL_CID_SM4_CFB = 2034,
460     BSL_CID_SM4_OFB = 2035,
461 
462     BSL_CID_KDFTLS12 = 2036,
463     BSL_CID_HKDF = 2037,
464 
465     BSL_CID_RAND_SHA1 = 2038,
466     BSL_CID_RAND_SHA224 = 2039,
467     BSL_CID_RAND_SHA256 = 2040,
468     BSL_CID_RAND_SHA384 = 2041,
469     BSL_CID_RAND_SHA512 = 2042,
470     BSL_CID_RAND_SM3 = 2043,
471     BSL_CID_RAND_HMAC_SHA1 = 2044,
472     BSL_CID_RAND_HMAC_SHA224 = 2045,
473     BSL_CID_RAND_HMAC_SHA256 = 2046,
474     BSL_CID_RAND_HMAC_SHA384 = 2047,
475     BSL_CID_RAND_HMAC_SHA512 = 2048,
476     BSL_CID_RAND_AES128_CTR = 2049,
477     BSL_CID_RAND_AES192_CTR = 2050,
478     BSL_CID_RAND_AES256_CTR = 2051,
479     BSL_CID_RAND_AES128_CTR_DF = 2052,
480     BSL_CID_RAND_AES192_CTR_DF = 2053,
481     BSL_CID_RAND_AES256_CTR_DF = 2054,
482     BSL_CID_RAND_SM4_CTR_DF = 2055,
483 
484     BSL_CID_ED448 = 2056,
485     BSL_CID_X448 = 2057,
486 
487     BSL_CID_DH_RFC2409_768 = 2060,
488     BSL_CID_DH_RFC2409_1024 = 2061,
489     BSL_CID_DH_RFC3526_1536 = 2062,
490     BSL_CID_DH_RFC3526_2048 = 2063,
491     BSL_CID_DH_RFC3526_3072 = 2064,
492     BSL_CID_DH_RFC3526_4096 = 2065,
493     BSL_CID_DH_RFC3526_6144 = 2066,
494     BSL_CID_DH_RFC3526_8192 = 2067,
495     BSL_CID_DH_RFC7919_2048 = 2068,
496     BSL_CID_DH_RFC7919_3072 = 2069,
497     BSL_CID_DH_RFC7919_4096 = 2070,
498     BSL_CID_DH_RFC7919_6144 = 2071,
499     BSL_CID_DH_RFC7919_8192 = 2072,
500     BSL_CID_ECC_BRAINPOOLP256R1 = 2073,
501     BSL_CID_ECC_BRAINPOOLP384R1 = 2074,
502     BSL_CID_ECC_BRAINPOOLP512R1 = 2075,
503     BSL_CID_SIPHASH64 = 2076,
504     BSL_CID_SIPHASH128 = 2077,
505 
506     // Netscape
507     BSL_CID_NETSCAPE = 2078,
508     BSL_CID_NS_CERTEXT = 2079,
509     BSL_CID_NS_DATATYPE = 2080,
510     BSL_CID_NS_CERTTYPE = 2081,
511     BSL_CID_NS_BASEURL = 2082,
512     BSL_CID_NS_REVOCATIOPNURL = 2083,
513     BSL_CID_NS_CAREVOCATIONURL = 2084,
514     BSL_CID_NS_RENEWALURL = 2085,
515     BSL_CID_NS_CAPOLICYURL = 2086,
516     BSL_CID_NS_SSLSERVERNAME = 2087,
517     BSL_CID_NS_COMMENT = 2088,
518     BSL_CID_NS_CERTSEQUENCE = 2089,
519     BSL_CID_NS_SGC = 2090,
520 
521     BSL_CID_EC192WAPI = 2091,
522     BSL_CID_CBC_MAC_SM4 = 2092,
523     BSL_CID_EC_PUBLICKEY = 2093,  /* identifies EC_PUBLICKEY */
524 
525     BSL_CID_AT_USERID = 2094,
526 
527     BSL_CID_PKCS7_CONTENTINFO = 2095,
528     BSL_CID_PKCS12KDF = 2096,
529 
530     BSL_CID_ML_KEM = 2100,
531     BSL_CID_ML_DSA = 2101,
532     BSL_CID_HYBRID_KEM = 2102,
533     BSL_CID_X25519_MLKEM512 = 2103,
534     BSL_CID_X25519_MLKEM768 = 2104,
535     BSL_CID_X25519_MLKEM1024 = 2105,
536     BSL_CID_X448_MLKEM512 = 2106,
537     BSL_CID_X448_MLKEM768 = 2107,
538     BSL_CID_X448_MLKEM1024 = 2108,
539     BSL_CID_ECDH_NISTP256_MLKEM512 = 2109,
540     BSL_CID_ECDH_NISTP256_MLKEM768 = 2110,
541     BSL_CID_ECDH_NISTP256_MLKEM1024 = 2111,
542     BSL_CID_ECDH_NISTP384_MLKEM512 = 2112,
543     BSL_CID_ECDH_NISTP384_MLKEM768 = 2113,
544     BSL_CID_ECDH_NISTP384_MLKEM1024 = 2114,
545     BSL_CID_ECDH_NISTP521_MLKEM512 = 2115,
546     BSL_CID_ECDH_NISTP521_MLKEM768 = 2116,
547     BSL_CID_ECDH_NISTP521_MLKEM1024 = 2117,
548 
549     BSL_CID_SM9 = 5201,
550     BSL_CID_ECC_SM9 = 5202,
551     BSL_CID_PAILLIER = 5203,
552     BSL_CID_ELGAMAL = 5204,
553     BSL_CID_SLH_DSA = 5205,         /**< Identifies SLH-DSA algorithm */
554 
555     BSL_CID_MAC_AEAD = 5300,
556 
557     BSL_CID_AES128_CCM8,
558     BSL_CID_AES256_CCM8,
559 
560     BSL_CID_MAX,
561     BSL_CID_EXTEND = 0x60000000,
562 } BslCid;
563 
564 typedef struct {
565     uint32_t octetLen;
566     char *octs;
567     uint32_t flags;
568 } BslOidString;
569 
570 /**
571  * @ingroup bsl_obj
572  * @brief Create an object identifier mapping
573  * @param[in] octs The octs buff for octets
574  * @param[in] octetLen The length of the octs buff
575  * @param[in] oidName The name of the object identifier
576  * @param[in] cid The algorithm ID to map to
577  * @return HITLS_OK on success, error code on failure
578  */
579 int32_t BSL_OBJ_Create(char *octs, uint32_t octetLen, const char *oidName, int32_t cid);
580 
581 
582 /**
583  * @ingroup bsl_obj
584  * @brief Create a signature algorithm ID mapping
585  * @param[in] signId The signature algorithm ID
586  * @param[in] asymId The asymmetric algorithm ID
587  * @param[in] hashId The hash algorithm ID
588  * @return HITLS_OK on success, error code on failure
589  */
590 int32_t BSL_OBJ_CreateSignId(int32_t signId, int32_t asymId, int32_t hashId);
591 
592 /**
593  * @ingroup bsl_obj
594  * @brief Get the object identifier string from the algorithm ID
595  * @param[in] inputCid The algorithm ID
596  * @return The object identifier string
597  */
598 BslOidString *BSL_OBJ_GetOID(BslCid ulCID);
599 
600 /**
601  * @ingroup bsl_obj
602  * @brief Get the algorithm ID from the object identifier string
603  * @param[in] oid The object identifier string
604  * @return The algorithm ID
605  */
606 BslCid BSL_OBJ_GetCID(const BslOidString *oidStr);
607 
608 #ifdef __cplusplus
609 }
610 #endif
611 
612 #endif // BSL_OBJ_H
613