Back to index

lightning-sunbird  0.9+nobinonly
asn1t.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 #ifndef ASN1T_H
00038 #define ASN1T_H
00039 
00040 #ifdef DEBUG
00041 static const char ASN1T_CVS_ID[] = "@(#) $RCSfile: asn1t.h,v $ $Revision: 1.4 $ $Date: 2005/01/20 02:25:44 $";
00042 #endif /* DEBUG */
00043 
00044 /*
00045  * asn1t.h
00046  *
00047  * This file contains the ASN.1 encoder/decoder types available 
00048  * internally within NSS.  It's not clear right now if this file
00049  * will be folded into baset.h or something, I just needed to
00050  * get this going.  At the moment, these types are wrappers for
00051  * the old types.
00052  */
00053 
00054 #ifndef BASET_H
00055 #include "baset.h"
00056 #endif /* BASET_H */
00057 
00058 #ifndef NSSASN1T_H
00059 #include "nssasn1t.h"
00060 #endif /* NSSASN1T_H */
00061 
00062 #include "seccomon.h"
00063 #include "secasn1t.h"
00064 
00065 PR_BEGIN_EXTERN_C
00066 
00067 /*
00068  * XXX fgmr
00069  *
00070  * This sort of bites.  Let's keep an eye on this, to make sure
00071  * we aren't stuck with it forever.
00072  */
00073 
00074 struct nssASN1ItemStr {
00075   PRUint32 reserved;
00076   PRUint8 *data;
00077   PRUint32 size;
00078 };
00079 
00080 typedef struct nssASN1ItemStr nssASN1Item;
00081 
00082 /*
00083  * I'm not documenting these here, since this'll require another
00084  * pass anyway.
00085  */
00086 
00087 typedef SEC_ASN1Template nssASN1Template;
00088 
00089 #define nssASN1_TAG_MASK               SEC_ASN1_TAG_MASK
00090 
00091 #define nssASN1_TAGNUM_MASK            SEC_ASN1_TAGNUM_MASK
00092 #define nssASN1_BOOLEAN                SEC_ASN1_BOOLEAN
00093 #define nssASN1_INTEGER                SEC_ASN1_INTEGER
00094 #define nssASN1_BIT_STRING             SEC_ASN1_BIT_STRING
00095 #define nssASN1_OCTET_STRING           SEC_ASN1_OCTET_STRING
00096 #define nssASN1_NULL                   SEC_ASN1_NULL
00097 #define nssASN1_OBJECT_ID              SEC_ASN1_OBJECT_ID
00098 #define nssASN1_OBJECT_DESCRIPTOR      SEC_ASN1_OBJECT_DESCRIPTOR
00099 /* External type and instance-of type   0x08 */
00100 #define nssASN1_REAL                   SEC_ASN1_REAL
00101 #define nssASN1_ENUMERATED             SEC_ASN1_ENUMERATED
00102 #define nssASN1_EMBEDDED_PDV           SEC_ASN1_EMBEDDED_PDV
00103 #define nssASN1_UTF8_STRING            SEC_ASN1_UTF8_STRING
00104 #define nssASN1_SEQUENCE               SEC_ASN1_SEQUENCE
00105 #define nssASN1_SET                    SEC_ASN1_SET
00106 #define nssASN1_NUMERIC_STRING         SEC_ASN1_NUMERIC_STRING
00107 #define nssASN1_PRINTABLE_STRING       SEC_ASN1_PRINTABLE_STRING
00108 #define nssASN1_T61_STRING             SEC_ASN1_T61_STRING
00109 #define nssASN1_TELETEX_STRING         nssASN1_T61_STRING
00110 #define nssASN1_VIDEOTEX_STRING        SEC_ASN1_VIDEOTEX_STRING
00111 #define nssASN1_IA5_STRING             SEC_ASN1_IA5_STRING
00112 #define nssASN1_UTC_TIME               SEC_ASN1_UTC_TIME
00113 #define nssASN1_GENERALIZED_TIME       SEC_ASN1_GENERALIZED_TIME
00114 #define nssASN1_GRAPHIC_STRING         SEC_ASN1_GRAPHIC_STRING
00115 #define nssASN1_VISIBLE_STRING         SEC_ASN1_VISIBLE_STRING
00116 #define nssASN1_GENERAL_STRING         SEC_ASN1_GENERAL_STRING
00117 #define nssASN1_UNIVERSAL_STRING       SEC_ASN1_UNIVERSAL_STRING
00118 /*                                      0x1d */
00119 #define nssASN1_BMP_STRING             SEC_ASN1_BMP_STRING
00120 #define nssASN1_HIGH_TAG_NUMBER        SEC_ASN1_HIGH_TAG_NUMBER
00121 
00122 #define nssASN1_METHOD_MASK            SEC_ASN1_METHOD_MASK
00123 #define nssASN1_PRIMITIVE              SEC_ASN1_PRIMITIVE
00124 #define nssASN1_CONSTRUCTED            SEC_ASN1_CONSTRUCTED
00125                                                                 
00126 #define nssASN1_CLASS_MASK             SEC_ASN1_CLASS_MASK
00127 #define nssASN1_UNIVERSAL              SEC_ASN1_UNIVERSAL
00128 #define nssASN1_APPLICATION            SEC_ASN1_APPLICATION
00129 #define nssASN1_CONTEXT_SPECIFIC       SEC_ASN1_CONTEXT_SPECIFIC
00130 #define nssASN1_PRIVATE                SEC_ASN1_PRIVATE
00131 
00132 #define nssASN1_OPTIONAL               SEC_ASN1_OPTIONAL 
00133 #define nssASN1_EXPLICIT               SEC_ASN1_EXPLICIT 
00134 #define nssASN1_ANY                    SEC_ASN1_ANY      
00135 #define nssASN1_INLINE                 SEC_ASN1_INLINE   
00136 #define nssASN1_POINTER                SEC_ASN1_POINTER  
00137 #define nssASN1_GROUP                  SEC_ASN1_GROUP    
00138 #define nssASN1_DYNAMIC                SEC_ASN1_DYNAMIC  
00139 #define nssASN1_SKIP                   SEC_ASN1_SKIP     
00140 #define nssASN1_INNER                  SEC_ASN1_INNER    
00141 #define nssASN1_SAVE                   SEC_ASN1_SAVE     
00142 #define nssASN1_MAY_STREAM             SEC_ASN1_MAY_STREAM
00143 #define nssASN1_SKIP_REST              SEC_ASN1_SKIP_REST
00144 #define nssASN1_CHOICE                 SEC_ASN1_CHOICE
00145 
00146 #define nssASN1_SEQUENCE_OF            SEC_ASN1_SEQUENCE_OF 
00147 #define nssASN1_SET_OF                 SEC_ASN1_SET_OF      
00148 #define nssASN1_ANY_CONTENTS           SEC_ASN1_ANY_CONTENTS
00149 
00150 typedef SEC_ASN1TemplateChooserPtr nssASN1ChooseTemplateFunction;
00151 
00152 typedef SEC_ASN1DecoderContext nssASN1Decoder;
00153 typedef SEC_ASN1EncoderContext nssASN1Encoder;
00154 
00155 typedef enum {
00156   nssASN1EncodingPartIdentifier    = SEC_ASN1_Identifier,
00157   nssASN1EncodingPartLength        = SEC_ASN1_Length,
00158   nssASN1EncodingPartContents      = SEC_ASN1_Contents,
00159   nssASN1EncodingPartEndOfContents = SEC_ASN1_EndOfContents
00160 } nssASN1EncodingPart;
00161 
00162 typedef SEC_ASN1NotifyProc nssASN1NotifyFunction;
00163 
00164 typedef SEC_ASN1WriteProc nssASN1EncoderWriteFunction;
00165 typedef SEC_ASN1WriteProc nssASN1DecoderFilterFunction;
00166 
00167 PR_END_EXTERN_C
00168 
00169 #endif /* ASN1T_H */