secoidt.h
上传用户:lyxiangda
上传日期:2007-01-12
资源大小:3042k
文件大小:10k
源码类别:

CA认证

开发平台:

WINDOWS

  1. /*
  2.  * The contents of this file are subject to the Mozilla Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/MPL/
  6.  * 
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  * 
  12.  * The Original Code is the Netscape security libraries.
  13.  * 
  14.  * The Initial Developer of the Original Code is Netscape
  15.  * Communications Corporation.  Portions created by Netscape are 
  16.  * Copyright (C) 1994-2000 Netscape Communications Corporation.  All
  17.  * Rights Reserved.
  18.  * 
  19.  * Contributor(s):
  20.  * 
  21.  * Alternatively, the contents of this file may be used under the
  22.  * terms of the GNU General Public License Version 2 or later (the
  23.  * "GPL"), in which case the provisions of the GPL are applicable 
  24.  * instead of those above.  If you wish to allow use of your 
  25.  * version of this file only under the terms of the GPL and not to
  26.  * allow others to use your version of this file under the MPL,
  27.  * indicate your decision by deleting the provisions above and
  28.  * replace them with the notice and other provisions required by
  29.  * the GPL.  If you do not delete the provisions above, a recipient
  30.  * may use your version of this file under either the MPL or the
  31.  * GPL.
  32.  */
  33. #ifndef _SECOIDT_H_
  34. #define _SECOIDT_H_
  35. /*
  36.  * secoidt.h - public data structures for ASN.1 OID functions
  37.  *
  38.  * $Id: secoidt.h,v 1.3 2000/06/20 16:28:59 chrisk%netscape.com Exp $
  39.  */
  40. #include "secitem.h"
  41. typedef struct SECOidDataStr SECOidData;
  42. typedef struct SECAlgorithmIDStr SECAlgorithmID;
  43. /*
  44. ** An X.500 algorithm identifier
  45. */
  46. struct SECAlgorithmIDStr {
  47.     SECItem algorithm;
  48.     SECItem parameters;
  49. };
  50. /*
  51.  * Misc object IDs - these numbers are for convenient handling.
  52.  * They are mapped into real object IDs
  53.  *
  54.  * NOTE: the order of these entries must mach the array "oids" of SECOidData
  55.  * in util/secoid.c.
  56.  */
  57. typedef enum {
  58.     SEC_OID_UNKNOWN,
  59.     SEC_OID_MD2,
  60.     SEC_OID_MD4,
  61.     SEC_OID_MD5,
  62.     SEC_OID_SHA1,
  63.     SEC_OID_RC2_CBC,
  64.     SEC_OID_RC4,
  65.     SEC_OID_DES_EDE3_CBC,
  66.     SEC_OID_RC5_CBC_PAD,
  67.     SEC_OID_DES_ECB,
  68.     SEC_OID_DES_CBC,
  69.     SEC_OID_DES_OFB,
  70.     SEC_OID_DES_CFB,
  71.     SEC_OID_DES_MAC,
  72.     SEC_OID_DES_EDE,
  73.     SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE,
  74.     SEC_OID_PKCS1_RSA_ENCRYPTION,
  75.     SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION,
  76.     SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION,
  77.     SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION,
  78.     SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION,
  79.     SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC,
  80.     SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC,
  81.     SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC,
  82.     SEC_OID_PKCS7,
  83.     SEC_OID_PKCS7_DATA,
  84.     SEC_OID_PKCS7_SIGNED_DATA,
  85.     SEC_OID_PKCS7_ENVELOPED_DATA,
  86.     SEC_OID_PKCS7_SIGNED_ENVELOPED_DATA,
  87.     SEC_OID_PKCS7_DIGESTED_DATA,
  88.     SEC_OID_PKCS7_ENCRYPTED_DATA,
  89.     SEC_OID_PKCS9_EMAIL_ADDRESS,
  90.     SEC_OID_PKCS9_UNSTRUCTURED_NAME,
  91.     SEC_OID_PKCS9_CONTENT_TYPE,
  92.     SEC_OID_PKCS9_MESSAGE_DIGEST,
  93.     SEC_OID_PKCS9_SIGNING_TIME,
  94.     SEC_OID_PKCS9_COUNTER_SIGNATURE,
  95.     SEC_OID_PKCS9_CHALLENGE_PASSWORD,
  96.     SEC_OID_PKCS9_UNSTRUCTURED_ADDRESS,
  97.     SEC_OID_PKCS9_EXTENDED_CERTIFICATE_ATTRIBUTES,
  98.     SEC_OID_PKCS9_SMIME_CAPABILITIES,
  99.     SEC_OID_AVA_COMMON_NAME,
  100.     SEC_OID_AVA_COUNTRY_NAME,
  101.     SEC_OID_AVA_LOCALITY,
  102.     SEC_OID_AVA_STATE_OR_PROVINCE,
  103.     SEC_OID_AVA_ORGANIZATION_NAME,
  104.     SEC_OID_AVA_ORGANIZATIONAL_UNIT_NAME,
  105.     SEC_OID_AVA_DN_QUALIFIER,
  106.     SEC_OID_AVA_DC,
  107.     SEC_OID_NS_TYPE_GIF,
  108.     SEC_OID_NS_TYPE_JPEG,
  109.     SEC_OID_NS_TYPE_URL,
  110.     SEC_OID_NS_TYPE_HTML,
  111.     SEC_OID_NS_TYPE_CERT_SEQUENCE,
  112.     SEC_OID_MISSI_KEA_DSS_OLD,
  113.     SEC_OID_MISSI_DSS_OLD,
  114.     SEC_OID_MISSI_KEA_DSS,
  115.     SEC_OID_MISSI_DSS,
  116.     SEC_OID_MISSI_KEA,
  117.     SEC_OID_MISSI_ALT_KEA,
  118.     /* Netscape private certificate extensions */
  119.     SEC_OID_NS_CERT_EXT_NETSCAPE_OK,
  120.     SEC_OID_NS_CERT_EXT_ISSUER_LOGO,
  121.     SEC_OID_NS_CERT_EXT_SUBJECT_LOGO,
  122.     SEC_OID_NS_CERT_EXT_CERT_TYPE,
  123.     SEC_OID_NS_CERT_EXT_BASE_URL,
  124.     SEC_OID_NS_CERT_EXT_REVOCATION_URL,
  125.     SEC_OID_NS_CERT_EXT_CA_REVOCATION_URL,
  126.     SEC_OID_NS_CERT_EXT_CA_CRL_URL,
  127.     SEC_OID_NS_CERT_EXT_CA_CERT_URL,
  128.     SEC_OID_NS_CERT_EXT_CERT_RENEWAL_URL,
  129.     SEC_OID_NS_CERT_EXT_CA_POLICY_URL,
  130.     SEC_OID_NS_CERT_EXT_HOMEPAGE_URL,
  131.     SEC_OID_NS_CERT_EXT_ENTITY_LOGO,
  132.     SEC_OID_NS_CERT_EXT_USER_PICTURE,
  133.     SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME,
  134.     SEC_OID_NS_CERT_EXT_COMMENT,
  135.     SEC_OID_NS_CERT_EXT_LOST_PASSWORD_URL,
  136.     SEC_OID_NS_CERT_EXT_CERT_RENEWAL_TIME,
  137.     SEC_OID_NS_KEY_USAGE_GOVT_APPROVED,
  138.     /* x.509 v3 Extensions */
  139.     SEC_OID_X509_SUBJECT_DIRECTORY_ATTR,
  140.     SEC_OID_X509_SUBJECT_KEY_ID,
  141.     SEC_OID_X509_KEY_USAGE,
  142.     SEC_OID_X509_PRIVATE_KEY_USAGE_PERIOD,
  143.     SEC_OID_X509_SUBJECT_ALT_NAME,
  144.     SEC_OID_X509_ISSUER_ALT_NAME,
  145.     SEC_OID_X509_BASIC_CONSTRAINTS,
  146.     SEC_OID_X509_NAME_CONSTRAINTS,
  147.     SEC_OID_X509_CRL_DIST_POINTS,
  148.     SEC_OID_X509_CERTIFICATE_POLICIES,
  149.     SEC_OID_X509_POLICY_MAPPINGS,
  150.     SEC_OID_X509_POLICY_CONSTRAINTS,
  151.     SEC_OID_X509_AUTH_KEY_ID,
  152.     SEC_OID_X509_EXT_KEY_USAGE,
  153.     SEC_OID_X509_AUTH_INFO_ACCESS,
  154.     SEC_OID_X509_CRL_NUMBER,
  155.     SEC_OID_X509_REASON_CODE,
  156.     SEC_OID_X509_INVALID_DATE,
  157.     /* End of x.509 v3 Extensions */    
  158.     SEC_OID_X500_RSA_ENCRYPTION,
  159.     /* alg 1485 additions */
  160.     SEC_OID_RFC1274_UID,
  161.     SEC_OID_RFC1274_MAIL,
  162.     /* PKCS 12 additions */
  163.     SEC_OID_PKCS12,
  164.     SEC_OID_PKCS12_MODE_IDS,
  165.     SEC_OID_PKCS12_ESPVK_IDS,
  166.     SEC_OID_PKCS12_BAG_IDS,
  167.     SEC_OID_PKCS12_CERT_BAG_IDS,
  168.     SEC_OID_PKCS12_OIDS,
  169.     SEC_OID_PKCS12_PBE_IDS,
  170.     SEC_OID_PKCS12_SIGNATURE_IDS,
  171.     SEC_OID_PKCS12_ENVELOPING_IDS,
  172.    /* SEC_OID_PKCS12_OFFLINE_TRANSPORT_MODE,
  173.     SEC_OID_PKCS12_ONLINE_TRANSPORT_MODE, */
  174.     SEC_OID_PKCS12_PKCS8_KEY_SHROUDING,
  175.     SEC_OID_PKCS12_KEY_BAG_ID,
  176.     SEC_OID_PKCS12_CERT_AND_CRL_BAG_ID,
  177.     SEC_OID_PKCS12_SECRET_BAG_ID,
  178.     SEC_OID_PKCS12_X509_CERT_CRL_BAG,
  179.     SEC_OID_PKCS12_SDSI_CERT_BAG,
  180.     SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC4,
  181.     SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC4,
  182.     SEC_OID_PKCS12_PBE_WITH_SHA1_AND_TRIPLE_DES_CBC,
  183.     SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC,
  184.     SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC,
  185.     SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_128_BIT_RC4,
  186.     SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_40_BIT_RC4,
  187.     SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_TRIPLE_DES,
  188.     SEC_OID_PKCS12_RSA_SIGNATURE_WITH_SHA1_DIGEST,
  189.     /* end of PKCS 12 additions */
  190.     /* DSA signatures */
  191.     SEC_OID_ANSIX9_DSA_SIGNATURE,
  192.     SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST,
  193.     SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST,
  194.     /* Verisign OIDs */
  195.     SEC_OID_VERISIGN_USER_NOTICES,
  196.     /* PKIX OIDs */
  197.     SEC_OID_PKIX_CPS_POINTER_QUALIFIER,
  198.     SEC_OID_PKIX_USER_NOTICE_QUALIFIER,
  199.     SEC_OID_PKIX_OCSP,
  200.     SEC_OID_PKIX_OCSP_BASIC_RESPONSE,
  201.     SEC_OID_PKIX_OCSP_NONCE,
  202.     SEC_OID_PKIX_OCSP_CRL,
  203.     SEC_OID_PKIX_OCSP_RESPONSE,
  204.     SEC_OID_PKIX_OCSP_NO_CHECK,
  205.     SEC_OID_PKIX_OCSP_ARCHIVE_CUTOFF,
  206.     SEC_OID_PKIX_OCSP_SERVICE_LOCATOR,
  207.     SEC_OID_PKIX_REGCTRL_REGTOKEN,
  208.     SEC_OID_PKIX_REGCTRL_AUTHENTICATOR,
  209.     SEC_OID_PKIX_REGCTRL_PKIPUBINFO,
  210.     SEC_OID_PKIX_REGCTRL_PKI_ARCH_OPTIONS,
  211.     SEC_OID_PKIX_REGCTRL_OLD_CERT_ID,
  212.     SEC_OID_PKIX_REGCTRL_PROTOCOL_ENC_KEY,
  213.     SEC_OID_PKIX_REGINFO_UTF8_PAIRS,
  214.     SEC_OID_PKIX_REGINFO_CERT_REQUEST,
  215.     SEC_OID_EXT_KEY_USAGE_SERVER_AUTH,
  216.     SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH,
  217.     SEC_OID_EXT_KEY_USAGE_CODE_SIGN,
  218.     SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT,
  219.     SEC_OID_EXT_KEY_USAGE_TIME_STAMP,
  220.     SEC_OID_OCSP_RESPONDER,
  221.     /* Netscape Algorithm OIDs */
  222.     SEC_OID_NETSCAPE_SMIME_KEA,
  223.     /* Skipjack OID -- ### mwelch temporary */
  224.     SEC_OID_FORTEZZA_SKIPJACK,
  225.     /* PKCS 12 V2 oids */
  226.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4,
  227.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4,
  228.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC,
  229.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_2KEY_TRIPLE_DES_CBC,
  230.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC,
  231.     SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC,
  232.     SEC_OID_PKCS12_SAFE_CONTENTS_ID,
  233.     SEC_OID_PKCS12_PKCS8_SHROUDED_KEY_BAG_ID,
  234.     SEC_OID_PKCS12_V1_KEY_BAG_ID,
  235.     SEC_OID_PKCS12_V1_PKCS8_SHROUDED_KEY_BAG_ID,
  236.     SEC_OID_PKCS12_V1_CERT_BAG_ID,
  237.     SEC_OID_PKCS12_V1_CRL_BAG_ID,
  238.     SEC_OID_PKCS12_V1_SECRET_BAG_ID,
  239.     SEC_OID_PKCS12_V1_SAFE_CONTENTS_BAG_ID,
  240.     SEC_OID_PKCS9_X509_CERT,
  241.     SEC_OID_PKCS9_SDSI_CERT,
  242.     SEC_OID_PKCS9_X509_CRL,
  243.     SEC_OID_PKCS9_FRIENDLY_NAME,
  244.     SEC_OID_PKCS9_LOCAL_KEY_ID,
  245.     SEC_OID_PKCS12_KEY_USAGE,
  246.     /*Diffe Helman OIDS */
  247.     SEC_OID_X942_DIFFIE_HELMAN_KEY,
  248.     /* Netscape other name types */
  249.     SEC_OID_NETSCAPE_NICKNAME,
  250.     /* Cert Server OIDS */
  251.     SEC_OID_NETSCAPE_RECOVERY_REQUEST,
  252.     /* New PSM certificate management OIDs */
  253.     SEC_OID_CERT_RENEWAL_LOCATOR,
  254.     SEC_OID_NS_CERT_EXT_SCOPE_OF_USE,
  255.     
  256.     /* CMS (RFC2630) OIDs */
  257.     SEC_OID_CMS_EPHEMERAL_STATIC_DIFFIE_HELLMAN,
  258.     SEC_OID_CMS_3DES_KEY_WRAP,
  259.     SEC_OID_CMS_RC2_KEY_WRAP,
  260.     /* SMIME attributes */
  261.     SEC_OID_SMIME_ENCRYPTION_KEY_PREFERENCE,
  262.     SEC_OID_TOTAL
  263. } SECOidTag;
  264. /* fake OID for DSS sign/verify */
  265. #define SEC_OID_SHA SEC_OID_MISS_DSS
  266. typedef enum {
  267.     INVALID_CERT_EXTENSION,
  268.     UNSUPPORTED_CERT_EXTENSION,
  269.     SUPPORTED_CERT_EXTENSION
  270. } SECSupportExtenTag;
  271. struct SECOidDataStr {
  272.     SECItem oid;
  273.     SECOidTag offset;
  274.     char *desc;
  275.     unsigned long mechanism;
  276.     SECSupportExtenTag supportedExtension; /* only used for x.509 v3 extensions, so
  277.    that we can print the names of those
  278.    extensions that we don't even support */
  279. };
  280. #endif /* _SECOIDT_H_ */