Import from 1.9a8 tarball
[mozilla-nss.git] / security / nss / lib / libpkix / pkix / top / pkix_build.h
blob5077a505732c0bfbd383611df9b791ae168043d5
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the Netscape security libraries.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Sun Microsystems
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 * pkix_build.h
40 * Header file for buildChain function
44 #ifndef _PKIX_BUILD_H
45 #define _PKIX_BUILD_H
46 #include "pkix_tools.h"
47 #include "pkix_pl_ldapt.h"
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
53 typedef enum {
54 BUILD_SHORTCUTPENDING,
55 BUILD_INITIAL,
56 BUILD_TRYAIA,
57 BUILD_AIAPENDING,
58 BUILD_COLLECTINGCERTS,
59 BUILD_GATHERPENDING,
60 BUILD_CERTVALIDATING,
61 BUILD_ABANDONNODE,
62 BUILD_CRLPREP,
63 BUILD_CRL1,
64 BUILD_DATEPREP,
65 BUILD_CHECKTRUSTED,
66 BUILD_CHECKTRUSTED2,
67 BUILD_ADDTOCHAIN,
68 BUILD_CHECKWITHANCHORS,
69 BUILD_CRL2PREP,
70 BUILD_CRL2,
71 BUILD_VALCHAIN,
72 BUILD_VALCHAIN2,
73 BUILD_EXTENDCHAIN,
74 BUILD_GETNEXTCERT
75 } BuildStatus;
77 typedef struct BuildConstantsStruct BuildConstants;
80 * These fields (the ones that are objects) are not reference-counted
81 * in *each* state, but only in the root, the state that has no parent.
82 * That saves time in creation and destruction of child states, but is
83 * safe enough since they are constants.
85 struct BuildConstantsStruct {
86 PKIX_UInt32 numAnchors;
87 PKIX_UInt32 numCertStores;
88 PKIX_UInt32 numHintCerts;
89 PKIX_UInt32 maxDepth;
90 PKIX_UInt32 maxFanout;
91 PKIX_UInt32 maxTime;
92 PKIX_ProcessingParams *procParams;
93 PKIX_PL_Date *testDate;
94 PKIX_PL_Date *timeLimit;
95 PKIX_PL_Cert *targetCert;
96 PKIX_PL_PublicKey *targetPubKey;
97 PKIX_List *certStores;
98 PKIX_List *anchors;
99 PKIX_List *userCheckers;
100 PKIX_List *hintCerts;
101 PKIX_CertChainChecker *crlChecker;
102 PKIX_PL_AIAMgr *aiaMgr;
105 struct PKIX_ForwardBuilderStateStruct{
106 BuildStatus status;
107 PKIX_Int32 traversedCACerts;
108 PKIX_UInt32 certStoreIndex;
109 PKIX_UInt32 numCerts;
110 PKIX_UInt32 numAias;
111 PKIX_UInt32 certIndex;
112 PKIX_UInt32 aiaIndex;
113 PKIX_UInt32 anchorIndex;
114 PKIX_UInt32 certCheckedIndex;
115 PKIX_UInt32 checkerIndex;
116 PKIX_UInt32 hintCertIndex;
117 PKIX_UInt32 numFanout;
118 PKIX_UInt32 numDepth;
119 PKIX_UInt32 reasonCode;
120 PKIX_Boolean dsaParamsNeeded;
121 PKIX_Boolean revCheckDelayed;
122 PKIX_Boolean canBeCached;
123 PKIX_Boolean useOnlyLocal;
124 PKIX_Boolean alreadyTriedAIA;
125 PKIX_Boolean revChecking;
126 PKIX_Boolean usingHintCerts;
127 PKIX_PL_Date *validityDate;
128 PKIX_PL_Cert *prevCert;
129 PKIX_PL_Cert *candidateCert;
130 PKIX_List *traversedSubjNames;
131 PKIX_List *trustChain;
132 PKIX_List *aia;
133 PKIX_List *candidateCerts;
134 PKIX_List *reversedCertChain;
135 PKIX_List *checkedCritExtOIDs;
136 PKIX_List *checkerChain;
137 PKIX_List *revCheckers;
138 PKIX_CertSelector *certSel;
139 PKIX_VerifyNode *verifyNode;
140 void *client; /* messageHandler, such as LDAPClient */
141 PKIX_ForwardBuilderState *parentState;
142 BuildConstants buildConstants;
145 /* --Private-Functions-------------------------------------------- */
147 PKIX_Error *
148 pkix_ForwardBuilderState_RegisterSelf(void *plContext);
150 PKIX_Error *
151 PKIX_Build_GetNBIOContext(void *state, void **pNBIOContext, void *plContext);
153 #ifdef __cplusplus
155 #endif
157 #endif /* _PKIX_BUILD_H */