nsspkixt.h

来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· C头文件 代码 · 共 2,282 行 · 第 1/4 页

H
2,282
字号
/*  * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ *  * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. *  * The Original Code is the Netscape security libraries. *  * The Initial Developer of the Original Code is Netscape * Communications Corporation.  Portions created by Netscape are  * Copyright (C) 1994-2000 Netscape Communications Corporation.  All * Rights Reserved. *  * Contributor(s): *  * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL"), in which case the provisions of the GPL are applicable  * instead of those above.  If you wish to allow use of your  * version of this file only under the terms of the GPL and not to * allow others to use your version of this file under the MPL, * indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by * the GPL.  If you do not delete the provisions above, a recipient * may use your version of this file under either the MPL or the * GPL. */#ifndef NSSPKIXT_H#define NSSPKIXT_H#ifdef DEBUGstatic const char NSSPKIXT_CVS_ID[] = "@(#) $Source: /cvsroot/mozilla/security/nss/lib/pkix/include/nsspkixt.h,v $ $Revision: 1.1 $ $Date: 2000/03/31 19:02:44 $ $Name: NSS_3_1_1_RTM $";#endif /* DEBUG *//* * nsspkixt.h * * This file contains the public type definitions for the PKIX part-1 * objects.  The contents are strongly based on the types defined in * RFC 2459 {fgmr: and others, e.g., s/mime?}.  The type names have * been prefixed with "NSSPKIX." */#ifndef NSSBASET_H#include "nssbaset.h"#endif /* NSSBASET_H */PR_BEGIN_EXTERN_C/* * A Note About Strings * * RFC 2459 refers to several types of strings, including UniversalString, * BMPString, UTF8String, TeletexString, PrintableString, IA5String, and * more.  As with the rest of the NSS libraries, all strings are converted * to UTF8 form as soon as possible, and dealt with in that form from * then on. * *//* * Attribute * * -- fgmr comments -- * * From RFC 2459: * *  Attribute       ::=     SEQUENCE { *          type            AttributeType, *          values  SET OF AttributeValue *                  -- at least one value is required -- } * */struct NSSPKIXAttributeStr;typedef struct NSSPKIXAttributeStr NSSPKIXAttribute;/* * AttributeType * * -- fgmr comments -- * * From RFC 2459: * *  AttributeType           ::=   OBJECT IDENTIFIER * */typedef NSSOID NSSPKIXAttributeType;/* * AttributeValue * * -- fgmr comments -- * * From RFC 2459: * *  AttributeValue          ::=   ANY * */typedef NSSItem NSSPKIXAttributeValue;/* * AttributeTypeAndValue * * This structure contains an attribute type (indicated by an OID),  * and the type-specific value.  RelativeDistinguishedNamess consist * of a set of these.  These are distinct from Attributes (which have * SET of values), from AttributeDescriptions (which have qualifiers * on the types), and from AttributeValueAssertions (which assert a * a value comparison under some matching rule). * * From RFC 2459: * *  AttributeTypeAndValue           ::=     SEQUENCE { *          type    AttributeType, *          value   AttributeValue } *  */struct NSSPKIXAttributeTypeAndValueStr;typedef struct NSSPKIXAttributeTypeAndValueStr NSSPKIXAttributeTypeAndValue;/* * X520Name * * -- fgmr comments -- * * From RFC 2459: * *  X520name        ::= CHOICE { *        teletexString         TeletexString (SIZE (1..ub-name)), *        printableString       PrintableString (SIZE (1..ub-name)), *        universalString       UniversalString (SIZE (1..ub-name)), *        utf8String            UTF8String (SIZE (1..ub-name)), *        bmpString             BMPString (SIZE(1..ub-name))   } * */struct NSSPKIXX520NameStr;typedef struct NSSPKIXX520NameStr NSSPKIXX520Name;/* * X520CommonName * * -- fgmr comments -- * * From RFC 2459: * *  X520CommonName  ::=      CHOICE { *        teletexString         TeletexString (SIZE (1..ub-common-name)), *        printableString       PrintableString (SIZE (1..ub-common-name)), *        universalString       UniversalString (SIZE (1..ub-common-name)), *        utf8String            UTF8String (SIZE (1..ub-common-name)), *        bmpString             BMPString (SIZE(1..ub-common-name))   } *  */struct NSSPKIXX520CommonNameStr;typedef struct NSSPKIXX520CommonNameStr NSSPKIXX520CommonName;/* * X520LocalityName * * -- fgmr comments -- * * From RFC 2459: * *  X520LocalityName ::= CHOICE { *        teletexString       TeletexString (SIZE (1..ub-locality-name)), *        printableString     PrintableString (SIZE (1..ub-locality-name)), *        universalString     UniversalString (SIZE (1..ub-locality-name)), *        utf8String          UTF8String (SIZE (1..ub-locality-name)), *        bmpString           BMPString (SIZE(1..ub-locality-name))   } *  */struct NSSPKIXX520LocalityNameStr;typedef struct NSSPKIXX520LocalityNameStr NSSPKIXX520LocalityName;/* * X520StateOrProvinceName * * -- fgmr comments -- * * From RFC 2459: * *  X520StateOrProvinceName         ::= CHOICE { *        teletexString       TeletexString (SIZE (1..ub-state-name)), *        printableString     PrintableString (SIZE (1..ub-state-name)), *        universalString     UniversalString (SIZE (1..ub-state-name)), *        utf8String          UTF8String (SIZE (1..ub-state-name)), *        bmpString           BMPString (SIZE(1..ub-state-name))   } * */struct NSSPKIXX520StateOrProvinceNameStr;typedef struct NSSPKIXX520StateOrProvinceNameStr NSSPKIXX520StateOrProvinceName;/* * X520OrganizationName * * -- fgmr comments -- * * From RFC 2459: * *  X520OrganizationName ::= CHOICE { *    teletexString     TeletexString (SIZE (1..ub-organization-name)), *    printableString   PrintableString (SIZE (1..ub-organization-name)), *    universalString   UniversalString (SIZE (1..ub-organization-name)), *    utf8String        UTF8String (SIZE (1..ub-organization-name)), *    bmpString         BMPString (SIZE(1..ub-organization-name))   } * */struct NSSPKIXX520OrganizationNameStr;typedef struct NSSPKIXX520OrganizationNameStr NSSPKIXX520OrganizationName;/* * X520OrganizationalUnitName * * -- fgmr comments -- * * From RFC 2459: * *  X520OrganizationalUnitName ::= CHOICE { *   teletexString    TeletexString (SIZE (1..ub-organizational-unit-name)), *   printableString        PrintableString *                        (SIZE (1..ub-organizational-unit-name)), *   universalString        UniversalString *                        (SIZE (1..ub-organizational-unit-name)), *   utf8String       UTF8String (SIZE (1..ub-organizational-unit-name)), *   bmpString        BMPString (SIZE(1..ub-organizational-unit-name))   } * */struct NSSPKIXX520OrganizationalUnitNameStr;typedef struct NSSPKIXX520OrganizationalUnitNameStr NSSPKIXX520OrganizationalUnitName;/* * X520Title * * -- fgmr comments -- * * From RFC 2459: * *  X520Title ::=   CHOICE { *        teletexString         TeletexString (SIZE (1..ub-title)), *        printableString       PrintableString (SIZE (1..ub-title)), *        universalString       UniversalString (SIZE (1..ub-title)), *        utf8String            UTF8String (SIZE (1..ub-title)), *        bmpString             BMPString (SIZE(1..ub-title))   } * */struct NSSPKIXX520TitleStr;typedef struct NSSPKIXX520TitleStr NSSPKIXX520Title;/* * X520dnQualifier * * -- fgmr comments -- * * From RFC 2459: * *  X520dnQualifier ::=     PrintableString * */struct NSSPKIXX520dnQualifierStr;typedef struct NSSPKIXX520dnQualifierStr NSSPKIXX520dnQualifier;/* * X520countryName * * -- fgmr comments -- * * From RFC 2459: * *  X520countryName ::=     PrintableString (SIZE (2)) -- IS 3166 codes * */struct NSSPKIXX520countryNameStr;typedef struct NSSPKIXX520countryNameStr NSSPKIXX520countryName;/* * Pkcs9email * * -- fgmr comments -- * * From RFC 2459: * *  Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length)) * */struct NSSPKIXPkcs9emailStr;typedef struct NSSPKIXPkcs9emailStr NSSPKIXPkcs9email;/* * Name * * This structure contains a union of the possible name formats, * which at the moment is limited to an RDNSequence. * * From RFC 2459: * *  Name            ::=   CHOICE { -- only one possibility for now -- *                                   rdnSequence  RDNSequence } * */struct NSSPKIXNameStr;typedef struct NSSPKIXNameStr NSSPKIXName;/* * NameChoice * * This enumeration is used to specify choice within a name. */enum NSSPKIXNameChoiceEnum {  NSSPKIXNameChoice_NSSinvalid = -1,  NSSPKIXNameChoice_rdnSequence};typedef enum NSSPKIXNameChoiceEnum NSSPKIXNameChoice;/* * RDNSequence * * This structure contains a sequence of RelativeDistinguishedName * objects. * * From RFC 2459: * *  RDNSequence     ::=   SEQUENCE OF RelativeDistinguishedName * */struct NSSPKIXRDNSequenceStr;typedef struct NSSPKIXRDNSequenceStr NSSPKIXRDNSequence;/* * DistinguishedName * * -- fgmr comments -- * * From RFC 2459: * *  DistinguishedName       ::=   RDNSequence * */typedef NSSPKIXRDNSequence NSSPKIXDistinguishedName;/* * RelativeDistinguishedName * * This structure contains an unordered set of AttributeTypeAndValue  * objects.  RDNs are used to distinguish a set of objects underneath  * a common object. * * Often, a single ATAV is sufficient to make a unique distinction. * For example, if a company assigns its people unique uid values, * then in the Name "uid=smith,ou=People,o=Acme,c=US" the "uid=smith" * ATAV by itself forms an RDN.  However, sometimes a set of ATAVs is * needed.  For example, if a company needed to distinguish between * two Smiths by specifying their corporate divisions, then in the * Name "(cn=Smith,ou=Sales),ou=People,o=Acme,c=US" the parenthesised * set of ATAVs forms the RDN. * * From RFC 2459: * *  RelativeDistinguishedName  ::= *                      SET SIZE (1 .. MAX) OF AttributeTypeAndValue * */struct NSSPKIXRelativeDistinguishedNameStr;typedef struct NSSPKIXRelativeDistinguishedNameStr NSSPKIXRelativeDistinguishedName;/* * DirectoryString * * -- fgmr comments -- * * From RFC 2459: * *  DirectoryString ::= CHOICE { *        teletexString             TeletexString (SIZE (1..MAX)), *        printableString           PrintableString (SIZE (1..MAX)), *        universalString           UniversalString (SIZE (1..MAX)), *        utf8String              UTF8String (SIZE (1..MAX)), *        bmpString               BMPString (SIZE(1..MAX))   } * */struct NSSPKIXDirectoryStringStr;typedef struct NSSPKIXDirectoryStringStr NSSPKIXDirectoryString;/* * Certificate * * -- fgmr comments -- * * From RFC 2459: * *  Certificate  ::=  SEQUENCE  { *       tbsCertificate       TBSCertificate, *       signatureAlgorithm   AlgorithmIdentifier, *       signature            BIT STRING  } * */struct NSSPKIXCertificateStr;typedef struct NSSPKIXCertificateStr NSSPKIXCertificate;/* * TBSCertificate * * -- fgmr comments -- * * From RFC 2459: * *  TBSCertificate  ::=  SEQUENCE  { *       version         [0]  Version DEFAULT v1, *       serialNumber         CertificateSerialNumber, *       signature            AlgorithmIdentifier, *       issuer               Name, *       validity             Validity, *       subject              Name, *       subjectPublicKeyInfo SubjectPublicKeyInfo, *       issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL, *                            -- If present, version shall be v2 or v3 *       subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL, *                            -- If present, version shall be v2 or v3 *       extensions      [3]  Extensions OPTIONAL *                            -- If present, version shall be v3 --  } * */struct NSSPKIXTBSCertificateStr;typedef struct NSSPKIXTBSCertificateStr NSSPKIXTBSCertificate;/* * Version * * -- fgmr comments -- * * From RFC 2459: * *  Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  } * */enum NSSPKIXVersionEnum {  NSSPKIXVersion_NSSinvalid = -1,  NSSPKIXVersion_v1 = 0,  NSSPKIXVersion_v2 = 1,  NSSPKIXVersion_v3 = 2};typedef enum NSSPKIXVersionEnum NSSPKIXVersion;/* * CertificateSerialNumber * * -- fgmr comments -- * * From RFC 2459: * *  CertificateSerialNumber  ::=  INTEGER * */typedef NSSBER NSSPKIXCertificateSerialNumber;/* * Validity * * -- fgmr comments -- * * From RFC 2459: * *  Validity ::= SEQUENCE { *       notBefore      Time, *       notAfter       Time } * */struct NSSPKIXValidityStr;typedef struct NSSPKIXValidityStr NSSPKIXValidity;/* * Time * * -- fgmr comments -- * * From RFC 2459: * *  Time ::= CHOICE { *       utcTime        UTCTime, *       generalTime    GeneralizedTime } * */struct NSSPKIXTimeStr;typedef struct NSSPKIXTimeStr NSSPKIXTime;/* * UniqueIdentifier * * -- fgmr comments -- * * From RFC 2459: * *  UniqueIdentifier  ::=  BIT STRING * */typedef NSSBitString NSSPKIXUniqueIdentifier;/* * SubjectPublicKeyInfo * * -- fgmr comments -- * * From RFC 2459: * *  SubjectPublicKeyInfo  ::=  SEQUENCE  { *       algorithm            AlgorithmIdentifier, *       subjectPublicKey     BIT STRING  } * */struct NSSPKIXSubjectPublicKeyInfoStr;typedef NSSPKIXSubjectPublicKeyInfoStr NSSPKIXSubjectPublicKeyInfo;/* * Extensions * * -- fgmr comments -- * * From RFC 2459: * *  Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension * */struct NSSPKIXExtensionsStr;typedef struct NSSPKIXExtensionsStr NSSPKIXExtensions;/* * Extension * * -- fgmr comments -- * * From RFC 2459: * *  Extension  ::=  SEQUENCE  { *       extnID      OBJECT IDENTIFIER, *       critical    BOOLEAN DEFAULT FALSE, *       extnValue   OCTET STRING  } *

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?