LTKCPP-- LLRP Toolkit C Plus Plus Library
objects.h
00001 /* crypto/objects/objects.h */
00002 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
00003  * All rights reserved.
00004  *
00005  * This package is an SSL implementation written
00006  * by Eric Young (eay@cryptsoft.com).
00007  * The implementation was written so as to conform with Netscapes SSL.
00008  *
00009  * This library is free for commercial and non-commercial use as long as
00010  * the following conditions are aheared to.  The following conditions
00011  * apply to all code found in this distribution, be it the RC4, RSA,
00012  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
00013  * included with this distribution is covered by the same copyright terms
00014  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
00015  *
00016  * Copyright remains Eric Young's, and as such any Copyright notices in
00017  * the code are not to be removed.
00018  * If this package is used in a product, Eric Young should be given attribution
00019  * as the author of the parts of the library used.
00020  * This can be in the form of a textual message at program startup or
00021  * in documentation (online or textual) provided with the package.
00022  *
00023  * Redistribution and use in source and binary forms, with or without
00024  * modification, are permitted provided that the following conditions
00025  * are met:
00026  * 1. Redistributions of source code must retain the copyright
00027  *    notice, this list of conditions and the following disclaimer.
00028  * 2. Redistributions in binary form must reproduce the above copyright
00029  *    notice, this list of conditions and the following disclaimer in the
00030  *    documentation and/or other materials provided with the distribution.
00031  * 3. All advertising materials mentioning features or use of this software
00032  *    must display the following acknowledgement:
00033  *    "This product includes cryptographic software written by
00034  *     Eric Young (eay@cryptsoft.com)"
00035  *    The word 'cryptographic' can be left out if the rouines from the library
00036  *    being used are not cryptographic related :-).
00037  * 4. If you include any Windows specific code (or a derivative thereof) from
00038  *    the apps directory (application code) you must include an acknowledgement:
00039  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
00040  *
00041  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
00042  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00043  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00044  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00045  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00046  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00047  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00048  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00049  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00050  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00051  * SUCH DAMAGE.
00052  *
00053  * The licence and distribution terms for any publically available version or
00054  * derivative of this code cannot be changed.  i.e. this code cannot simply be
00055  * copied and put under another distribution licence
00056  * [including the GNU Public Licence.]
00057  */
00058 
00059 #ifndef HEADER_OBJECTS_H
00060 # define HEADER_OBJECTS_H
00061 
00062 # define USE_OBJ_MAC
00063 
00064 # ifdef USE_OBJ_MAC
00065 #  include <openssl/obj_mac.h>
00066 # else
00067 #  define SN_undef                        "UNDEF"
00068 #  define LN_undef                        "undefined"
00069 #  define NID_undef                       0
00070 #  define OBJ_undef                       0L
00071 
00072 #  define SN_Algorithm                    "Algorithm"
00073 #  define LN_algorithm                    "algorithm"
00074 #  define NID_algorithm                   38
00075 #  define OBJ_algorithm                   1L,3L,14L,3L,2L
00076 
00077 #  define LN_rsadsi                       "rsadsi"
00078 #  define NID_rsadsi                      1
00079 #  define OBJ_rsadsi                      1L,2L,840L,113549L
00080 
00081 #  define LN_pkcs                         "pkcs"
00082 #  define NID_pkcs                        2
00083 #  define OBJ_pkcs                        OBJ_rsadsi,1L
00084 
00085 #  define SN_md2                          "MD2"
00086 #  define LN_md2                          "md2"
00087 #  define NID_md2                         3
00088 #  define OBJ_md2                         OBJ_rsadsi,2L,2L
00089 
00090 #  define SN_md5                          "MD5"
00091 #  define LN_md5                          "md5"
00092 #  define NID_md5                         4
00093 #  define OBJ_md5                         OBJ_rsadsi,2L,5L
00094 
00095 #  define SN_rc4                          "RC4"
00096 #  define LN_rc4                          "rc4"
00097 #  define NID_rc4                         5
00098 #  define OBJ_rc4                         OBJ_rsadsi,3L,4L
00099 
00100 #  define LN_rsaEncryption                "rsaEncryption"
00101 #  define NID_rsaEncryption               6
00102 #  define OBJ_rsaEncryption               OBJ_pkcs,1L,1L
00103 
00104 #  define SN_md2WithRSAEncryption         "RSA-MD2"
00105 #  define LN_md2WithRSAEncryption         "md2WithRSAEncryption"
00106 #  define NID_md2WithRSAEncryption        7
00107 #  define OBJ_md2WithRSAEncryption        OBJ_pkcs,1L,2L
00108 
00109 #  define SN_md5WithRSAEncryption         "RSA-MD5"
00110 #  define LN_md5WithRSAEncryption         "md5WithRSAEncryption"
00111 #  define NID_md5WithRSAEncryption        8
00112 #  define OBJ_md5WithRSAEncryption        OBJ_pkcs,1L,4L
00113 
00114 #  define SN_pbeWithMD2AndDES_CBC         "PBE-MD2-DES"
00115 #  define LN_pbeWithMD2AndDES_CBC         "pbeWithMD2AndDES-CBC"
00116 #  define NID_pbeWithMD2AndDES_CBC        9
00117 #  define OBJ_pbeWithMD2AndDES_CBC        OBJ_pkcs,5L,1L
00118 
00119 #  define SN_pbeWithMD5AndDES_CBC         "PBE-MD5-DES"
00120 #  define LN_pbeWithMD5AndDES_CBC         "pbeWithMD5AndDES-CBC"
00121 #  define NID_pbeWithMD5AndDES_CBC        10
00122 #  define OBJ_pbeWithMD5AndDES_CBC        OBJ_pkcs,5L,3L
00123 
00124 #  define LN_X500                         "X500"
00125 #  define NID_X500                        11
00126 #  define OBJ_X500                        2L,5L
00127 
00128 #  define LN_X509                         "X509"
00129 #  define NID_X509                        12
00130 #  define OBJ_X509                        OBJ_X500,4L
00131 
00132 #  define SN_commonName                   "CN"
00133 #  define LN_commonName                   "commonName"
00134 #  define NID_commonName                  13
00135 #  define OBJ_commonName                  OBJ_X509,3L
00136 
00137 #  define SN_countryName                  "C"
00138 #  define LN_countryName                  "countryName"
00139 #  define NID_countryName                 14
00140 #  define OBJ_countryName                 OBJ_X509,6L
00141 
00142 #  define SN_localityName                 "L"
00143 #  define LN_localityName                 "localityName"
00144 #  define NID_localityName                15
00145 #  define OBJ_localityName                OBJ_X509,7L
00146 
00147 /* Postal Address? PA */
00148 
00149 /* should be "ST" (rfc1327) but MS uses 'S' */
00150 #  define SN_stateOrProvinceName          "ST"
00151 #  define LN_stateOrProvinceName          "stateOrProvinceName"
00152 #  define NID_stateOrProvinceName         16
00153 #  define OBJ_stateOrProvinceName         OBJ_X509,8L
00154 
00155 #  define SN_organizationName             "O"
00156 #  define LN_organizationName             "organizationName"
00157 #  define NID_organizationName            17
00158 #  define OBJ_organizationName            OBJ_X509,10L
00159 
00160 #  define SN_organizationalUnitName       "OU"
00161 #  define LN_organizationalUnitName       "organizationalUnitName"
00162 #  define NID_organizationalUnitName      18
00163 #  define OBJ_organizationalUnitName      OBJ_X509,11L
00164 
00165 #  define SN_rsa                          "RSA"
00166 #  define LN_rsa                          "rsa"
00167 #  define NID_rsa                         19
00168 #  define OBJ_rsa                         OBJ_X500,8L,1L,1L
00169 
00170 #  define LN_pkcs7                        "pkcs7"
00171 #  define NID_pkcs7                       20
00172 #  define OBJ_pkcs7                       OBJ_pkcs,7L
00173 
00174 #  define LN_pkcs7_data                   "pkcs7-data"
00175 #  define NID_pkcs7_data                  21
00176 #  define OBJ_pkcs7_data                  OBJ_pkcs7,1L
00177 
00178 #  define LN_pkcs7_signed                 "pkcs7-signedData"
00179 #  define NID_pkcs7_signed                22
00180 #  define OBJ_pkcs7_signed                OBJ_pkcs7,2L
00181 
00182 #  define LN_pkcs7_enveloped              "pkcs7-envelopedData"
00183 #  define NID_pkcs7_enveloped             23
00184 #  define OBJ_pkcs7_enveloped             OBJ_pkcs7,3L
00185 
00186 #  define LN_pkcs7_signedAndEnveloped     "pkcs7-signedAndEnvelopedData"
00187 #  define NID_pkcs7_signedAndEnveloped    24
00188 #  define OBJ_pkcs7_signedAndEnveloped    OBJ_pkcs7,4L
00189 
00190 #  define LN_pkcs7_digest                 "pkcs7-digestData"
00191 #  define NID_pkcs7_digest                25
00192 #  define OBJ_pkcs7_digest                OBJ_pkcs7,5L
00193 
00194 #  define LN_pkcs7_encrypted              "pkcs7-encryptedData"
00195 #  define NID_pkcs7_encrypted             26
00196 #  define OBJ_pkcs7_encrypted             OBJ_pkcs7,6L
00197 
00198 #  define LN_pkcs3                        "pkcs3"
00199 #  define NID_pkcs3                       27
00200 #  define OBJ_pkcs3                       OBJ_pkcs,3L
00201 
00202 #  define LN_dhKeyAgreement               "dhKeyAgreement"
00203 #  define NID_dhKeyAgreement              28
00204 #  define OBJ_dhKeyAgreement              OBJ_pkcs3,1L
00205 
00206 #  define SN_des_ecb                      "DES-ECB"
00207 #  define LN_des_ecb                      "des-ecb"
00208 #  define NID_des_ecb                     29
00209 #  define OBJ_des_ecb                     OBJ_algorithm,6L
00210 
00211 #  define SN_des_cfb64                    "DES-CFB"
00212 #  define LN_des_cfb64                    "des-cfb"
00213 #  define NID_des_cfb64                   30
00214 /* IV + num */
00215 #  define OBJ_des_cfb64                   OBJ_algorithm,9L
00216 
00217 #  define SN_des_cbc                      "DES-CBC"
00218 #  define LN_des_cbc                      "des-cbc"
00219 #  define NID_des_cbc                     31
00220 /* IV */
00221 #  define OBJ_des_cbc                     OBJ_algorithm,7L
00222 
00223 #  define SN_des_ede                      "DES-EDE"
00224 #  define LN_des_ede                      "des-ede"
00225 #  define NID_des_ede                     32
00226 /* ?? */
00227 #  define OBJ_des_ede                     OBJ_algorithm,17L
00228 
00229 #  define SN_des_ede3                     "DES-EDE3"
00230 #  define LN_des_ede3                     "des-ede3"
00231 #  define NID_des_ede3                    33
00232 
00233 #  define SN_idea_cbc                     "IDEA-CBC"
00234 #  define LN_idea_cbc                     "idea-cbc"
00235 #  define NID_idea_cbc                    34
00236 #  define OBJ_idea_cbc                    1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
00237 
00238 #  define SN_idea_cfb64                   "IDEA-CFB"
00239 #  define LN_idea_cfb64                   "idea-cfb"
00240 #  define NID_idea_cfb64                  35
00241 
00242 #  define SN_idea_ecb                     "IDEA-ECB"
00243 #  define LN_idea_ecb                     "idea-ecb"
00244 #  define NID_idea_ecb                    36
00245 
00246 #  define SN_rc2_cbc                      "RC2-CBC"
00247 #  define LN_rc2_cbc                      "rc2-cbc"
00248 #  define NID_rc2_cbc                     37
00249 #  define OBJ_rc2_cbc                     OBJ_rsadsi,3L,2L
00250 
00251 #  define SN_rc2_ecb                      "RC2-ECB"
00252 #  define LN_rc2_ecb                      "rc2-ecb"
00253 #  define NID_rc2_ecb                     38
00254 
00255 #  define SN_rc2_cfb64                    "RC2-CFB"
00256 #  define LN_rc2_cfb64                    "rc2-cfb"
00257 #  define NID_rc2_cfb64                   39
00258 
00259 #  define SN_rc2_ofb64                    "RC2-OFB"
00260 #  define LN_rc2_ofb64                    "rc2-ofb"
00261 #  define NID_rc2_ofb64                   40
00262 
00263 #  define SN_sha                          "SHA"
00264 #  define LN_sha                          "sha"
00265 #  define NID_sha                         41
00266 #  define OBJ_sha                         OBJ_algorithm,18L
00267 
00268 #  define SN_shaWithRSAEncryption         "RSA-SHA"
00269 #  define LN_shaWithRSAEncryption         "shaWithRSAEncryption"
00270 #  define NID_shaWithRSAEncryption        42
00271 #  define OBJ_shaWithRSAEncryption        OBJ_algorithm,15L
00272 
00273 #  define SN_des_ede_cbc                  "DES-EDE-CBC"
00274 #  define LN_des_ede_cbc                  "des-ede-cbc"
00275 #  define NID_des_ede_cbc                 43
00276 
00277 #  define SN_des_ede3_cbc                 "DES-EDE3-CBC"
00278 #  define LN_des_ede3_cbc                 "des-ede3-cbc"
00279 #  define NID_des_ede3_cbc                44
00280 #  define OBJ_des_ede3_cbc                OBJ_rsadsi,3L,7L
00281 
00282 #  define SN_des_ofb64                    "DES-OFB"
00283 #  define LN_des_ofb64                    "des-ofb"
00284 #  define NID_des_ofb64                   45
00285 #  define OBJ_des_ofb64                   OBJ_algorithm,8L
00286 
00287 #  define SN_idea_ofb64                   "IDEA-OFB"
00288 #  define LN_idea_ofb64                   "idea-ofb"
00289 #  define NID_idea_ofb64                  46
00290 
00291 #  define LN_pkcs9                        "pkcs9"
00292 #  define NID_pkcs9                       47
00293 #  define OBJ_pkcs9                       OBJ_pkcs,9L
00294 
00295 #  define SN_pkcs9_emailAddress           "Email"
00296 #  define LN_pkcs9_emailAddress           "emailAddress"
00297 #  define NID_pkcs9_emailAddress          48
00298 #  define OBJ_pkcs9_emailAddress          OBJ_pkcs9,1L
00299 
00300 #  define LN_pkcs9_unstructuredName       "unstructuredName"
00301 #  define NID_pkcs9_unstructuredName      49
00302 #  define OBJ_pkcs9_unstructuredName      OBJ_pkcs9,2L
00303 
00304 #  define LN_pkcs9_contentType            "contentType"
00305 #  define NID_pkcs9_contentType           50
00306 #  define OBJ_pkcs9_contentType           OBJ_pkcs9,3L
00307 
00308 #  define LN_pkcs9_messageDigest          "messageDigest"
00309 #  define NID_pkcs9_messageDigest         51
00310 #  define OBJ_pkcs9_messageDigest         OBJ_pkcs9,4L
00311 
00312 #  define LN_pkcs9_signingTime            "signingTime"
00313 #  define NID_pkcs9_signingTime           52
00314 #  define OBJ_pkcs9_signingTime           OBJ_pkcs9,5L
00315 
00316 #  define LN_pkcs9_countersignature       "countersignature"
00317 #  define NID_pkcs9_countersignature      53
00318 #  define OBJ_pkcs9_countersignature      OBJ_pkcs9,6L
00319 
00320 #  define LN_pkcs9_challengePassword      "challengePassword"
00321 #  define NID_pkcs9_challengePassword     54
00322 #  define OBJ_pkcs9_challengePassword     OBJ_pkcs9,7L
00323 
00324 #  define LN_pkcs9_unstructuredAddress    "unstructuredAddress"
00325 #  define NID_pkcs9_unstructuredAddress   55
00326 #  define OBJ_pkcs9_unstructuredAddress   OBJ_pkcs9,8L
00327 
00328 #  define LN_pkcs9_extCertAttributes      "extendedCertificateAttributes"
00329 #  define NID_pkcs9_extCertAttributes     56
00330 #  define OBJ_pkcs9_extCertAttributes     OBJ_pkcs9,9L
00331 
00332 #  define SN_netscape                     "Netscape"
00333 #  define LN_netscape                     "Netscape Communications Corp."
00334 #  define NID_netscape                    57
00335 #  define OBJ_netscape                    2L,16L,840L,1L,113730L
00336 
00337 #  define SN_netscape_cert_extension      "nsCertExt"
00338 #  define LN_netscape_cert_extension      "Netscape Certificate Extension"
00339 #  define NID_netscape_cert_extension     58
00340 #  define OBJ_netscape_cert_extension     OBJ_netscape,1L
00341 
00342 #  define SN_netscape_data_type           "nsDataType"
00343 #  define LN_netscape_data_type           "Netscape Data Type"
00344 #  define NID_netscape_data_type          59
00345 #  define OBJ_netscape_data_type          OBJ_netscape,2L
00346 
00347 #  define SN_des_ede_cfb64                "DES-EDE-CFB"
00348 #  define LN_des_ede_cfb64                "des-ede-cfb"
00349 #  define NID_des_ede_cfb64               60
00350 
00351 #  define SN_des_ede3_cfb64               "DES-EDE3-CFB"
00352 #  define LN_des_ede3_cfb64               "des-ede3-cfb"
00353 #  define NID_des_ede3_cfb64              61
00354 
00355 #  define SN_des_ede_ofb64                "DES-EDE-OFB"
00356 #  define LN_des_ede_ofb64                "des-ede-ofb"
00357 #  define NID_des_ede_ofb64               62
00358 
00359 #  define SN_des_ede3_ofb64               "DES-EDE3-OFB"
00360 #  define LN_des_ede3_ofb64               "des-ede3-ofb"
00361 #  define NID_des_ede3_ofb64              63
00362 
00363 /* I'm not sure about the object ID */
00364 #  define SN_sha1                         "SHA1"
00365 #  define LN_sha1                         "sha1"
00366 #  define NID_sha1                        64
00367 #  define OBJ_sha1                        OBJ_algorithm,26L
00368 /* 28 Jun 1996 - eay */
00369 /* #define OBJ_sha1                     1L,3L,14L,2L,26L,05L <- wrong */
00370 
00371 #  define SN_sha1WithRSAEncryption        "RSA-SHA1"
00372 #  define LN_sha1WithRSAEncryption        "sha1WithRSAEncryption"
00373 #  define NID_sha1WithRSAEncryption       65
00374 #  define OBJ_sha1WithRSAEncryption       OBJ_pkcs,1L,5L
00375 
00376 #  define SN_dsaWithSHA                   "DSA-SHA"
00377 #  define LN_dsaWithSHA                   "dsaWithSHA"
00378 #  define NID_dsaWithSHA                  66
00379 #  define OBJ_dsaWithSHA                  OBJ_algorithm,13L
00380 
00381 #  define SN_dsa_2                        "DSA-old"
00382 #  define LN_dsa_2                        "dsaEncryption-old"
00383 #  define NID_dsa_2                       67
00384 #  define OBJ_dsa_2                       OBJ_algorithm,12L
00385 
00386 /* proposed by microsoft to RSA */
00387 #  define SN_pbeWithSHA1AndRC2_CBC        "PBE-SHA1-RC2-64"
00388 #  define LN_pbeWithSHA1AndRC2_CBC        "pbeWithSHA1AndRC2-CBC"
00389 #  define NID_pbeWithSHA1AndRC2_CBC       68
00390 #  define OBJ_pbeWithSHA1AndRC2_CBC       OBJ_pkcs,5L,11L
00391 
00392 /*
00393  * proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now defined
00394  * explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something completely
00395  * different.
00396  */
00397 #  define LN_id_pbkdf2                    "PBKDF2"
00398 #  define NID_id_pbkdf2                   69
00399 #  define OBJ_id_pbkdf2                   OBJ_pkcs,5L,12L
00400 
00401 #  define SN_dsaWithSHA1_2                "DSA-SHA1-old"
00402 #  define LN_dsaWithSHA1_2                "dsaWithSHA1-old"
00403 #  define NID_dsaWithSHA1_2               70
00404 /* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */
00405 #  define OBJ_dsaWithSHA1_2               OBJ_algorithm,27L
00406 
00407 #  define SN_netscape_cert_type           "nsCertType"
00408 #  define LN_netscape_cert_type           "Netscape Cert Type"
00409 #  define NID_netscape_cert_type          71
00410 #  define OBJ_netscape_cert_type          OBJ_netscape_cert_extension,1L
00411 
00412 #  define SN_netscape_base_url            "nsBaseUrl"
00413 #  define LN_netscape_base_url            "Netscape Base Url"
00414 #  define NID_netscape_base_url           72
00415 #  define OBJ_netscape_base_url           OBJ_netscape_cert_extension,2L
00416 
00417 #  define SN_netscape_revocation_url      "nsRevocationUrl"
00418 #  define LN_netscape_revocation_url      "Netscape Revocation Url"
00419 #  define NID_netscape_revocation_url     73
00420 #  define OBJ_netscape_revocation_url     OBJ_netscape_cert_extension,3L
00421 
00422 #  define SN_netscape_ca_revocation_url   "nsCaRevocationUrl"
00423 #  define LN_netscape_ca_revocation_url   "Netscape CA Revocation Url"
00424 #  define NID_netscape_ca_revocation_url  74
00425 #  define OBJ_netscape_ca_revocation_url  OBJ_netscape_cert_extension,4L
00426 
00427 #  define SN_netscape_renewal_url         "nsRenewalUrl"
00428 #  define LN_netscape_renewal_url         "Netscape Renewal Url"
00429 #  define NID_netscape_renewal_url        75
00430 #  define OBJ_netscape_renewal_url        OBJ_netscape_cert_extension,7L
00431 
00432 #  define SN_netscape_ca_policy_url       "nsCaPolicyUrl"
00433 #  define LN_netscape_ca_policy_url       "Netscape CA Policy Url"
00434 #  define NID_netscape_ca_policy_url      76
00435 #  define OBJ_netscape_ca_policy_url      OBJ_netscape_cert_extension,8L
00436 
00437 #  define SN_netscape_ssl_server_name     "nsSslServerName"
00438 #  define LN_netscape_ssl_server_name     "Netscape SSL Server Name"
00439 #  define NID_netscape_ssl_server_name    77
00440 #  define OBJ_netscape_ssl_server_name    OBJ_netscape_cert_extension,12L
00441 
00442 #  define SN_netscape_comment             "nsComment"
00443 #  define LN_netscape_comment             "Netscape Comment"
00444 #  define NID_netscape_comment            78
00445 #  define OBJ_netscape_comment            OBJ_netscape_cert_extension,13L
00446 
00447 #  define SN_netscape_cert_sequence       "nsCertSequence"
00448 #  define LN_netscape_cert_sequence       "Netscape Certificate Sequence"
00449 #  define NID_netscape_cert_sequence      79
00450 #  define OBJ_netscape_cert_sequence      OBJ_netscape_data_type,5L
00451 
00452 #  define SN_desx_cbc                     "DESX-CBC"
00453 #  define LN_desx_cbc                     "desx-cbc"
00454 #  define NID_desx_cbc                    80
00455 
00456 #  define SN_id_ce                        "id-ce"
00457 #  define NID_id_ce                       81
00458 #  define OBJ_id_ce                       2L,5L,29L
00459 
00460 #  define SN_subject_key_identifier       "subjectKeyIdentifier"
00461 #  define LN_subject_key_identifier       "X509v3 Subject Key Identifier"
00462 #  define NID_subject_key_identifier      82
00463 #  define OBJ_subject_key_identifier      OBJ_id_ce,14L
00464 
00465 #  define SN_key_usage                    "keyUsage"
00466 #  define LN_key_usage                    "X509v3 Key Usage"
00467 #  define NID_key_usage                   83
00468 #  define OBJ_key_usage                   OBJ_id_ce,15L
00469 
00470 #  define SN_private_key_usage_period     "privateKeyUsagePeriod"
00471 #  define LN_private_key_usage_period     "X509v3 Private Key Usage Period"
00472 #  define NID_private_key_usage_period    84
00473 #  define OBJ_private_key_usage_period    OBJ_id_ce,16L
00474 
00475 #  define SN_subject_alt_name             "subjectAltName"
00476 #  define LN_subject_alt_name             "X509v3 Subject Alternative Name"
00477 #  define NID_subject_alt_name            85
00478 #  define OBJ_subject_alt_name            OBJ_id_ce,17L
00479 
00480 #  define SN_issuer_alt_name              "issuerAltName"
00481 #  define LN_issuer_alt_name              "X509v3 Issuer Alternative Name"
00482 #  define NID_issuer_alt_name             86
00483 #  define OBJ_issuer_alt_name             OBJ_id_ce,18L
00484 
00485 #  define SN_basic_constraints            "basicConstraints"
00486 #  define LN_basic_constraints            "X509v3 Basic Constraints"
00487 #  define NID_basic_constraints           87
00488 #  define OBJ_basic_constraints           OBJ_id_ce,19L
00489 
00490 #  define SN_crl_number                   "crlNumber"
00491 #  define LN_crl_number                   "X509v3 CRL Number"
00492 #  define NID_crl_number                  88
00493 #  define OBJ_crl_number                  OBJ_id_ce,20L
00494 
00495 #  define SN_certificate_policies         "certificatePolicies"
00496 #  define LN_certificate_policies         "X509v3 Certificate Policies"
00497 #  define NID_certificate_policies        89
00498 #  define OBJ_certificate_policies        OBJ_id_ce,32L
00499 
00500 #  define SN_authority_key_identifier     "authorityKeyIdentifier"
00501 #  define LN_authority_key_identifier     "X509v3 Authority Key Identifier"
00502 #  define NID_authority_key_identifier    90
00503 #  define OBJ_authority_key_identifier    OBJ_id_ce,35L
00504 
00505 #  define SN_bf_cbc                       "BF-CBC"
00506 #  define LN_bf_cbc                       "bf-cbc"
00507 #  define NID_bf_cbc                      91
00508 #  define OBJ_bf_cbc                      1L,3L,6L,1L,4L,1L,3029L,1L,2L
00509 
00510 #  define SN_bf_ecb                       "BF-ECB"
00511 #  define LN_bf_ecb                       "bf-ecb"
00512 #  define NID_bf_ecb                      92
00513 
00514 #  define SN_bf_cfb64                     "BF-CFB"
00515 #  define LN_bf_cfb64                     "bf-cfb"
00516 #  define NID_bf_cfb64                    93
00517 
00518 #  define SN_bf_ofb64                     "BF-OFB"
00519 #  define LN_bf_ofb64                     "bf-ofb"
00520 #  define NID_bf_ofb64                    94
00521 
00522 #  define SN_mdc2                         "MDC2"
00523 #  define LN_mdc2                         "mdc2"
00524 #  define NID_mdc2                        95
00525 #  define OBJ_mdc2                        2L,5L,8L,3L,101L
00526 /* An alternative?                      1L,3L,14L,3L,2L,19L */
00527 
00528 #  define SN_mdc2WithRSA                  "RSA-MDC2"
00529 #  define LN_mdc2WithRSA                  "mdc2withRSA"
00530 #  define NID_mdc2WithRSA                 96
00531 #  define OBJ_mdc2WithRSA                 2L,5L,8L,3L,100L
00532 
00533 #  define SN_rc4_40                       "RC4-40"
00534 #  define LN_rc4_40                       "rc4-40"
00535 #  define NID_rc4_40                      97
00536 
00537 #  define SN_rc2_40_cbc                   "RC2-40-CBC"
00538 #  define LN_rc2_40_cbc                   "rc2-40-cbc"
00539 #  define NID_rc2_40_cbc                  98
00540 
00541 #  define SN_givenName                    "G"
00542 #  define LN_givenName                    "givenName"
00543 #  define NID_givenName                   99
00544 #  define OBJ_givenName                   OBJ_X509,42L
00545 
00546 #  define SN_surname                      "S"
00547 #  define LN_surname                      "surname"
00548 #  define NID_surname                     100
00549 #  define OBJ_surname                     OBJ_X509,4L
00550 
00551 #  define SN_initials                     "I"
00552 #  define LN_initials                     "initials"
00553 #  define NID_initials                    101
00554 #  define OBJ_initials                    OBJ_X509,43L
00555 
00556 #  define SN_uniqueIdentifier             "UID"
00557 #  define LN_uniqueIdentifier             "uniqueIdentifier"
00558 #  define NID_uniqueIdentifier            102
00559 #  define OBJ_uniqueIdentifier            OBJ_X509,45L
00560 
00561 #  define SN_crl_distribution_points      "crlDistributionPoints"
00562 #  define LN_crl_distribution_points      "X509v3 CRL Distribution Points"
00563 #  define NID_crl_distribution_points     103
00564 #  define OBJ_crl_distribution_points     OBJ_id_ce,31L
00565 
00566 #  define SN_md5WithRSA                   "RSA-NP-MD5"
00567 #  define LN_md5WithRSA                   "md5WithRSA"
00568 #  define NID_md5WithRSA                  104
00569 #  define OBJ_md5WithRSA                  OBJ_algorithm,3L
00570 
00571 #  define SN_serialNumber                 "SN"
00572 #  define LN_serialNumber                 "serialNumber"
00573 #  define NID_serialNumber                105
00574 #  define OBJ_serialNumber                OBJ_X509,5L
00575 
00576 #  define SN_title                        "T"
00577 #  define LN_title                        "title"
00578 #  define NID_title                       106
00579 #  define OBJ_title                       OBJ_X509,12L
00580 
00581 #  define SN_description                  "D"
00582 #  define LN_description                  "description"
00583 #  define NID_description                 107
00584 #  define OBJ_description                 OBJ_X509,13L
00585 
00586 /* CAST5 is CAST-128, I'm just sticking with the documentation */
00587 #  define SN_cast5_cbc                    "CAST5-CBC"
00588 #  define LN_cast5_cbc                    "cast5-cbc"
00589 #  define NID_cast5_cbc                   108
00590 #  define OBJ_cast5_cbc                   1L,2L,840L,113533L,7L,66L,10L
00591 
00592 #  define SN_cast5_ecb                    "CAST5-ECB"
00593 #  define LN_cast5_ecb                    "cast5-ecb"
00594 #  define NID_cast5_ecb                   109
00595 
00596 #  define SN_cast5_cfb64                  "CAST5-CFB"
00597 #  define LN_cast5_cfb64                  "cast5-cfb"
00598 #  define NID_cast5_cfb64                 110
00599 
00600 #  define SN_cast5_ofb64                  "CAST5-OFB"
00601 #  define LN_cast5_ofb64                  "cast5-ofb"
00602 #  define NID_cast5_ofb64                 111
00603 
00604 #  define LN_pbeWithMD5AndCast5_CBC       "pbeWithMD5AndCast5CBC"
00605 #  define NID_pbeWithMD5AndCast5_CBC      112
00606 #  define OBJ_pbeWithMD5AndCast5_CBC      1L,2L,840L,113533L,7L,66L,12L
00607 
00608 /*-
00609  * This is one sun will soon be using :-(
00610  * id-dsa-with-sha1 ID  ::= {
00611  *   iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }
00612  */
00613 #  define SN_dsaWithSHA1                  "DSA-SHA1"
00614 #  define LN_dsaWithSHA1                  "dsaWithSHA1"
00615 #  define NID_dsaWithSHA1                 113
00616 #  define OBJ_dsaWithSHA1                 1L,2L,840L,10040L,4L,3L
00617 
00618 #  define NID_md5_sha1                    114
00619 #  define SN_md5_sha1                     "MD5-SHA1"
00620 #  define LN_md5_sha1                     "md5-sha1"
00621 
00622 #  define SN_sha1WithRSA                  "RSA-SHA1-2"
00623 #  define LN_sha1WithRSA                  "sha1WithRSA"
00624 #  define NID_sha1WithRSA                 115
00625 #  define OBJ_sha1WithRSA                 OBJ_algorithm,29L
00626 
00627 #  define SN_dsa                          "DSA"
00628 #  define LN_dsa                          "dsaEncryption"
00629 #  define NID_dsa                         116
00630 #  define OBJ_dsa                         1L,2L,840L,10040L,4L,1L
00631 
00632 #  define SN_ripemd160                    "RIPEMD160"
00633 #  define LN_ripemd160                    "ripemd160"
00634 #  define NID_ripemd160                   117
00635 #  define OBJ_ripemd160                   1L,3L,36L,3L,2L,1L
00636 
00637 /*
00638  * The name should actually be rsaSignatureWithripemd160, but I'm going to
00639  * continue using the convention I'm using with the other ciphers
00640  */
00641 #  define SN_ripemd160WithRSA             "RSA-RIPEMD160"
00642 #  define LN_ripemd160WithRSA             "ripemd160WithRSA"
00643 #  define NID_ripemd160WithRSA            119
00644 #  define OBJ_ripemd160WithRSA            1L,3L,36L,3L,3L,1L,2L
00645 
00646 /*-
00647  * Taken from rfc2040
00648  *  RC5_CBC_Parameters ::= SEQUENCE {
00649  *      version           INTEGER (v1_0(16)),
00650  *      rounds            INTEGER (8..127),
00651  *      blockSizeInBits   INTEGER (64, 128),
00652  *      iv                OCTET STRING OPTIONAL
00653  *      }
00654  */
00655 #  define SN_rc5_cbc                      "RC5-CBC"
00656 #  define LN_rc5_cbc                      "rc5-cbc"
00657 #  define NID_rc5_cbc                     120
00658 #  define OBJ_rc5_cbc                     OBJ_rsadsi,3L,8L
00659 
00660 #  define SN_rc5_ecb                      "RC5-ECB"
00661 #  define LN_rc5_ecb                      "rc5-ecb"
00662 #  define NID_rc5_ecb                     121
00663 
00664 #  define SN_rc5_cfb64                    "RC5-CFB"
00665 #  define LN_rc5_cfb64                    "rc5-cfb"
00666 #  define NID_rc5_cfb64                   122
00667 
00668 #  define SN_rc5_ofb64                    "RC5-OFB"
00669 #  define LN_rc5_ofb64                    "rc5-ofb"
00670 #  define NID_rc5_ofb64                   123
00671 
00672 #  define SN_rle_compression              "RLE"
00673 #  define LN_rle_compression              "run length compression"
00674 #  define NID_rle_compression             124
00675 #  define OBJ_rle_compression             1L,1L,1L,1L,666L,1L
00676 
00677 #  define SN_zlib_compression             "ZLIB"
00678 #  define LN_zlib_compression             "zlib compression"
00679 #  define NID_zlib_compression            125
00680 #  define OBJ_zlib_compression            1L,1L,1L,1L,666L,2L
00681 
00682 #  define SN_ext_key_usage                "extendedKeyUsage"
00683 #  define LN_ext_key_usage                "X509v3 Extended Key Usage"
00684 #  define NID_ext_key_usage               126
00685 #  define OBJ_ext_key_usage               OBJ_id_ce,37
00686 
00687 #  define SN_id_pkix                      "PKIX"
00688 #  define NID_id_pkix                     127
00689 #  define OBJ_id_pkix                     1L,3L,6L,1L,5L,5L,7L
00690 
00691 #  define SN_id_kp                        "id-kp"
00692 #  define NID_id_kp                       128
00693 #  define OBJ_id_kp                       OBJ_id_pkix,3L
00694 
00695 /* PKIX extended key usage OIDs */
00696 
00697 #  define SN_server_auth                  "serverAuth"
00698 #  define LN_server_auth                  "TLS Web Server Authentication"
00699 #  define NID_server_auth                 129
00700 #  define OBJ_server_auth                 OBJ_id_kp,1L
00701 
00702 #  define SN_client_auth                  "clientAuth"
00703 #  define LN_client_auth                  "TLS Web Client Authentication"
00704 #  define NID_client_auth                 130
00705 #  define OBJ_client_auth                 OBJ_id_kp,2L
00706 
00707 #  define SN_code_sign                    "codeSigning"
00708 #  define LN_code_sign                    "Code Signing"
00709 #  define NID_code_sign                   131
00710 #  define OBJ_code_sign                   OBJ_id_kp,3L
00711 
00712 #  define SN_email_protect                "emailProtection"
00713 #  define LN_email_protect                "E-mail Protection"
00714 #  define NID_email_protect               132
00715 #  define OBJ_email_protect               OBJ_id_kp,4L
00716 
00717 #  define SN_time_stamp                   "timeStamping"
00718 #  define LN_time_stamp                   "Time Stamping"
00719 #  define NID_time_stamp                  133
00720 #  define OBJ_time_stamp                  OBJ_id_kp,8L
00721 
00722 /* Additional extended key usage OIDs: Microsoft */
00723 
00724 #  define SN_ms_code_ind                  "msCodeInd"
00725 #  define LN_ms_code_ind                  "Microsoft Individual Code Signing"
00726 #  define NID_ms_code_ind                 134
00727 #  define OBJ_ms_code_ind                 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
00728 
00729 #  define SN_ms_code_com                  "msCodeCom"
00730 #  define LN_ms_code_com                  "Microsoft Commercial Code Signing"
00731 #  define NID_ms_code_com                 135
00732 #  define OBJ_ms_code_com                 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
00733 
00734 #  define SN_ms_ctl_sign                  "msCTLSign"
00735 #  define LN_ms_ctl_sign                  "Microsoft Trust List Signing"
00736 #  define NID_ms_ctl_sign                 136
00737 #  define OBJ_ms_ctl_sign                 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
00738 
00739 #  define SN_ms_sgc                       "msSGC"
00740 #  define LN_ms_sgc                       "Microsoft Server Gated Crypto"
00741 #  define NID_ms_sgc                      137
00742 #  define OBJ_ms_sgc                      1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
00743 
00744 #  define SN_ms_efs                       "msEFS"
00745 #  define LN_ms_efs                       "Microsoft Encrypted File System"
00746 #  define NID_ms_efs                      138
00747 #  define OBJ_ms_efs                      1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
00748 
00749 /* Additional usage: Netscape */
00750 
00751 #  define SN_ns_sgc                       "nsSGC"
00752 #  define LN_ns_sgc                       "Netscape Server Gated Crypto"
00753 #  define NID_ns_sgc                      139
00754 #  define OBJ_ns_sgc                      OBJ_netscape,4L,1L
00755 
00756 #  define SN_delta_crl                    "deltaCRL"
00757 #  define LN_delta_crl                    "X509v3 Delta CRL Indicator"
00758 #  define NID_delta_crl                   140
00759 #  define OBJ_delta_crl                   OBJ_id_ce,27L
00760 
00761 #  define SN_crl_reason                   "CRLReason"
00762 #  define LN_crl_reason                   "CRL Reason Code"
00763 #  define NID_crl_reason                  141
00764 #  define OBJ_crl_reason                  OBJ_id_ce,21L
00765 
00766 #  define SN_invalidity_date              "invalidityDate"
00767 #  define LN_invalidity_date              "Invalidity Date"
00768 #  define NID_invalidity_date             142
00769 #  define OBJ_invalidity_date             OBJ_id_ce,24L
00770 
00771 #  define SN_sxnet                        "SXNetID"
00772 #  define LN_sxnet                        "Strong Extranet ID"
00773 #  define NID_sxnet                       143
00774 #  define OBJ_sxnet                       1L,3L,101L,1L,4L,1L
00775 
00776 /* PKCS12 and related OBJECT IDENTIFIERS */
00777 
00778 #  define OBJ_pkcs12                      OBJ_pkcs,12L
00779 #  define OBJ_pkcs12_pbeids               OBJ_pkcs12, 1
00780 
00781 #  define SN_pbe_WithSHA1And128BitRC4     "PBE-SHA1-RC4-128"
00782 #  define LN_pbe_WithSHA1And128BitRC4     "pbeWithSHA1And128BitRC4"
00783 #  define NID_pbe_WithSHA1And128BitRC4    144
00784 #  define OBJ_pbe_WithSHA1And128BitRC4    OBJ_pkcs12_pbeids, 1L
00785 
00786 #  define SN_pbe_WithSHA1And40BitRC4      "PBE-SHA1-RC4-40"
00787 #  define LN_pbe_WithSHA1And40BitRC4      "pbeWithSHA1And40BitRC4"
00788 #  define NID_pbe_WithSHA1And40BitRC4     145
00789 #  define OBJ_pbe_WithSHA1And40BitRC4     OBJ_pkcs12_pbeids, 2L
00790 
00791 #  define SN_pbe_WithSHA1And3_Key_TripleDES_CBC   "PBE-SHA1-3DES"
00792 #  define LN_pbe_WithSHA1And3_Key_TripleDES_CBC   "pbeWithSHA1And3-KeyTripleDES-CBC"
00793 #  define NID_pbe_WithSHA1And3_Key_TripleDES_CBC  146
00794 #  define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC  OBJ_pkcs12_pbeids, 3L
00795 
00796 #  define SN_pbe_WithSHA1And2_Key_TripleDES_CBC   "PBE-SHA1-2DES"
00797 #  define LN_pbe_WithSHA1And2_Key_TripleDES_CBC   "pbeWithSHA1And2-KeyTripleDES-CBC"
00798 #  define NID_pbe_WithSHA1And2_Key_TripleDES_CBC  147
00799 #  define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC  OBJ_pkcs12_pbeids, 4L
00800 
00801 #  define SN_pbe_WithSHA1And128BitRC2_CBC         "PBE-SHA1-RC2-128"
00802 #  define LN_pbe_WithSHA1And128BitRC2_CBC         "pbeWithSHA1And128BitRC2-CBC"
00803 #  define NID_pbe_WithSHA1And128BitRC2_CBC        148
00804 #  define OBJ_pbe_WithSHA1And128BitRC2_CBC        OBJ_pkcs12_pbeids, 5L
00805 
00806 #  define SN_pbe_WithSHA1And40BitRC2_CBC  "PBE-SHA1-RC2-40"
00807 #  define LN_pbe_WithSHA1And40BitRC2_CBC  "pbeWithSHA1And40BitRC2-CBC"
00808 #  define NID_pbe_WithSHA1And40BitRC2_CBC 149
00809 #  define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L
00810 
00811 #  define OBJ_pkcs12_Version1     OBJ_pkcs12, 10L
00812 
00813 #  define OBJ_pkcs12_BagIds       OBJ_pkcs12_Version1, 1L
00814 
00815 #  define LN_keyBag               "keyBag"
00816 #  define NID_keyBag              150
00817 #  define OBJ_keyBag              OBJ_pkcs12_BagIds, 1L
00818 
00819 #  define LN_pkcs8ShroudedKeyBag  "pkcs8ShroudedKeyBag"
00820 #  define NID_pkcs8ShroudedKeyBag 151
00821 #  define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L
00822 
00823 #  define LN_certBag              "certBag"
00824 #  define NID_certBag             152
00825 #  define OBJ_certBag             OBJ_pkcs12_BagIds, 3L
00826 
00827 #  define LN_crlBag               "crlBag"
00828 #  define NID_crlBag              153
00829 #  define OBJ_crlBag              OBJ_pkcs12_BagIds, 4L
00830 
00831 #  define LN_secretBag            "secretBag"
00832 #  define NID_secretBag           154
00833 #  define OBJ_secretBag           OBJ_pkcs12_BagIds, 5L
00834 
00835 #  define LN_safeContentsBag      "safeContentsBag"
00836 #  define NID_safeContentsBag     155
00837 #  define OBJ_safeContentsBag     OBJ_pkcs12_BagIds, 6L
00838 
00839 #  define LN_friendlyName         "friendlyName"
00840 #  define NID_friendlyName        156
00841 #  define OBJ_friendlyName        OBJ_pkcs9, 20L
00842 
00843 #  define LN_localKeyID           "localKeyID"
00844 #  define NID_localKeyID          157
00845 #  define OBJ_localKeyID          OBJ_pkcs9, 21L
00846 
00847 #  define OBJ_certTypes           OBJ_pkcs9, 22L
00848 
00849 #  define LN_x509Certificate      "x509Certificate"
00850 #  define NID_x509Certificate     158
00851 #  define OBJ_x509Certificate     OBJ_certTypes, 1L
00852 
00853 #  define LN_sdsiCertificate      "sdsiCertificate"
00854 #  define NID_sdsiCertificate     159
00855 #  define OBJ_sdsiCertificate     OBJ_certTypes, 2L
00856 
00857 #  define OBJ_crlTypes            OBJ_pkcs9, 23L
00858 
00859 #  define LN_x509Crl              "x509Crl"
00860 #  define NID_x509Crl             160
00861 #  define OBJ_x509Crl             OBJ_crlTypes, 1L
00862 
00863 /* PKCS#5 v2 OIDs */
00864 
00865 #  define LN_pbes2                "PBES2"
00866 #  define NID_pbes2               161
00867 #  define OBJ_pbes2               OBJ_pkcs,5L,13L
00868 
00869 #  define LN_pbmac1               "PBMAC1"
00870 #  define NID_pbmac1              162
00871 #  define OBJ_pbmac1              OBJ_pkcs,5L,14L
00872 
00873 #  define LN_hmacWithSHA1         "hmacWithSHA1"
00874 #  define NID_hmacWithSHA1        163
00875 #  define OBJ_hmacWithSHA1        OBJ_rsadsi,2L,7L
00876 
00877 /* Policy Qualifier Ids */
00878 
00879 #  define LN_id_qt_cps            "Policy Qualifier CPS"
00880 #  define SN_id_qt_cps            "id-qt-cps"
00881 #  define NID_id_qt_cps           164
00882 #  define OBJ_id_qt_cps           OBJ_id_pkix,2L,1L
00883 
00884 #  define LN_id_qt_unotice        "Policy Qualifier User Notice"
00885 #  define SN_id_qt_unotice        "id-qt-unotice"
00886 #  define NID_id_qt_unotice       165
00887 #  define OBJ_id_qt_unotice       OBJ_id_pkix,2L,2L
00888 
00889 #  define SN_rc2_64_cbc                   "RC2-64-CBC"
00890 #  define LN_rc2_64_cbc                   "rc2-64-cbc"
00891 #  define NID_rc2_64_cbc                  166
00892 
00893 #  define SN_SMIMECapabilities            "SMIME-CAPS"
00894 #  define LN_SMIMECapabilities            "S/MIME Capabilities"
00895 #  define NID_SMIMECapabilities           167
00896 #  define OBJ_SMIMECapabilities           OBJ_pkcs9,15L
00897 
00898 #  define SN_pbeWithMD2AndRC2_CBC         "PBE-MD2-RC2-64"
00899 #  define LN_pbeWithMD2AndRC2_CBC         "pbeWithMD2AndRC2-CBC"
00900 #  define NID_pbeWithMD2AndRC2_CBC        168
00901 #  define OBJ_pbeWithMD2AndRC2_CBC        OBJ_pkcs,5L,4L
00902 
00903 #  define SN_pbeWithMD5AndRC2_CBC         "PBE-MD5-RC2-64"
00904 #  define LN_pbeWithMD5AndRC2_CBC         "pbeWithMD5AndRC2-CBC"
00905 #  define NID_pbeWithMD5AndRC2_CBC        169
00906 #  define OBJ_pbeWithMD5AndRC2_CBC        OBJ_pkcs,5L,6L
00907 
00908 #  define SN_pbeWithSHA1AndDES_CBC        "PBE-SHA1-DES"
00909 #  define LN_pbeWithSHA1AndDES_CBC        "pbeWithSHA1AndDES-CBC"
00910 #  define NID_pbeWithSHA1AndDES_CBC       170
00911 #  define OBJ_pbeWithSHA1AndDES_CBC       OBJ_pkcs,5L,10L
00912 
00913 /* Extension request OIDs */
00914 
00915 #  define LN_ms_ext_req                   "Microsoft Extension Request"
00916 #  define SN_ms_ext_req                   "msExtReq"
00917 #  define NID_ms_ext_req                  171
00918 #  define OBJ_ms_ext_req                  1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
00919 
00920 #  define LN_ext_req                      "Extension Request"
00921 #  define SN_ext_req                      "extReq"
00922 #  define NID_ext_req                     172
00923 #  define OBJ_ext_req                     OBJ_pkcs9,14L
00924 
00925 #  define SN_name                         "name"
00926 #  define LN_name                         "name"
00927 #  define NID_name                        173
00928 #  define OBJ_name                        OBJ_X509,41L
00929 
00930 #  define SN_dnQualifier                  "dnQualifier"
00931 #  define LN_dnQualifier                  "dnQualifier"
00932 #  define NID_dnQualifier                 174
00933 #  define OBJ_dnQualifier                 OBJ_X509,46L
00934 
00935 #  define SN_id_pe                        "id-pe"
00936 #  define NID_id_pe                       175
00937 #  define OBJ_id_pe                       OBJ_id_pkix,1L
00938 
00939 #  define SN_id_ad                        "id-ad"
00940 #  define NID_id_ad                       176
00941 #  define OBJ_id_ad                       OBJ_id_pkix,48L
00942 
00943 #  define SN_info_access                  "authorityInfoAccess"
00944 #  define LN_info_access                  "Authority Information Access"
00945 #  define NID_info_access                 177
00946 #  define OBJ_info_access                 OBJ_id_pe,1L
00947 
00948 #  define SN_ad_OCSP                      "OCSP"
00949 #  define LN_ad_OCSP                      "OCSP"
00950 #  define NID_ad_OCSP                     178
00951 #  define OBJ_ad_OCSP                     OBJ_id_ad,1L
00952 
00953 #  define SN_ad_ca_issuers                "caIssuers"
00954 #  define LN_ad_ca_issuers                "CA Issuers"
00955 #  define NID_ad_ca_issuers               179
00956 #  define OBJ_ad_ca_issuers               OBJ_id_ad,2L
00957 
00958 #  define SN_OCSP_sign                    "OCSPSigning"
00959 #  define LN_OCSP_sign                    "OCSP Signing"
00960 #  define NID_OCSP_sign                   180
00961 #  define OBJ_OCSP_sign                   OBJ_id_kp,9L
00962 # endif                         /* USE_OBJ_MAC */
00963 
00964 # include <openssl/bio.h>
00965 # include <openssl/asn1.h>
00966 
00967 # define OBJ_NAME_TYPE_UNDEF             0x00
00968 # define OBJ_NAME_TYPE_MD_METH           0x01
00969 # define OBJ_NAME_TYPE_CIPHER_METH       0x02
00970 # define OBJ_NAME_TYPE_PKEY_METH         0x03
00971 # define OBJ_NAME_TYPE_COMP_METH         0x04
00972 # define OBJ_NAME_TYPE_NUM               0x05
00973 
00974 # define OBJ_NAME_ALIAS                  0x8000
00975 
00976 # define OBJ_BSEARCH_VALUE_ON_NOMATCH            0x01
00977 # define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
00978 
00979 
00980 #ifdef  __cplusplus
00981 extern "C" {
00982 #endif
00983 
00984 typedef struct obj_name_st {
00985     int type;
00986     int alias;
00987     const char *name;
00988     const char *data;
00989 } OBJ_NAME;
00990 
00991 # define         OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
00992 
00993 int OBJ_NAME_init(void);
00994 int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
00995                        int (*cmp_func) (const char *, const char *),
00996                        void (*free_func) (const char *, int, const char *));
00997 const char *OBJ_NAME_get(const char *name, int type);
00998 int OBJ_NAME_add(const char *name, int type, const char *data);
00999 int OBJ_NAME_remove(const char *name, int type);
01000 void OBJ_NAME_cleanup(int type); /* -1 for everything */
01001 void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
01002                      void *arg);
01003 void OBJ_NAME_do_all_sorted(int type,
01004                             void (*fn) (const OBJ_NAME *, void *arg),
01005                             void *arg);
01006 
01007 ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o);
01008 ASN1_OBJECT *OBJ_nid2obj(int n);
01009 const char *OBJ_nid2ln(int n);
01010 const char *OBJ_nid2sn(int n);
01011 int OBJ_obj2nid(const ASN1_OBJECT *o);
01012 ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
01013 int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
01014 int OBJ_txt2nid(const char *s);
01015 int OBJ_ln2nid(const char *s);
01016 int OBJ_sn2nid(const char *s);
01017 int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
01018 const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
01019                          int (*cmp) (const void *, const void *));
01020 const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
01021                             int size,
01022                             int (*cmp) (const void *, const void *),
01023                             int flags);
01024 
01025 # define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm)    \
01026   static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
01027   static int nm##_cmp(type1 const *, type2 const *); \
01028   scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
01029 
01030 # define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp)   \
01031   _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
01032 # define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)     \
01033   type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
01034 
01035 /*-
01036  * Unsolved problem: if a type is actually a pointer type, like
01037  * nid_triple is, then its impossible to get a const where you need
01038  * it. Consider:
01039  *
01040  * typedef int nid_triple[3];
01041  * const void *a_;
01042  * const nid_triple const *a = a_;
01043  *
01044  * The assignement discards a const because what you really want is:
01045  *
01046  * const int const * const *a = a_;
01047  *
01048  * But if you do that, you lose the fact that a is an array of 3 ints,
01049  * which breaks comparison functions.
01050  *
01051  * Thus we end up having to cast, sadly, or unpack the
01052  * declarations. Or, as I finally did in this case, delcare nid_triple
01053  * to be a struct, which it should have been in the first place.
01054  *
01055  * Ben, August 2008.
01056  *
01057  * Also, strictly speaking not all types need be const, but handling
01058  * the non-constness means a lot of complication, and in practice
01059  * comparison routines do always not touch their arguments.
01060  */
01061 
01062 # define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm)  \
01063   static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)    \
01064       { \
01065       type1 const *a = a_; \
01066       type2 const *b = b_; \
01067       return nm##_cmp(a,b); \
01068       } \
01069   static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
01070       { \
01071       return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
01072                                         nm##_cmp_BSEARCH_CMP_FN); \
01073       } \
01074       extern void dummy_prototype(void)
01075 
01076 # define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)   \
01077   static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)    \
01078       { \
01079       type1 const *a = a_; \
01080       type2 const *b = b_; \
01081       return nm##_cmp(a,b); \
01082       } \
01083   type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
01084       { \
01085       return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
01086                                         nm##_cmp_BSEARCH_CMP_FN); \
01087       } \
01088       extern void dummy_prototype(void)
01089 
01090 # define OBJ_bsearch(type1,key,type2,base,num,cmp)                              \
01091   ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
01092                          num,sizeof(type2),                             \
01093                          ((void)CHECKED_PTR_OF(type1,cmp##_type_1),     \
01094                           (void)CHECKED_PTR_OF(type2,cmp##_type_2),     \
01095                           cmp##_BSEARCH_CMP_FN)))
01096 
01097 # define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags)                      \
01098   ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
01099                          num,sizeof(type2),                             \
01100                          ((void)CHECKED_PTR_OF(type1,cmp##_type_1),     \
01101                           (void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
01102                           cmp##_BSEARCH_CMP_FN)),flags)
01103 
01104 int OBJ_new_nid(int num);
01105 int OBJ_add_object(const ASN1_OBJECT *obj);
01106 int OBJ_create(const char *oid, const char *sn, const char *ln);
01107 void OBJ_cleanup(void);
01108 int OBJ_create_objects(BIO *in);
01109 
01110 int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
01111 int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
01112 int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
01113 void OBJ_sigid_free(void);
01114 
01115 extern int obj_cleanup_defer;
01116 void check_defer(int nid);
01117 
01118 /* BEGIN ERROR CODES */
01119 /*
01120  * The following lines are auto generated by the script mkerr.pl. Any changes
01121  * made after this point may be overwritten when the script is next run.
01122  */
01123 void ERR_load_OBJ_strings(void);
01124 
01125 /* Error codes for the OBJ functions. */
01126 
01127 /* Function codes. */
01128 # define OBJ_F_OBJ_ADD_OBJECT                             105
01129 # define OBJ_F_OBJ_CREATE                                 100
01130 # define OBJ_F_OBJ_DUP                                    101
01131 # define OBJ_F_OBJ_NAME_NEW_INDEX                         106
01132 # define OBJ_F_OBJ_NID2LN                                 102
01133 # define OBJ_F_OBJ_NID2OBJ                                103
01134 # define OBJ_F_OBJ_NID2SN                                 104
01135 
01136 /* Reason codes. */
01137 # define OBJ_R_MALLOC_FAILURE                             100
01138 # define OBJ_R_UNKNOWN_NID                                101
01139 
01140 #ifdef  __cplusplus
01141 }
01142 #endif
01143 #endif