OLD | NEW |
| (Empty) |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
4 /* | |
5 * This file defines several platform independent functions to | |
6 * manipulate certificates and CRLs in a portable manner. | |
7 * | |
8 */ | |
9 | |
10 #ifndef _PKIX_PL_PKI_H | |
11 #define _PKIX_PL_PKI_H | |
12 | |
13 #include "pkixt.h" | |
14 #include "seccomon.h" | |
15 #include "certt.h" | |
16 | |
17 #ifdef __cplusplus | |
18 extern "C" { | |
19 #endif | |
20 | |
21 /* General | |
22 * | |
23 * Please refer to the libpkix Programmer's Guide for detailed information | |
24 * about how to use the libpkix library. Certain key warnings and notices from | |
25 * that document are repeated here for emphasis. | |
26 * | |
27 * All identifiers in this file (and all public identifiers defined in | |
28 * libpkix) begin with "PKIX_". Private identifiers only intended for use | |
29 * within the library begin with "pkix_". | |
30 * | |
31 * A function returns NULL upon success, and a PKIX_Error pointer upon failure. | |
32 * | |
33 * Unless otherwise noted, for all accessor (gettor) functions that return a | |
34 * PKIX_PL_Object pointer, callers should assume that this pointer refers to a | |
35 * shared object. Therefore, the caller should treat this shared object as | |
36 * read-only and should not modify this shared object. When done using the | |
37 * shared object, the caller should release the reference to the object by | |
38 * using the PKIX_PL_Object_DecRef function. | |
39 * | |
40 * While a function is executing, if its arguments (or anything referred to by | |
41 * its arguments) are modified, free'd, or destroyed, the function's behavior | |
42 * is undefined. | |
43 * | |
44 */ | |
45 | |
46 /* | |
47 * Cert | |
48 * | |
49 * A Cert represents an X.509 certificate. It can be created using the bytes | |
50 * of a valid ASN.1 DER encoding. Once created, a Cert is immutable. The | |
51 * following functions include accessors (gettors) for the various components | |
52 * of an X.509 certificate. Also included are functions to perform various | |
53 * checks on a certificate, including name constraints, key usage, validity | |
54 * (expiration), and signature verification. | |
55 */ | |
56 | |
57 /* | |
58 * FUNCTION: PKIX_PL_Cert_Create | |
59 * DESCRIPTION: | |
60 * | |
61 * Creates a new certificate using the bytes in the ByteArray pointed to by | |
62 * "byteArray" and stores it at "pCert". If the bytes are not a valid ASN.1 | |
63 * DER encoding of a certificate, a PKIX_Error pointer is returned. Once | |
64 * created, a Cert is immutable. | |
65 * | |
66 * Certificate ::= SEQUENCE { | |
67 * tbsCertificate TBSCertificate, | |
68 * signatureAlgorithm AlgorithmIdentifier, | |
69 * signatureValue BIT STRING } | |
70 * | |
71 * AlgorithmIdentifier ::= SEQUENCE { | |
72 * algorithm OBJECT IDENTIFIER, | |
73 * parameters ANY DEFINED BY algorithm OPTIONAL } | |
74 * | |
75 * TBSCertificate ::= SEQUENCE { | |
76 * version [0] EXPLICIT Version DEFAULT v1, | |
77 * serialNumber CertificateSerialNumber, | |
78 * signature AlgorithmIdentifier, | |
79 * issuer Name, | |
80 * validity Validity, | |
81 * subject Name, | |
82 * subjectPublicKeyInfo SubjectPublicKeyInfo, | |
83 * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, | |
84 * -- If present, version MUST be v2 or v3 | |
85 * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, | |
86 * -- If present, version MUST be v2 or v3 | |
87 * extensions [3] EXPLICIT Extensions OPTIONAL | |
88 * -- If present, version MUST be v3 | |
89 * } | |
90 * | |
91 * Version ::= INTEGER { v1(0), v2(1), v3(2) } | |
92 * | |
93 * CertificateSerialNumber ::= INTEGER | |
94 * | |
95 * Validity ::= SEQUENCE { | |
96 * notBefore Time, | |
97 * notAfter Time } | |
98 * | |
99 * Time ::= CHOICE { | |
100 * utcTime UTCTime, | |
101 * generalTime GeneralizedTime } | |
102 * | |
103 * UniqueIdentifier ::= BIT STRING | |
104 * | |
105 * SubjectPublicKeyInfo ::= SEQUENCE { | |
106 * algorithm AlgorithmIdentifier, | |
107 * subjectPublicKey BIT STRING } | |
108 * | |
109 * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension | |
110 * | |
111 * Extension ::= SEQUENCE { | |
112 * extnID OBJECT IDENTIFIER, | |
113 * critical BOOLEAN DEFAULT FALSE, | |
114 * extnValue OCTET STRING } | |
115 * | |
116 * PARAMETERS: | |
117 * "byteArray" | |
118 * Address of ByteArray representing the CERT's DER encoding. | |
119 * Must be non-NULL. | |
120 * "pCert" | |
121 * Address where object pointer will be stored. Must be non-NULL. | |
122 * "plContext" | |
123 * Platform-specific context pointer. | |
124 * THREAD SAFETY: | |
125 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
126 * RETURNS: | |
127 * Returns NULL if the function succeeds. | |
128 * Returns a Cert Error if the function fails in a non-fatal way. | |
129 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
130 */ | |
131 PKIX_Error * | |
132 PKIX_PL_Cert_Create( | |
133 PKIX_PL_ByteArray *byteArray, | |
134 PKIX_PL_Cert **pCert, | |
135 void *plContext); | |
136 | |
137 /* | |
138 * FUNCTION: PKIX_PL_Cert_CreateFromCERTCertificate | |
139 * DESCRIPTION: | |
140 * | |
141 * Creates a new certificate using passed in CERTCertificate object. | |
142 * | |
143 * PARAMETERS: | |
144 * "nssCert" | |
145 * The object that will be used to create new PKIX_PL_Cert. | |
146 * "pCert" | |
147 * Address where object pointer will be stored. Must be non-NULL. | |
148 * "plContext" | |
149 * Platform-specific context pointer. | |
150 * THREAD SAFETY: | |
151 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
152 * RETURNS: | |
153 * Returns NULL if the function succeeds. | |
154 * Returns a Cert Error if the function fails in a non-fatal way. | |
155 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
156 */ | |
157 PKIX_Error * | |
158 PKIX_PL_Cert_CreateFromCERTCertificate( | |
159 const CERTCertificate *nssCert, | |
160 PKIX_PL_Cert **pCert, | |
161 void *plContext); | |
162 | |
163 /* | |
164 * FUNCTION: PKIX_PL_Cert_GetCERTCertificate | |
165 * DESCRIPTION: | |
166 * | |
167 * Returns underlying CERTCertificate structure. Return CERTCertificate | |
168 * object is duplicated and should be destroyed by caller. | |
169 * | |
170 * PARAMETERS: | |
171 * "cert" | |
172 * Address of PKIX_PL_Cert. Must be non-NULL. | |
173 * "pCert" | |
174 * Address where object pointer will be stored. Must be non-NULL. | |
175 * "plContext" | |
176 * Platform-specific context pointer. | |
177 * THREAD SAFETY: | |
178 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
179 * RETURNS: | |
180 * Returns NULL if the function succeeds. | |
181 * Returns a Cert Error if the function fails in a non-fatal way. | |
182 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
183 */ | |
184 PKIX_Error * | |
185 PKIX_PL_Cert_GetCERTCertificate( | |
186 PKIX_PL_Cert *cert, | |
187 CERTCertificate **pnssCert, | |
188 void *plContext); | |
189 | |
190 /* | |
191 * FUNCTION: PKIX_PL_Cert_GetVersion | |
192 * DESCRIPTION: | |
193 * | |
194 * Retrieves the version of the Cert pointed to by "cert" and stores it at | |
195 * "pVersion". The version number will either be 0, 1, or 2 (corresponding to | |
196 * v1, v2, or v3, respectively). | |
197 * | |
198 * Version ::= INTEGER { v1(0), v2(1), v3(2) } | |
199 * | |
200 * PARAMETERS: | |
201 * "cert" | |
202 * Address of Cert whose version is to be stored. Must be non-NULL. | |
203 * "pVersion" | |
204 * Address where PKIX_UInt32 will be stored. Must be non-NULL. | |
205 * "plContext" | |
206 * Platform-specific context pointer. | |
207 * THREAD SAFETY: | |
208 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
209 * RETURNS: | |
210 * Returns NULL if the function succeeds. | |
211 * Returns a Cert Error if the function fails in a non-fatal way. | |
212 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
213 */ | |
214 PKIX_Error * | |
215 PKIX_PL_Cert_GetVersion( | |
216 PKIX_PL_Cert *cert, | |
217 PKIX_UInt32 *pVersion, | |
218 void *plContext); | |
219 | |
220 /* | |
221 * FUNCTION: PKIX_PL_Cert_GetSerialNumber | |
222 * DESCRIPTION: | |
223 * | |
224 * Retrieves a pointer to the BigInt that represents the serial number of the | |
225 * Cert pointed to by "cert" and stores it at "pSerialNumber". | |
226 * | |
227 * CertificateSerialNumber ::= INTEGER | |
228 * | |
229 * PARAMETERS: | |
230 * "cert" | |
231 * Address of Cert whose serial number is to be stored. Must be non-NULL. | |
232 * "pSerial" | |
233 * Address where object pointer will be stored. Must be non-NULL. | |
234 * "plContext" | |
235 * Platform-specific context pointer. | |
236 * THREAD SAFETY: | |
237 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
238 * RETURNS: | |
239 * Returns NULL if the function succeeds. | |
240 * Returns a Cert Error if the function fails in a non-fatal way. | |
241 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
242 */ | |
243 PKIX_Error * | |
244 PKIX_PL_Cert_GetSerialNumber( | |
245 PKIX_PL_Cert *cert, | |
246 PKIX_PL_BigInt **pSerial, | |
247 void *plContext); | |
248 | |
249 /* | |
250 * FUNCTION: PKIX_PL_Cert_GetIssuer | |
251 * DESCRIPTION: | |
252 * | |
253 * Retrieves a pointer to the X500Name that represents the issuer DN of the | |
254 * Cert pointed to by "cert" and stores it at "pIssuer". | |
255 * | |
256 * PARAMETERS: | |
257 * "cert" | |
258 * Address of Cert whose issuer is to be stored. Must be non-NULL. | |
259 * "pIssuer" | |
260 * Address where object pointer will be stored. Must be non-NULL. | |
261 * "plContext" | |
262 * Platform-specific context pointer. | |
263 * THREAD SAFETY: | |
264 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
265 * RETURNS: | |
266 * Returns NULL if the function succeeds. | |
267 * Returns a Cert Error if the function fails in a non-fatal way. | |
268 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
269 */ | |
270 PKIX_Error * | |
271 PKIX_PL_Cert_GetIssuer( | |
272 PKIX_PL_Cert *cert, | |
273 PKIX_PL_X500Name **pIssuer, | |
274 void *plContext); | |
275 | |
276 /* | |
277 * FUNCTION: PKIX_PL_Cert_GetSubject | |
278 * DESCRIPTION: | |
279 * | |
280 * Retrieves a pointer to the X500Name that represents the subject DN of the | |
281 * Cert pointed to by "cert" and stores it at "pSubject". If the Cert does not | |
282 * have a subject DN, this function stores NULL at "pSubject". | |
283 * | |
284 * PARAMETERS: | |
285 * "cert" | |
286 * Address of Cert whose subject is to be stored. Must be non-NULL. | |
287 * "pSubject" | |
288 * Address where object pointer will be stored. Must be non-NULL. | |
289 * "plContext" | |
290 * Platform-specific context pointer. | |
291 * THREAD SAFETY: | |
292 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
293 * RETURNS: | |
294 * Returns NULL if the function succeeds. | |
295 * Returns a Cert Error if the function fails in a non-fatal way. | |
296 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
297 */ | |
298 PKIX_Error * | |
299 PKIX_PL_Cert_GetSubject( | |
300 PKIX_PL_Cert *cert, | |
301 PKIX_PL_X500Name **pSubject, | |
302 void *plContext); | |
303 | |
304 /* | |
305 * FUNCTION: PKIX_PL_Cert_GetSubjectPublicKeyAlgId | |
306 * DESCRIPTION: | |
307 * | |
308 * Retrieves a pointer to the OID that represents the subject public key | |
309 * algorithm of the Cert pointed to by "cert" and stores it at | |
310 * "pSubjKeyAlgId". | |
311 * | |
312 * SubjectPublicKeyInfo ::= SEQUENCE { | |
313 * algorithm AlgorithmIdentifier, | |
314 * subjectPublicKey BIT STRING } | |
315 * | |
316 * AlgorithmIdentifier ::= SEQUENCE { | |
317 * algorithm OBJECT IDENTIFIER, | |
318 * parameters ANY DEFINED BY algorithm OPTIONAL } | |
319 * | |
320 * PARAMETERS: | |
321 * "cert" | |
322 * Address of Cert whose subject public key algorithm OID is to be stored. | |
323 * Must be non-NULL. | |
324 * "pSubjKeyAlgId" | |
325 * Address where object pointer will be stored. Must be non-NULL. | |
326 * "plContext" | |
327 * Platform-specific context pointer. | |
328 * THREAD SAFETY: | |
329 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
330 * RETURNS: | |
331 * Returns NULL if the function succeeds. | |
332 * Returns a Cert Error if the function fails in a non-fatal way. | |
333 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
334 */ | |
335 PKIX_Error * | |
336 PKIX_PL_Cert_GetSubjectPublicKeyAlgId( | |
337 PKIX_PL_Cert *cert, | |
338 PKIX_PL_OID **pSubjKeyAlgId, | |
339 void *plContext); | |
340 | |
341 /* | |
342 * FUNCTION: PKIX_PL_Cert_GetSubjectPublicKey | |
343 * DESCRIPTION: | |
344 * | |
345 * Retrieves a pointer to the PublicKey that represents the subject public key | |
346 * of the Cert pointed to by "cert" and stores it at "pPublicKey". | |
347 * | |
348 * SubjectPublicKeyInfo ::= SEQUENCE { | |
349 * algorithm AlgorithmIdentifier, | |
350 * subjectPublicKey BIT STRING } | |
351 * | |
352 * PARAMETERS: | |
353 * "cert" | |
354 * Address of Cert whose subject public key is to be stored. | |
355 * Must be non-NULL. | |
356 * "pPublicKey" | |
357 * Address where object pointer will be stored. Must be non-NULL. | |
358 * "plContext" | |
359 * Platform-specific context pointer. | |
360 * THREAD SAFETY: | |
361 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
362 * RETURNS: | |
363 * Returns NULL if the function succeeds. | |
364 * Returns a Cert Error if the function fails in a non-fatal way. | |
365 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
366 */ | |
367 PKIX_Error * | |
368 PKIX_PL_Cert_GetSubjectPublicKey( | |
369 PKIX_PL_Cert *cert, | |
370 PKIX_PL_PublicKey **pPublicKey, | |
371 void *plContext); | |
372 | |
373 /* | |
374 * FUNCTION: PKIX_PL_PublicKey_NeedsDSAParameters | |
375 * DESCRIPTION: | |
376 * | |
377 * Determines if the PublicKey pointed to by "pubKey" is a DSA Key with null | |
378 * parameters and stores the result at "pNeedsParams". | |
379 * | |
380 * PARAMETERS: | |
381 * "pubKey" | |
382 * Address of the Public Key of interest. Must be non-NULL. | |
383 * "pNeedsParams" | |
384 * Address where object pointer will be stored. Must be non-NULL. | |
385 * "plContext" | |
386 * Platform-specific context pointer. | |
387 * THREAD SAFETY: | |
388 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
389 * RETURNS: | |
390 * Returns NULL if the function succeeds. | |
391 * Returns a PublicKey Error if the function fails in a non-fatal way. | |
392 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
393 */ | |
394 PKIX_Error * | |
395 PKIX_PL_PublicKey_NeedsDSAParameters( | |
396 PKIX_PL_PublicKey *pubKey, | |
397 PKIX_Boolean *pNeedsParams, | |
398 void *plContext); | |
399 | |
400 /* | |
401 * FUNCTION: PKIX_PL_PublicKey_MakeInheritedDSAPublicKey | |
402 * DESCRIPTION: | |
403 * | |
404 * This function is used for DSA key parameter inheritance, which allows a | |
405 * first DSA key with omitted parameters (pointed to by "firstKey") to inherit | |
406 * the PQG parameters of a second DSA key that does have parameters. (pointed | |
407 * to by "secondKey"). Once created, a PublicKey is immutable. | |
408 * | |
409 * Specifically, the algorithm used by the function is: | |
410 * | |
411 * If the first PublicKey is not a DSA public key with omitted parameters, | |
412 * the function stores NULL at "pResultKey". (No Error is returned) | |
413 * Else if the second PublicKey is not a DSA public key with non-NULL, | |
414 * parameters, the function returns an Error. | |
415 * Else | |
416 * the function creates a third PublicKey with a "Y" value from the | |
417 * first PublicKey and the DSA parameters from the second PublicKey, | |
418 * and stores it at "pResultKey". | |
419 * | |
420 * PARAMETERS: | |
421 * "firstKey" | |
422 * Address of a Public Key that needs to inherit DSA parameters. | |
423 * Must be non-NULL. | |
424 * "secondKey" | |
425 * Address of a Public Key that has DSA parameters that will be inherited | |
426 * by "firstKey". Must be non-NULL. | |
427 * "pResultKey" | |
428 * Address where object pointer will be stored. Must be non-NULL. | |
429 * "plContext" | |
430 * Platform-specific context pointer. | |
431 * THREAD SAFETY: | |
432 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
433 * RETURNS: | |
434 * Returns NULL if the function succeeds. | |
435 * Returns a PublicKey Error if the function fails in a non-fatal way. | |
436 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
437 */ | |
438 PKIX_Error * | |
439 PKIX_PL_PublicKey_MakeInheritedDSAPublicKey( | |
440 PKIX_PL_PublicKey *firstKey, | |
441 PKIX_PL_PublicKey *secondKey, | |
442 PKIX_PL_PublicKey **pResultKey, | |
443 void *plContext); | |
444 | |
445 /* | |
446 * FUNCTION: PKIX_PL_Cert_GetCriticalExtensionOIDs | |
447 * DESCRIPTION: | |
448 * | |
449 * Retrieves a pointer to the List of OIDs (each OID corresponding to a | |
450 * critical extension of the Cert pointed to by "cert") and stores it at | |
451 * "pExtensions". If "cert" does not have any critical extensions, this | |
452 * function stores an empty List at "pExtensions". | |
453 * | |
454 * Note that the List returned by this function is immutable. | |
455 * | |
456 * PARAMETERS: | |
457 * "cert" | |
458 * Address of Cert whose critical extension OIDs are to be stored. | |
459 * Must be non-NULL. | |
460 * "pExtensions" | |
461 * Address where object pointer will be stored. Must be non-NULL. | |
462 * "plContext" | |
463 * Platform-specific context pointer. | |
464 * THREAD SAFETY: | |
465 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
466 * RETURNS: | |
467 * Returns NULL if the function succeeds. | |
468 * Returns a Cert Error if the function fails in a non-fatal way. | |
469 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
470 */ | |
471 PKIX_Error * | |
472 PKIX_PL_Cert_GetCriticalExtensionOIDs( | |
473 PKIX_PL_Cert *cert, | |
474 PKIX_List **pExtensions, /* list of PKIX_PL_OID */ | |
475 void *plContext); | |
476 | |
477 /* | |
478 * FUNCTION: PKIX_PL_Cert_GetAuthorityKeyIdentifier | |
479 * DESCRIPTION: | |
480 * | |
481 * Retrieves a pointer to a ByteArray representing the authority key | |
482 * identifier extension of the Cert pointed to by "cert" and stores it at | |
483 * "pAuthKeyId". | |
484 * | |
485 * Note that this function only retrieves the keyIdentifier component | |
486 * (OCTET STRING) of the AuthorityKeyIdentifier extension, when present. | |
487 * | |
488 * If "cert" does not have an AuthorityKeyIdentifier extension or if the | |
489 * keyIdentifier component of the AuthorityKeyIdentifier extension is not | |
490 * present, this function stores NULL at "pAuthKeyId". | |
491 * | |
492 * AuthorityKeyIdentifier ::= SEQUENCE { | |
493 * keyIdentifier [0] KeyIdentifier OPTIONAL, | |
494 * authorityCertIssuer [1] GeneralNames OPTIONAL, | |
495 * authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL } | |
496 * | |
497 * PARAMETERS: | |
498 * "cert" | |
499 * Address of Cert whose authority key identifier is to be stored. | |
500 * Must be non-NULL. | |
501 * "pAuthKeyId" | |
502 * Address where object pointer will be stored. Must be non-NULL. | |
503 * "plContext" | |
504 * Platform-specific context pointer. | |
505 * THREAD SAFETY: | |
506 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
507 * RETURNS: | |
508 * Returns NULL if the function succeeds. | |
509 * Returns a Cert Error if the function fails in a non-fatal way. | |
510 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
511 */ | |
512 PKIX_Error * | |
513 PKIX_PL_Cert_GetAuthorityKeyIdentifier( | |
514 PKIX_PL_Cert *cert, | |
515 PKIX_PL_ByteArray **pAuthKeyId, | |
516 void *plContext); | |
517 | |
518 /* | |
519 * FUNCTION: PKIX_PL_Cert_GetSubjectKeyIdentifier | |
520 * DESCRIPTION: | |
521 * | |
522 * Retrieves a pointer to a ByteArray representing the subject key identifier | |
523 * extension of the Cert pointed to by "cert" and stores it at "pSubjKeyId". | |
524 * If "cert" does not have a SubjectKeyIdentifier extension, this function | |
525 * stores NULL at "pSubjKeyId". | |
526 * | |
527 * SubjectKeyIdentifier ::= KeyIdentifier | |
528 * | |
529 * PARAMETERS: | |
530 * "cert" | |
531 * Address of Cert whose subject key identifier is to be stored. | |
532 * Must be non-NULL. | |
533 * "pSubjKeyId" | |
534 * Address where object pointer will be stored. Must be non-NULL. | |
535 * "plContext" | |
536 * Platform-specific context pointer. | |
537 * THREAD SAFETY: | |
538 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
539 * RETURNS: | |
540 * Returns NULL if the function succeeds. | |
541 * Returns a Cert Error if the function fails in a non-fatal way. | |
542 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
543 */ | |
544 PKIX_Error * | |
545 PKIX_PL_Cert_GetSubjectKeyIdentifier( | |
546 PKIX_PL_Cert *cert, | |
547 PKIX_PL_ByteArray **pSubjKeyId, | |
548 void *plContext); | |
549 | |
550 /* | |
551 * FUNCTION: PKIX_PL_Cert_GetSubjectAltNames | |
552 * DESCRIPTION: | |
553 * | |
554 * Retrieves a pointer to the List of GeneralNames (each GeneralName | |
555 * representing a subject alternative name found in the subject alternative | |
556 * names extension of the Cert pointed to by "cert") and stores it at | |
557 * "pSubjectAltNames". If "cert" does not have a SubjectAlternativeNames | |
558 * extension, this function stores NULL at "pSubjectAltNames". | |
559 * | |
560 * Note that the List returned by this function is immutable. | |
561 * | |
562 * SubjectAltName ::= GeneralNames | |
563 * | |
564 * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName | |
565 * | |
566 * GeneralName ::= CHOICE { | |
567 * otherName [0] OtherName, | |
568 * rfc822Name [1] IA5String, | |
569 * dNSName [2] IA5String, | |
570 * x400Address [3] ORAddress, | |
571 * directoryName [4] Name, | |
572 * ediPartyName [5] EDIPartyName, | |
573 * uniformResourceIdentifier [6] IA5String, | |
574 * iPAddress [7] OCTET STRING, | |
575 * registeredID [8] OBJECT IDENTIFIER } | |
576 * | |
577 * OtherName ::= SEQUENCE { | |
578 * type-id OBJECT IDENTIFIER, | |
579 * value [0] EXPLICIT ANY DEFINED BY type-id } | |
580 * | |
581 * EDIPartyName ::= SEQUENCE { | |
582 * nameAssigner [0] DirectoryString OPTIONAL, | |
583 * partyName [1] DirectoryString } | |
584 * | |
585 * PARAMETERS: | |
586 * "cert" | |
587 * Address of Cert whose subjectAltNames are to be stored. | |
588 * Must be non-NULL. | |
589 * "pSubjectAltNames" | |
590 * Address where object pointer will be stored. Must be non-NULL. | |
591 * "plContext" | |
592 * Platform-specific context pointer. | |
593 * THREAD SAFETY: | |
594 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
595 * RETURNS: | |
596 * Returns NULL if the function succeeds. | |
597 * Returns a Cert Error if the function fails in a non-fatal way. | |
598 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
599 */ | |
600 PKIX_Error * | |
601 PKIX_PL_Cert_GetSubjectAltNames( | |
602 PKIX_PL_Cert *cert, | |
603 PKIX_List **pSubjectAltNames, /* list of PKIX_PL_GeneralName */ | |
604 void *plContext); | |
605 | |
606 /* | |
607 * FUNCTION: PKIX_PL_Cert_GetAllSubjectNames | |
608 * DESCRIPTION: | |
609 * | |
610 * Retrieves a pointer to the List of GeneralNames (each GeneralName | |
611 * representing a subject DN or a subject alternative name found in the | |
612 * subject alternative names extension of the Cert pointed to by "cert") and | |
613 * stores it at "pAllSubjectNames".If the Subject DN of "cert" is empty and | |
614 * it does not have a SubjectAlternativeNames extension, this function stores | |
615 * NULL at "pAllSubjectNames". | |
616 * | |
617 * Note that the List returned by this function is immutable. | |
618 * | |
619 * PARAMETERS: | |
620 * "cert" | |
621 * Address of Cert whose subject DN and subjectAltNames are to be stored. | |
622 * Must be non-NULL. | |
623 * "pAllSubjectNames" | |
624 * Address where object pointer will be stored. Must be non-NULL. | |
625 * "plContext" | |
626 * Platform-specific context pointer. | |
627 * THREAD SAFETY: | |
628 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
629 * RETURNS: | |
630 * Returns NULL if the function succeeds. | |
631 * Returns a Cert Error if the function fails in a non-fatal way. | |
632 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
633 */ | |
634 PKIX_Error * | |
635 PKIX_PL_Cert_GetAllSubjectNames( | |
636 PKIX_PL_Cert *cert, | |
637 PKIX_List **pAllSubjectNames, /* list of PKIX_PL_GeneralName */ | |
638 void *plContext); | |
639 | |
640 /* | |
641 * FUNCTION: PKIX_PL_Cert_GetExtendedKeyUsage | |
642 * DESCRIPTION: | |
643 * | |
644 * Retrieves a pointer to a List of OIDs (each OID corresponding to an | |
645 * extended key usage of the Cert pointed to by "cert") and stores it at | |
646 * "pKeyUsage". If "cert" does not have an extended key usage extension, this | |
647 * function stores a NULL at "pKeyUsage". | |
648 * | |
649 * Note that the List returned by this function is immutable. | |
650 * | |
651 * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId | |
652 * | |
653 * KeyPurposeId ::= OBJECT IDENTIFIER | |
654 * | |
655 * PARAMETERS: | |
656 * "cert" | |
657 * Address of Cert whose extended key usage OIDs are to be stored. | |
658 * Must be non-NULL. | |
659 * "pKeyUsage" | |
660 * Address where object pointer will be stored. Must be non-NULL. | |
661 * "plContext" | |
662 * Platform-specific context pointer. | |
663 * THREAD SAFETY: | |
664 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
665 * RETURNS: | |
666 * Returns NULL if the function succeeds. | |
667 * Returns a Cert Error if the function fails in a non-fatal way. | |
668 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
669 */ | |
670 PKIX_Error * | |
671 PKIX_PL_Cert_GetExtendedKeyUsage( | |
672 PKIX_PL_Cert *cert, | |
673 PKIX_List **pKeyUsage, /* list of PKIX_PL_OID */ | |
674 void *plContext); | |
675 | |
676 /* | |
677 * FUNCTION: PKIX_PL_Cert_GetNameConstraints | |
678 * DESCRIPTION: | |
679 * | |
680 * Retrieves a pointer to a CertNameConstraints object representing the name | |
681 * constraints extension of the Cert pointed to by "cert" and stores it at | |
682 * "pNameConstraints". | |
683 * | |
684 * If "cert" does not have a name constraints extension, this function stores | |
685 * NULL at "pNameConstraints". | |
686 * | |
687 * NameConstraints ::= SEQUENCE { | |
688 * permittedSubtrees [0] GeneralSubtrees OPTIONAL, | |
689 * excludedSubtrees [1] GeneralSubtrees OPTIONAL } | |
690 * | |
691 * GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree | |
692 * | |
693 * GeneralSubtree ::= SEQUENCE { | |
694 * base GeneralName, | |
695 * minimum [0] BaseDistance DEFAULT 0, | |
696 * maximum [1] BaseDistance OPTIONAL } | |
697 * | |
698 * BaseDistance ::= INTEGER (0..MAX) | |
699 * | |
700 * PARAMETERS: | |
701 * "cert" | |
702 * Address of Cert whose name constraints extension is to be stored. | |
703 * Must be non-NULL. | |
704 * "pNameConstraints" | |
705 * Address where object pointer will be stored. Must be non-NULL. | |
706 * "plContext" | |
707 * Platform-specific context pointer. | |
708 * THREAD SAFETY: | |
709 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
710 * RETURNS: | |
711 * Returns NULL if the function succeeds. | |
712 * Returns a Cert Error if the function fails in a non-fatal way. | |
713 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
714 */ | |
715 PKIX_Error * | |
716 PKIX_PL_Cert_GetNameConstraints( | |
717 PKIX_PL_Cert *cert, | |
718 PKIX_PL_CertNameConstraints **pNameConstraints, | |
719 void *plContext); | |
720 | |
721 /* | |
722 * FUNCTION: PKIX_PL_Cert_GetBasicConstraints | |
723 * DESCRIPTION: | |
724 * | |
725 * Retrieves a pointer to a CertBasicConstraints object representing the basic | |
726 * constraints extension of the Cert pointed to by "cert" and stores it at | |
727 * "pBasicConstraints". | |
728 * | |
729 * If "cert" does not have a basic constraints extension, this function stores | |
730 * NULL at "pBasicConstraints". Once created, a CertBasicConstraints object | |
731 * is immutable. | |
732 * | |
733 * BasicConstraints ::= SEQUENCE { | |
734 * cA BOOLEAN DEFAULT FALSE, | |
735 * pathLenConstraint INTEGER (0..MAX) OPTIONAL } | |
736 * | |
737 * PARAMETERS: | |
738 * "cert" | |
739 * Address of Cert whose basic constraints extension is to be stored. | |
740 * Must be non-NULL. | |
741 * "pBasicConstraints" | |
742 * Address where object pointer will be stored. Must be non-NULL. | |
743 * "plContext" | |
744 * Platform-specific context pointer. | |
745 * THREAD SAFETY: | |
746 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
747 * RETURNS: | |
748 * Returns NULL if the function succeeds. | |
749 * Returns a Cert Error if the function fails in a non-fatal way. | |
750 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
751 */ | |
752 PKIX_Error * | |
753 PKIX_PL_Cert_GetBasicConstraints( | |
754 PKIX_PL_Cert *cert, | |
755 PKIX_PL_CertBasicConstraints **pBasicConstraints, | |
756 void *plContext); | |
757 | |
758 /* | |
759 * FUNCTION: PKIX_PL_BasicConstraints_GetCAFlag | |
760 * DESCRIPTION: | |
761 * | |
762 * Retrieves a pointer to a Boolean value representing the cA Flag component | |
763 * of the CertBasicConstraints object pointed to by "basicConstraints" and | |
764 * stores it at "pResult". | |
765 * | |
766 * BasicConstraints ::= SEQUENCE { | |
767 * cA BOOLEAN DEFAULT FALSE, | |
768 * pathLenConstraint INTEGER (0..MAX) OPTIONAL } | |
769 * | |
770 * PARAMETERS: | |
771 * "basicConstraints" | |
772 * Address of CertBasicConstraints whose cA Flag is to be stored. | |
773 * Must be non-NULL. | |
774 * "pResult" | |
775 * Address where object pointer will be stored. Must be non-NULL. | |
776 * "plContext" | |
777 * Platform-specific context pointer. | |
778 * THREAD SAFETY: | |
779 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
780 * RETURNS: | |
781 * Returns NULL if the function succeeds. | |
782 * Returns a Cert Error if the function fails in a non-fatal way. | |
783 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
784 */ | |
785 PKIX_Error * | |
786 PKIX_PL_BasicConstraints_GetCAFlag( | |
787 PKIX_PL_CertBasicConstraints *basicConstraints, | |
788 PKIX_Boolean *pResult, | |
789 void *plContext); | |
790 | |
791 /* | |
792 * FUNCTION: PKIX_PL_BasicConstraints_GetPathLenConstraint | |
793 * DESCRIPTION: | |
794 * | |
795 * Retrieves a pointer to an integer value representing the pathLenConstraint | |
796 * component of the CertBasicConstraints object pointed to by | |
797 * "basicConstraints" and stores it at "pPathLenConstraint". If the | |
798 * pathLenConstraint component is not present, this function stores -1 at | |
799 * "pPathLenConstraint". | |
800 * | |
801 * PARAMETERS: | |
802 * "basicConstraints" | |
803 * Address of CertBasicConstraints whose pathLen is to be stored. | |
804 * Must be non-NULL. | |
805 * "pPathLenConstraint" | |
806 * Address where PKIX_Int32 will be stored. Must be non-NULL. | |
807 * "plContext" | |
808 * Platform-specific context pointer. | |
809 * THREAD SAFETY: | |
810 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
811 * RETURNS: | |
812 * Returns NULL if the function succeeds. | |
813 * Returns a Cert Error if the function fails in a non-fatal way. | |
814 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
815 */ | |
816 PKIX_Error * | |
817 PKIX_PL_BasicConstraints_GetPathLenConstraint( | |
818 PKIX_PL_CertBasicConstraints *basicConstraints, | |
819 PKIX_Int32 *pPathLenConstraint, | |
820 void *plContext); | |
821 | |
822 /* | |
823 * FUNCTION: PKIX_PL_Cert_GetPolicyInformation | |
824 * DESCRIPTION: | |
825 * | |
826 * Retrieves a pointer to a List of CertPolicyInfos found in the certificate | |
827 * policies extension of the Cert pointed to by "cert" and stores it at | |
828 * "pPolicyInfo". If "cert" does not have a certificate policies extension, | |
829 * this function stores NULL at "pPolicyInfo". Once created, a CertPolicyInfo | |
830 * object is immutable. | |
831 * | |
832 * Note that the List returned by this function is immutable. | |
833 * | |
834 * certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation | |
835 * | |
836 * PolicyInformation ::= SEQUENCE { | |
837 * policyIdentifier CertPolicyId, | |
838 * policyQualifiers SEQUENCE SIZE (1..MAX) OF | |
839 * PolicyQualifierInfo OPTIONAL } | |
840 * | |
841 * PARAMETERS: | |
842 * "cert" | |
843 * Address of Cert whose CertPolicyInfos are to be stored. | |
844 * Must be non-NULL. | |
845 * "pPolicyInfo" | |
846 * Address where object pointer will be stored. Must be non-NULL. | |
847 * "plContext" | |
848 * Platform-specific context pointer. | |
849 * THREAD SAFETY: | |
850 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
851 * RETURNS: | |
852 * Returns NULL if the function succeeds. | |
853 * Returns a Cert Error if the function fails in a non-fatal way. | |
854 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
855 */ | |
856 PKIX_Error * | |
857 PKIX_PL_Cert_GetPolicyInformation( | |
858 PKIX_PL_Cert *cert, | |
859 PKIX_List **pPolicyInfo, /* list of PKIX_PL_CertPolicyInfo */ | |
860 void *plContext); | |
861 | |
862 /* | |
863 * FUNCTION: PKIX_PL_CertPolicyInfo_GetPolicyId | |
864 * DESCRIPTION: | |
865 * | |
866 * Retrieves a pointer to an OID representing the policyIdentifier of the | |
867 * CertPolicyInfo pointed to by "policyInfo" and stores it at "pCertPolicyId". | |
868 * | |
869 * certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation | |
870 * | |
871 * PolicyInformation ::= SEQUENCE { | |
872 * policyIdentifier CertPolicyId, | |
873 * policyQualifiers SEQUENCE SIZE (1..MAX) OF | |
874 * PolicyQualifierInfo OPTIONAL } | |
875 * | |
876 * CertPolicyId ::= OBJECT IDENTIFIER | |
877 * | |
878 * PARAMETERS: | |
879 * "policyInfo" | |
880 * Address of CertPolicyInfo whose policy identifier is to be stored. | |
881 * Must be non-NULL. | |
882 * "pCertPolicyId" | |
883 * Address where object pointer will be stored. Must be non-NULL. | |
884 * "plContext" | |
885 * Platform-specific context pointer. | |
886 * THREAD SAFETY: | |
887 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
888 * RETURNS: | |
889 * Returns NULL if the function succeeds. | |
890 * Returns a Cert Error if the function fails in a non-fatal way. | |
891 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
892 */ | |
893 PKIX_Error * | |
894 PKIX_PL_CertPolicyInfo_GetPolicyId( | |
895 PKIX_PL_CertPolicyInfo *policyInfo, | |
896 PKIX_PL_OID **pCertPolicyId, | |
897 void *plContext); | |
898 | |
899 /* | |
900 * FUNCTION: PKIX_PL_CertPolicyInfo_GetPolQualifiers | |
901 * DESCRIPTION: | |
902 * | |
903 * Retrieves a pointer to a List of the CertPolicyQualifiers representing | |
904 * the policyQualifiers of the CertPolicyInfo pointed to by "policyInfo" and | |
905 * stores it at "pPolicyQualifiers". If "policyInfo" does not have any | |
906 * policyQualifiers, this function stores NULL at "pPolicyQualifiers". Once | |
907 * created, a CertPolicyQualifier is immutable. | |
908 * | |
909 * Note that the List returned by this function is immutable. | |
910 * | |
911 * certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation | |
912 * | |
913 * PolicyInformation ::= SEQUENCE { | |
914 * policyIdentifier CertPolicyId, | |
915 * policyQualifiers SEQUENCE SIZE (1..MAX) OF | |
916 * PolicyQualifierInfo OPTIONAL } | |
917 * | |
918 * PolicyQualifierInfo ::= SEQUENCE { | |
919 * policyQualifierId PolicyQualifierId, | |
920 * qualifier ANY DEFINED BY policyQualifierId } | |
921 * | |
922 * PARAMETERS: | |
923 * "policyInfo" | |
924 * Address of CertPolicyInfo whose policy qualifiers List is to be stored. | |
925 * Must be non-NULL. | |
926 * "pPolicyQualifiers" | |
927 * Address where object pointer will be stored. Must be non-NULL. | |
928 * "plContext" | |
929 * Platform-specific context pointer. | |
930 * THREAD SAFETY: | |
931 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
932 * RETURNS: | |
933 * Returns NULL if the function succeeds. | |
934 * Returns a Cert Error if the function fails in a non-fatal way. | |
935 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
936 */ | |
937 PKIX_Error * | |
938 PKIX_PL_CertPolicyInfo_GetPolQualifiers( | |
939 PKIX_PL_CertPolicyInfo *policyInfo, | |
940 PKIX_List **pPolicyQualifiers, /* list of PKIX_PL_CertPolicyQualifier */ | |
941 void *plContext); | |
942 | |
943 /* | |
944 * FUNCTION: PKIX_PL_PolicyQualifier_GetPolicyQualifierId | |
945 * DESCRIPTION: | |
946 * | |
947 * Retrieves a pointer to an OID representing the policyQualifierId of the | |
948 * CertPolicyQualifier pointed to by "policyQualifier" and stores it at | |
949 * "pPolicyQualifierId". | |
950 * | |
951 * PolicyQualifierInfo ::= SEQUENCE { | |
952 * policyQualifierId PolicyQualifierId, | |
953 * qualifier ANY DEFINED BY policyQualifierId } | |
954 * | |
955 * PolicyQualifierId ::= | |
956 * OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice ) | |
957 * | |
958 * PARAMETERS: | |
959 * "policyQualifier" | |
960 * Address of CertPolQualifier whose policyQualifierId is to be stored. | |
961 * Must be non-NULL. | |
962 * "pPolicyQualifierId" | |
963 * Address where object pointer will be stored. Must be non-NULL. | |
964 * "plContext" | |
965 * Platform-specific context pointer. | |
966 * THREAD SAFETY: | |
967 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
968 * RETURNS: | |
969 * Returns NULL if the function succeeds. | |
970 * Returns a Cert Error if the function fails in a non-fatal way. | |
971 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
972 */ | |
973 PKIX_Error * | |
974 PKIX_PL_PolicyQualifier_GetPolicyQualifierId( | |
975 PKIX_PL_CertPolicyQualifier *policyQualifier, | |
976 PKIX_PL_OID **pPolicyQualifierId, | |
977 void *plContext); | |
978 | |
979 /* | |
980 * FUNCTION: PKIX_PL_PolicyQualifier_GetQualifier | |
981 * DESCRIPTION: | |
982 * | |
983 * Retrieves a pointer to a ByteArray representing the qualifier of the | |
984 * CertPolicyQualifier pointed to by "policyQualifier" and stores it at | |
985 * "pQualifier". | |
986 * | |
987 * PolicyQualifierInfo ::= SEQUENCE { | |
988 * policyQualifierId PolicyQualifierId, | |
989 * qualifier ANY DEFINED BY policyQualifierId } | |
990 * | |
991 * PARAMETERS: | |
992 * "policyQualifier" | |
993 * Address of CertPolicyQualifier whose qualifier is to be stored. | |
994 * Must be non-NULL. | |
995 * "pQualifier" | |
996 * Address where object pointer will be stored. Must be non-NULL. | |
997 * "plContext" | |
998 * Platform-specific context pointer. | |
999 * THREAD SAFETY: | |
1000 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1001 * RETURNS: | |
1002 * Returns NULL if the function succeeds. | |
1003 * Returns a Cert Error if the function fails in a non-fatal way. | |
1004 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1005 */ | |
1006 PKIX_Error * | |
1007 PKIX_PL_PolicyQualifier_GetQualifier( | |
1008 PKIX_PL_CertPolicyQualifier *policyQualifier, | |
1009 PKIX_PL_ByteArray **pQualifier, | |
1010 void *plContext); | |
1011 | |
1012 /* | |
1013 * FUNCTION: PKIX_PL_Cert_GetPolicyMappings | |
1014 * DESCRIPTION: | |
1015 * | |
1016 * Retrieves a pointer to a List of CertPolicyMaps found in the policy | |
1017 * mappings extension of the Cert pointed to by "cert" and stores it at | |
1018 * "pPolicyMappings". If "cert" does not have a policy mappings extension, | |
1019 * this function stores NULL at "pPolicyMappings". Once created, a | |
1020 * CertPolicyMap is immutable. | |
1021 * | |
1022 * Note that the List returned by this function is immutable. | |
1023 * | |
1024 * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE { | |
1025 * issuerDomainPolicy CertPolicyId, | |
1026 * subjectDomainPolicy CertPolicyId } | |
1027 * | |
1028 * PARAMETERS: | |
1029 * "cert" | |
1030 * Address of Cert whose CertPolicyMaps are to be stored. | |
1031 * Must be non-NULL. | |
1032 * "pPolicyMappings" | |
1033 * Address where object pointer will be stored. Must be non-NULL. | |
1034 * "plContext" | |
1035 * Platform-specific context pointer. | |
1036 * THREAD SAFETY: | |
1037 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1038 * RETURNS: | |
1039 * Returns NULL if the function succeeds. | |
1040 * Returns a Cert Error if the function fails in a non-fatal way. | |
1041 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1042 */ | |
1043 PKIX_Error * | |
1044 PKIX_PL_Cert_GetPolicyMappings( | |
1045 PKIX_PL_Cert *cert, | |
1046 PKIX_List **pPolicyMappings, /* list of PKIX_PL_CertPolicyMap */ | |
1047 void *plContext); | |
1048 | |
1049 /* | |
1050 * FUNCTION: PKIX_PL_CertPolicyMap_GetIssuerDomainPolicy | |
1051 * DESCRIPTION: | |
1052 * | |
1053 * Retrieves a pointer to an OID representing the issuerDomainPolicy of the | |
1054 * CertPolicyMap pointed to by "policyMapping" and stores it at | |
1055 * "pIssuerDomainPolicy". | |
1056 * | |
1057 * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE { | |
1058 * issuerDomainPolicy CertPolicyId, | |
1059 * subjectDomainPolicy CertPolicyId } | |
1060 * | |
1061 * PARAMETERS: | |
1062 * "policyMapping" | |
1063 * Address of CertPolicyMap whose issuerDomainPolicy is to be stored. | |
1064 * Must be non-NULL. | |
1065 * "pIssuerDomainPolicy" | |
1066 * Address where object pointer will be stored. Must be non-NULL. | |
1067 * "plContext" | |
1068 * Platform-specific context pointer. | |
1069 * THREAD SAFETY: | |
1070 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1071 * RETURNS: | |
1072 * Returns NULL if the function succeeds. | |
1073 * Returns a Cert Error if the function fails in a non-fatal way. | |
1074 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1075 */ | |
1076 PKIX_Error * | |
1077 PKIX_PL_CertPolicyMap_GetIssuerDomainPolicy( | |
1078 PKIX_PL_CertPolicyMap *policyMapping, | |
1079 PKIX_PL_OID **pIssuerDomainPolicy, | |
1080 void *plContext); | |
1081 | |
1082 /* | |
1083 * FUNCTION: PKIX_PL_CertPolicyMap_GetSubjectDomainPolicy | |
1084 * DESCRIPTION: | |
1085 * | |
1086 * Retrieves a pointer to an OID representing the subjectDomainPolicy of the | |
1087 * CertPolicyMap pointed to by "policyMapping" and stores it at | |
1088 * "pSubjectDomainPolicy". | |
1089 * | |
1090 * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE { | |
1091 * issuerDomainPolicy CertPolicyId, | |
1092 * subjectDomainPolicy CertPolicyId } | |
1093 * | |
1094 * PARAMETERS: | |
1095 * "policyMapping" | |
1096 * Address of CertPolicyMap whose subjectDomainPolicy is to be stored. | |
1097 * Must be non-NULL. | |
1098 * "pSubjectDomainPolicy" | |
1099 * Address where object pointer will be stored. Must be non-NULL. | |
1100 * "plContext" | |
1101 * Platform-specific context pointer. | |
1102 * THREAD SAFETY: | |
1103 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1104 * RETURNS: | |
1105 * Returns NULL if the function succeeds. | |
1106 * Returns a Cert Error if the function fails in a non-fatal way. | |
1107 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1108 */ | |
1109 PKIX_Error * | |
1110 PKIX_PL_CertPolicyMap_GetSubjectDomainPolicy( | |
1111 PKIX_PL_CertPolicyMap *policyMapping, | |
1112 PKIX_PL_OID **pSubjectDomainPolicy, | |
1113 void *plContext); | |
1114 | |
1115 /* | |
1116 * FUNCTION: PKIX_PL_Cert_GetRequireExplicitPolicy | |
1117 * DESCRIPTION: | |
1118 * | |
1119 * Retrieves the requireExplicitPolicy value of the policy constraints | |
1120 * extension of the Cert pointed to by "cert" and stores it at "pSkipCerts". | |
1121 * If "cert" does not have a policy constraints extension or the | |
1122 * requireExplicitPolicy component is not populated, this function stores -1 | |
1123 * at "pSkipCerts". | |
1124 * | |
1125 * PolicyConstraints ::= SEQUENCE { | |
1126 * requireExplicitPolicy [0] SkipCerts OPTIONAL, | |
1127 * inhibitPolicyMapping [1] SkipCerts OPTIONAL } | |
1128 * | |
1129 * SkipCerts ::= INTEGER (0..MAX) | |
1130 * | |
1131 * PARAMETERS: | |
1132 * "cert" | |
1133 * Address of Cert whose requireExplicitPolicy value is to be stored. | |
1134 * Must be non-NULL. | |
1135 * "pSkipCerts" | |
1136 * Address where PKIX_Int32 will be stored. Must be non-NULL. | |
1137 * "plContext" | |
1138 * Platform-specific context pointer. | |
1139 * THREAD SAFETY: | |
1140 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1141 * RETURNS: | |
1142 * Returns NULL if the function succeeds. | |
1143 * Returns a Cert Error if the function fails in a non-fatal way. | |
1144 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1145 */ | |
1146 PKIX_Error * | |
1147 PKIX_PL_Cert_GetRequireExplicitPolicy( | |
1148 PKIX_PL_Cert *cert, | |
1149 PKIX_Int32 *pSkipCerts, | |
1150 void *plContext); | |
1151 | |
1152 /* | |
1153 * FUNCTION: PKIX_PL_Cert_GetPolicyMappingInhibited | |
1154 * DESCRIPTION: | |
1155 * | |
1156 * Retrieves the inhibitPolicyMapping value of the policy constraints | |
1157 * extension of the Cert pointed to by "cert" and stores it at "pSkipCerts". | |
1158 * If "cert" does not have a policy constraints extension or the | |
1159 * inhibitPolicyMapping component is not populated, this function stores -1 | |
1160 * at "pSkipCerts". | |
1161 * | |
1162 * PolicyConstraints ::= SEQUENCE { | |
1163 * requireExplicitPolicy [0] SkipCerts OPTIONAL, | |
1164 * inhibitPolicyMapping [1] SkipCerts OPTIONAL } | |
1165 * | |
1166 * SkipCerts ::= INTEGER (0..MAX) | |
1167 * | |
1168 * PARAMETERS: | |
1169 * "cert" | |
1170 * Address of Cert whose requireExplicitPolicy value is to be stored. | |
1171 * Must be non-NULL. | |
1172 * "pSkipCerts" | |
1173 * Address where PKIX_Int32 will be stored. Must be non-NULL. | |
1174 * "plContext" | |
1175 * Platform-specific context pointer. | |
1176 * THREAD SAFETY: | |
1177 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1178 * RETURNS: | |
1179 * Returns NULL if the function succeeds. | |
1180 * Returns a Cert Error if the function fails in a non-fatal way. | |
1181 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1182 */ | |
1183 PKIX_Error * | |
1184 PKIX_PL_Cert_GetPolicyMappingInhibited( | |
1185 PKIX_PL_Cert *cert, | |
1186 PKIX_Int32 *pSkipCerts, | |
1187 void *plContext); | |
1188 | |
1189 /* | |
1190 * FUNCTION: PKIX_PL_Cert_GetInhibitAnyPolicy | |
1191 * DESCRIPTION: | |
1192 * | |
1193 * Retrieves the value of the inhibit any-policy extension of the Cert | |
1194 * pointed to by "cert" and stores it at "pSkipCerts". If "cert" does not have | |
1195 * an inhibit any-policy extension, this function stores -1 at "pSkipCerts". | |
1196 * | |
1197 * InhibitAnyPolicy ::= SkipCerts | |
1198 * | |
1199 * SkipCerts ::= INTEGER (0..MAX) | |
1200 * | |
1201 * PARAMETERS: | |
1202 * "cert" | |
1203 * Address of Cert whose inhibit any-policy extensions value is to be | |
1204 * stored. Must be non-NULL. | |
1205 * "pSkipCerts" | |
1206 * Address where PKIX_Int32 will be stored. Must be non-NULL. | |
1207 * "plContext" | |
1208 * Platform-specific context pointer. | |
1209 * THREAD SAFETY: | |
1210 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1211 * RETURNS: | |
1212 * Returns NULL if the function succeeds. | |
1213 * Returns a Cert Error if the function fails in a non-fatal way. | |
1214 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1215 */ | |
1216 PKIX_Error * | |
1217 PKIX_PL_Cert_GetInhibitAnyPolicy( | |
1218 PKIX_PL_Cert *cert, | |
1219 PKIX_Int32 *pSkipCerts, | |
1220 void *plContext); | |
1221 | |
1222 /* policy processing functions */ | |
1223 | |
1224 /* | |
1225 * FUNCTION: PKIX_PL_Cert_AreCertPoliciesCritical | |
1226 * DESCRIPTION: | |
1227 * | |
1228 * Checks whether the certificate policies extension of the Cert pointed to | |
1229 * by "cert" is critical and stores the Boolean result at "pCritical". If | |
1230 * "cert" does not have a certificate policies extension, this function | |
1231 * stores NULL at "pCritical". | |
1232 * | |
1233 * XXX what distinguishes NULL from PKIX_FALSE? | |
1234 * | |
1235 * PARAMETERS: | |
1236 * "cert" | |
1237 * Address of Cert whose certificate policies extension's criticality is | |
1238 * to be determined. Must be non-NULL. | |
1239 * "pCritical" | |
1240 * Address where PKIX_Boolean will be stored. Must be non-NULL. | |
1241 * "plContext" | |
1242 * Platform-specific context pointer. | |
1243 * THREAD SAFETY: | |
1244 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1245 * RETURNS: | |
1246 * Returns NULL if the function succeeds. | |
1247 * Returns a Cert Error if the function fails in a non-fatal way. | |
1248 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1249 */ | |
1250 PKIX_Error * | |
1251 PKIX_PL_Cert_AreCertPoliciesCritical( | |
1252 PKIX_PL_Cert *cert, | |
1253 PKIX_Boolean *pCritical, | |
1254 void *plContext); | |
1255 | |
1256 /* | |
1257 * FUNCTION: PKIX_PL_Cert_CheckNameConstraints | |
1258 * DESCRIPTION: | |
1259 * | |
1260 * Checks whether the subject distinguished name and subject alternative names | |
1261 * of the Cert pointed to by "cert" satisfy the CertNameConstraints pointed | |
1262 * to by "nameConstraints". If the CertNameConstraints are not satisfied, a | |
1263 * PKIX_Error pointer is returned. If "nameConstraints" is NULL, the function | |
1264 * does nothing. | |
1265 * | |
1266 * PARAMETERS: | |
1267 * "cert" | |
1268 * Address of Cert whose subject names are to be checked. | |
1269 * Must be non-NULL. | |
1270 * "nameConstraints" | |
1271 * Address of CertNameConstraints that need to be satisfied. | |
1272 * "plContext" | |
1273 * Platform-specific context pointer. | |
1274 * THREAD SAFETY: | |
1275 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1276 * RETURNS: | |
1277 * Returns NULL if the function succeeds. | |
1278 * Returns a Cert Error if the function fails in a non-fatal way. | |
1279 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1280 */ | |
1281 PKIX_Error * | |
1282 PKIX_PL_Cert_CheckNameConstraints( | |
1283 PKIX_PL_Cert *cert, | |
1284 PKIX_PL_CertNameConstraints *nameConstraints, | |
1285 void *plContext); | |
1286 | |
1287 /* | |
1288 * FUNCTION: PKIX_PL_Cert_MergeNameConstraints | |
1289 * DESCRIPTION: | |
1290 * | |
1291 * Merges the CertNameConstraints pointed to by "firstNC" and the | |
1292 * CertNameConstraints pointed to by "secondNC" and stores the merged | |
1293 * CertNameConstraints at "pResultNC". If "secondNC" is NULL, the | |
1294 * CertNameConstraints pointed to by "firstNC" is stored at "pResultNC". | |
1295 * | |
1296 * Once created, a CertNameConstraints object is immutable. | |
1297 * | |
1298 * PARAMETERS: | |
1299 * "firstNC" | |
1300 * Address of first CertNameConstraints to be merged. Must be non-NULL. | |
1301 * "secondNC" | |
1302 * Address of second CertNameConstraints to be merged | |
1303 * "pResultNC" | |
1304 * Address where object pointer will be stored. Must be non-NULL. | |
1305 * "plContext" | |
1306 * Platform-specific context pointer. | |
1307 * THREAD SAFETY: | |
1308 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1309 * RETURNS: | |
1310 * Returns NULL if the function succeeds. | |
1311 * Returns a Cert Error if the function fails in a non-fatal way. | |
1312 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1313 */ | |
1314 PKIX_Error * | |
1315 PKIX_PL_Cert_MergeNameConstraints( | |
1316 PKIX_PL_CertNameConstraints *firstNC, | |
1317 PKIX_PL_CertNameConstraints *secondNC, | |
1318 PKIX_PL_CertNameConstraints **pResultNC, | |
1319 void *plContext); | |
1320 | |
1321 /* | |
1322 * FUNCTION: PKIX_PL_Cert_VerifyKeyUsage | |
1323 * DESCRIPTION: | |
1324 * | |
1325 * Verifies that the keyUsage bit(s) specified by "keyUsage" appear in the | |
1326 * keyUsage extension of the Cert pointed to by "cert". The keyUsage bit | |
1327 * values specified in pkixt.h are supported, and can be bitwise or'ed if | |
1328 * multiple bit values are to be verified. If the keyUsages do not all appear | |
1329 * in the keyUsage extension of "cert", a PKIX_Error pointer is returned. | |
1330 * | |
1331 * KeyUsage ::= BIT STRING { | |
1332 * digitalSignature (0), | |
1333 * nonRepudiation (1), | |
1334 * keyEncipherment (2), | |
1335 * dataEncipherment (3), | |
1336 * keyAgreement (4), | |
1337 * keyCertSign (5), | |
1338 * cRLSign (6), | |
1339 * encipherOnly (7), | |
1340 * decipherOnly (8) } | |
1341 * | |
1342 * PARAMETERS: | |
1343 * "cert" | |
1344 * Address of Cert whose keyUsage bits are to be verified. | |
1345 * Must be non-NULL. | |
1346 * "keyUsage" | |
1347 * Constant representing keyUsage bit(s) that all must appear in keyUsage | |
1348 * extension of "cert". | |
1349 * "plContext" - Platform-specific context pointer. | |
1350 * THREAD SAFETY: | |
1351 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1352 * RETURNS: | |
1353 * Returns NULL if the function succeeds. | |
1354 * Returns a Cert Error if the function fails in a non-fatal way. | |
1355 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1356 */ | |
1357 PKIX_Error * | |
1358 PKIX_PL_Cert_VerifyKeyUsage( | |
1359 PKIX_PL_Cert *cert, | |
1360 PKIX_UInt32 keyUsage, | |
1361 void *plContext); | |
1362 | |
1363 /* | |
1364 * FUNCTION: PKIX_PL_Cert_VerifyCertAndKeyType | |
1365 * DESCRIPTION: | |
1366 * | |
1367 * Verifies cert and key types against certificate usage that is | |
1368 * a part of plContext(pkix_pl_nsscontext) structure. Throws an error | |
1369 * if cert or key types does not match. | |
1370 * | |
1371 * PARAMETERS: | |
1372 * "cert" | |
1373 * Address of Cert whose keyUsage bits are to be verified. | |
1374 * Must be non-NULL. | |
1375 * "isLeafCert" | |
1376 * What type of a cert has been verified. | |
1377 * "plContext" - Platform-specific context pointer. | |
1378 * THREAD SAFETY: | |
1379 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1380 * RETURNS: | |
1381 * Returns NULL if the function succeeds. | |
1382 * Returns a Cert Error if the function fails in a non-fatal way. | |
1383 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1384 */ | |
1385 PKIX_Error * | |
1386 PKIX_PL_Cert_VerifyCertAndKeyType( | |
1387 PKIX_PL_Cert *cert, | |
1388 PKIX_Boolean isChainCert, | |
1389 void *plContext); | |
1390 | |
1391 /* | |
1392 * FUNCTION: PKIX_PL_Cert_CheckValidity | |
1393 * DESCRIPTION: | |
1394 * | |
1395 * Checks whether the Cert pointed to by "cert" would be valid at the time | |
1396 * represented by the Date pointed to by "date". If "date" is NULL, then this | |
1397 * function checks whether the Cert would be valid at the current time. If the | |
1398 * Cert would not be valid at the specified Date, a PKIX_Error pointer is | |
1399 * returned. | |
1400 * | |
1401 * Validity ::= SEQUENCE { | |
1402 * notBefore Time, | |
1403 * notAfter Time } | |
1404 * | |
1405 * Time ::= CHOICE { | |
1406 * utcTime UTCTime, | |
1407 * generalTime GeneralizedTime } | |
1408 * | |
1409 * PARAMETERS: | |
1410 * "cert" | |
1411 * Address of Cert whose validity is to be checked. Must be non-NULL. | |
1412 * "date" | |
1413 * Address of Date at which the Cert is being checked for validity. | |
1414 * If NULL, the current time is used for the Date. | |
1415 * "plContext" | |
1416 * Platform-specific context pointer. | |
1417 * THREAD SAFETY: | |
1418 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1419 * RETURNS: | |
1420 * Returns NULL if the function succeeds. | |
1421 * Returns a Cert Error if the function fails in a non-fatal way. | |
1422 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1423 */ | |
1424 PKIX_Error * | |
1425 PKIX_PL_Cert_CheckValidity( | |
1426 PKIX_PL_Cert *cert, | |
1427 PKIX_PL_Date *date, | |
1428 void *plContext); | |
1429 | |
1430 /* | |
1431 * FUNCTION: PKIX_PL_Cert_GetValidityNotAfter | |
1432 * DESCRIPTION: | |
1433 * | |
1434 * Retrieves a pointer to the Date that represents the notAfter time of the | |
1435 * Certificate pointed to by "cert" and stores it at "pDate". | |
1436 * | |
1437 * Validity ::= SEQUENCE { | |
1438 * notBefore Time, | |
1439 * notAfter Time } | |
1440 * | |
1441 * PARAMETERS: | |
1442 * "cert" | |
1443 * Address of Cert whose validity time is to be retrieved. Must be | |
1444 * non-NULL. | |
1445 * "date" | |
1446 * Address of Date at which the Cert's notAfter time is being retrieved. | |
1447 * Must be non-NULL. | |
1448 * "plContext" | |
1449 * Platform-specific context pointer. | |
1450 * THREAD SAFETY: | |
1451 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1452 * RETURNS: | |
1453 * Returns NULL if the function succeeds. | |
1454 * Returns a Cert Error if the function fails in a non-fatal way. | |
1455 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1456 */ | |
1457 PKIX_Error * | |
1458 PKIX_PL_Cert_GetValidityNotAfter( | |
1459 PKIX_PL_Cert *cert, | |
1460 PKIX_PL_Date **pDate, | |
1461 void *plContext); | |
1462 | |
1463 /* | |
1464 * FUNCTION: PKIX_PL_Cert_VerifySignature | |
1465 * DESCRIPTION: | |
1466 * | |
1467 * Verifies the signature on the Cert pointed to by "cert" using the | |
1468 * PublicKey pointed to by "pubKey". If the signature doesn't verify, an | |
1469 * Error pointer is returned. | |
1470 * | |
1471 * PARAMETERS: | |
1472 * "cert" | |
1473 * Address of Cert whose signature is to be verified. Must be non-NULL. | |
1474 * "pubKey" | |
1475 * Address of a Public Key used to verify the signature. Must be non-NULL. | |
1476 * "plContext" | |
1477 * Platform-specific context pointer. | |
1478 * THREAD SAFETY: | |
1479 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1480 * RETURNS: | |
1481 * Returns NULL if the function succeeds. | |
1482 * Returns a Cert Error if the function fails in a non-fatal way. | |
1483 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1484 */ | |
1485 PKIX_Error * | |
1486 PKIX_PL_Cert_VerifySignature( | |
1487 PKIX_PL_Cert *cert, | |
1488 PKIX_PL_PublicKey *pubKey, | |
1489 void *plContext); | |
1490 | |
1491 /* | |
1492 * FUNCTION: PKIX_PL_Cert_IsCertTrusted | |
1493 * DESCRIPTION: | |
1494 * | |
1495 * Checks the Cert specified by "cert" to determine, in a manner that depends | |
1496 * on the underlying platform, whether it is trusted, and stores the result in | |
1497 * "pTrusted". If a certificate is trusted it means that a chain built to that | |
1498 * certificate, and satisfying all the usage, policy, validity, and other | |
1499 * tests, is a valid chain and the End Entity certificate from which it was | |
1500 * built can be trusted. | |
1501 * | |
1502 * If the Certificate is not intrinsically trustworthy, it still might end up a | |
1503 * component in a successful chain. | |
1504 * | |
1505 * If the Certificate is intrinsically untrustworthy, this function will return | |
1506 * an error. | |
1507 * | |
1508 * PARAMETERS | |
1509 * "cert" | |
1510 * Address of Cert whose trustworthiness is to be determined. Must be | |
1511 * non-NULL. | |
1512 * "trustOnlyUserAnchors" | |
1513 * States that we can only trust explicitly defined user trust anchors. | |
1514 * "pTrusted" | |
1515 * Address where the Boolean value will be stored. Must be non-NULL. | |
1516 * "plContext" | |
1517 * Platform-specific context pointer. | |
1518 * THREAD SAFETY: | |
1519 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1520 * RETURNS: | |
1521 * Returns NULL if the function succeeds. | |
1522 * Returns a CERT Error if the function fails in a non-fatal way. | |
1523 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1524 */ | |
1525 PKIX_Error * | |
1526 PKIX_PL_Cert_IsCertTrusted( | |
1527 PKIX_PL_Cert *cert, | |
1528 PKIX_Boolean trustOnlyUserAnchors, | |
1529 PKIX_Boolean *pTrusted, | |
1530 void *plContext); | |
1531 | |
1532 /* | |
1533 * FUNCTION: PKIX_PL_Cert_IsLeafCertTrusted | |
1534 * DESCRIPTION: | |
1535 * | |
1536 * Checks the Leaf Cert specified by "cert" to determine, in a manner that | |
1537 * depends on the underlying platform, whether it is trusted, and stores the | |
1538 * result in "pTrusted". If a certificate is trusted it means that this | |
1539 * End Entify certificate has been marked as trusted for the requested usage, | |
1540 * policy, validity, and other tests. | |
1541 * | |
1542 * If the Certificate is not intrinsically trustworthy, we can still try to | |
1543 * build a successful chain. | |
1544 * | |
1545 * If the Certificate is intrinsically untrustworthy, this function will return | |
1546 * an error. | |
1547 * | |
1548 * PARAMETERS | |
1549 * "cert" | |
1550 * Address of Cert whose trustworthiness is to be determined. Must be | |
1551 * non-NULL. | |
1552 * "pTrusted" | |
1553 * Address where the Boolean value will be stored. Must be non-NULL. | |
1554 * "plContext" | |
1555 * Platform-specific context pointer. | |
1556 * THREAD SAFETY: | |
1557 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1558 * RETURNS: | |
1559 * Returns NULL if the function succeeds. | |
1560 * Returns a CERT Error if the function fails in a non-fatal way. | |
1561 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1562 */ | |
1563 PKIX_Error * | |
1564 PKIX_PL_Cert_IsLeafCertTrusted( | |
1565 PKIX_PL_Cert *cert, | |
1566 PKIX_Boolean *pTrusted, | |
1567 void *plContext); | |
1568 | |
1569 /* FUNCTION: PKIX_PL_Cert_SetAsTrustAnchor */ | |
1570 PKIX_Error* | |
1571 PKIX_PL_Cert_SetAsTrustAnchor(PKIX_PL_Cert *cert, | |
1572 void *plContext); | |
1573 | |
1574 /* | |
1575 * FUNCTION: PKIX_PL_Cert_GetCacheFlag | |
1576 * DESCRIPTION: | |
1577 * | |
1578 * Retrieves the value of the cache flag in "cert" and return it at address | |
1579 * pointed by "pCacheFlag". The initila cache flag is determined by the | |
1580 * CertStore this "cert" is fetched from. When CertStore is created, user | |
1581 * need to specify if the data should be cached. | |
1582 * | |
1583 * PARAMETERS: | |
1584 * "cert" | |
1585 * Address of Cert whose cache flag is fetched. Must be non-NULL. | |
1586 * "pCacheFlag" | |
1587 * Address where PKIX_Boolean will be stored. Must be non-NULL. | |
1588 * "plContext" | |
1589 * Platform-specific context pointer. | |
1590 * THREAD SAFETY: | |
1591 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1592 * RETURNS: | |
1593 * Returns NULL if the function succeeds. | |
1594 * Returns a Cert Error if the function fails in a non-fatal way. | |
1595 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1596 */ | |
1597 PKIX_Error * | |
1598 PKIX_PL_Cert_GetCacheFlag( | |
1599 PKIX_PL_Cert *cert, | |
1600 PKIX_Boolean *pCacheFlag, | |
1601 void *plContext); | |
1602 | |
1603 /* | |
1604 * FUNCTION: PKIX_PL_Cert_SetCacheFlag | |
1605 * DESCRIPTION: | |
1606 * | |
1607 * Set the value of the cache flag in "cert" base on the boolean value stored | |
1608 * at "cacheFlag". This function is meant to be used by CertStore after a | |
1609 * Cert is created. | |
1610 * | |
1611 * PARAMETERS: | |
1612 * "cert" | |
1613 * Address of Cert where "cacheFlag" is stored. Must be non-NULL. | |
1614 * "cacheFlag" | |
1615 * PKIX_Boolean flag for cache flag. | |
1616 * "plContext" | |
1617 * Platform-specific context pointer. | |
1618 * THREAD SAFETY: | |
1619 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1620 * RETURNS: | |
1621 * Returns NULL if the function succeeds. | |
1622 * Returns a Cert Error if the function fails in a non-fatal way. | |
1623 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1624 */ | |
1625 PKIX_Error * | |
1626 PKIX_PL_Cert_SetCacheFlag( | |
1627 PKIX_PL_Cert *cert, | |
1628 PKIX_Boolean cacheFlag, | |
1629 void *plContext); | |
1630 | |
1631 /* | |
1632 * FUNCTION: PKIX_PL_Cert_GetTrustCertStore | |
1633 * DESCRIPTION: | |
1634 * | |
1635 * Retrieves the value of the CertStore in "cert" and return it at address | |
1636 * pointed by "pCertStore". | |
1637 * | |
1638 * PARAMETERS: | |
1639 * "cert" | |
1640 * Address of Cert whose CertStore is fetched. Must be non-NULL. | |
1641 * "pTrustCertStore" | |
1642 * Address where CertStore will be stored and returned. Must be non-NULL. | |
1643 * "plContext" | |
1644 * Platform-specific context pointer. | |
1645 * THREAD SAFETY: | |
1646 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1647 * RETURNS: | |
1648 * Returns NULL if the function succeeds. | |
1649 * Returns a Cert Error if the function fails in a non-fatal way. | |
1650 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1651 */ | |
1652 PKIX_Error * | |
1653 PKIX_PL_Cert_GetTrustCertStore( | |
1654 PKIX_PL_Cert *cert, | |
1655 PKIX_CertStore **pTrustCertStore, | |
1656 void *plContext); | |
1657 | |
1658 /* | |
1659 * FUNCTION: PKIX_PL_Cert_SetTrustCertStore | |
1660 * DESCRIPTION: | |
1661 * | |
1662 * Set the value of the CertStore "certStore" in "cert". | |
1663 * | |
1664 * PARAMETERS: | |
1665 * "cert" | |
1666 * Address of Cert where "certStore" will be stored. Must be non-NULL. | |
1667 * "trustCertStore" | |
1668 * Address where the CertStore is. Must be non-NULL. | |
1669 * "plContext" | |
1670 * Platform-specific context pointer. | |
1671 * THREAD SAFETY: | |
1672 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1673 * RETURNS: | |
1674 * Returns NULL if the function succeeds. | |
1675 * Returns a Cert Error if the function fails in a non-fatal way. | |
1676 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1677 */ | |
1678 PKIX_Error * | |
1679 PKIX_PL_Cert_SetTrustCertStore( | |
1680 PKIX_PL_Cert *cert, | |
1681 PKIX_CertStore *trustCertStore, | |
1682 void *plContext); | |
1683 | |
1684 | |
1685 /* | |
1686 * FUNCTION: PKIX_PL_Cert_GetAuthorityInfoAccess | |
1687 * DESCRIPTION: | |
1688 * | |
1689 * Retrieves the value(s) of the Authority Information Access in "cert" and | |
1690 * returns it in a list at address pointed by "pAuthorityInfoAccess". | |
1691 * | |
1692 * SubjectInfoAccess ::= | |
1693 * SEQUENCE SIZE (1..MAX) of AccessDescription | |
1694 * AccessDescription ::= SEQUENCE { | |
1695 * accessMethod OBJECT IDENTIFIER, | |
1696 * accessLocation GeneralName | |
1697 * } | |
1698 * | |
1699 * PARAMETERS: | |
1700 * "cert" | |
1701 * Address of Cert whose Authority Information Access is fetched. | |
1702 * Must be non-NULL. | |
1703 * "pAuthorityInfoAccess" | |
1704 * Address where Authority InfoAccess will be stored and returned. | |
1705 * Must be non-NULL. | |
1706 * "plContext" | |
1707 * Platform-specific context pointer. | |
1708 * THREAD SAFETY: | |
1709 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1710 * RETURNS: | |
1711 * Returns NULL if the function succeeds. | |
1712 * Returns a Cert Error if the function fails in a non-fatal way. | |
1713 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1714 */ | |
1715 PKIX_Error * | |
1716 PKIX_PL_Cert_GetAuthorityInfoAccess( | |
1717 PKIX_PL_Cert *cert, | |
1718 PKIX_List **pAiaList, /* of PKIX_PL_InfoAccess */ | |
1719 void *plContext); | |
1720 | |
1721 | |
1722 /* | |
1723 * FUNCTION: PKIX_PL_Cert_GetSubjectInfoAccess | |
1724 * DESCRIPTION: | |
1725 * | |
1726 * Retrieves the value(s) of the Subject Information Access in "cert" and | |
1727 * returns it in a list at address pointed by "pSubjectInfoAccess". | |
1728 * | |
1729 * SubjectInfoAccess ::= | |
1730 * SEQUENCE SIZE (1..MAX) of AccessDescription | |
1731 * AccessDescription ::= SEQUENCE { | |
1732 * accessMethod OBJECT IDENTIFIER, | |
1733 * accessLocation GeneralName | |
1734 * } | |
1735 * | |
1736 * PARAMETERS: | |
1737 * "cert" | |
1738 * Address of Cert whose Subject Information Access is fetched. | |
1739 * Must be non-NULL. | |
1740 * "pSubjectInfoAccess" | |
1741 * Address where Subject InfoAccess will be stored and returned. | |
1742 * Must be non-NULL. | |
1743 * "plContext" | |
1744 * Platform-specific context pointer. | |
1745 * THREAD SAFETY: | |
1746 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1747 * RETURNS: | |
1748 * Returns NULL if the function succeeds. | |
1749 * Returns a Cert Error if the function fails in a non-fatal way. | |
1750 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1751 */ | |
1752 PKIX_Error * | |
1753 PKIX_PL_Cert_GetSubjectInfoAccess( | |
1754 PKIX_PL_Cert *cert, | |
1755 PKIX_List **pSiaList, /* of PKIX_PL_InfoAccess */ | |
1756 void *plContext); | |
1757 | |
1758 | |
1759 | |
1760 /* | |
1761 * FUNCTION: PKIX_PL_Cert_GetCrlDp | |
1762 * DESCRIPTION: | |
1763 * | |
1764 * Retrieves the value(s) of the CRL Distribution Point Extension and | |
1765 * returns it in a list at address pointed by "pDpList". | |
1766 * | |
1767 * PARAMETERS: | |
1768 * "cert" | |
1769 * Address of Cert whose Subject Information Access is fetched. | |
1770 * Must be non-NULL. | |
1771 * "pDpList" | |
1772 * Address where CRL DP will be stored and returned. | |
1773 * Must be non-NULL. | |
1774 * "plContext" | |
1775 * Platform-specific context pointer. | |
1776 * THREAD SAFETY: | |
1777 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1778 * RETURNS: | |
1779 * Returns NULL if the function succeeds. | |
1780 * Returns a Cert Error if the function fails in a non-fatal way. | |
1781 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1782 */ | |
1783 PKIX_Error * | |
1784 PKIX_PL_Cert_GetCrlDp(PKIX_PL_Cert *cert, | |
1785 PKIX_List **pDpList, | |
1786 void *plContext); | |
1787 | |
1788 | |
1789 /* | |
1790 * InfoAccess | |
1791 * | |
1792 * To hold Authority Information Access or Subject Information Access | |
1793 * retrieved from a Certificate. | |
1794 */ | |
1795 | |
1796 #define PKIX_INFOACCESS_OCSP 1 | |
1797 #define PKIX_INFOACCESS_CA_ISSUERS 2 | |
1798 #define PKIX_INFOACCESS_TIMESTAMPING 3 | |
1799 #define PKIX_INFOACCESS_CA_REPOSITORY 5 | |
1800 | |
1801 #define PKIX_INFOACCESS_LOCATION_UNKNOWN 0 | |
1802 #define PKIX_INFOACCESS_LOCATION_HTTP 1 | |
1803 #define PKIX_INFOACCESS_LOCATION_LDAP 2 | |
1804 | |
1805 /* | |
1806 * FUNCTION: PKIX_PL_InfoAccess_GetMethod | |
1807 * DESCRIPTION: | |
1808 * | |
1809 * Stores the method of the Information Access from "infoAccess" and | |
1810 * returns in "pMethod". | |
1811 * | |
1812 * SubjectInfoAccess ::= | |
1813 * AccessDescription ::= SEQUENCE { | |
1814 * accessMethod OBJECT IDENTIFIER, | |
1815 * accessLocation GeneralName | |
1816 * } | |
1817 * | |
1818 * PARAMETERS: | |
1819 * "infoAccess" | |
1820 * Address of PKIX_PL_InfoAccess that has the access data. | |
1821 * Must be non-NULL. | |
1822 * "pMethod" | |
1823 * Address where access method will be stored and returned. | |
1824 * Must be non-NULL. | |
1825 * "plContext" | |
1826 * Platform-specific context pointer. | |
1827 * THREAD SAFETY: | |
1828 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1829 * RETURNS: | |
1830 * Returns NULL if the function succeeds. | |
1831 * Returns a Cert Error if the function fails in a non-fatal way. | |
1832 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1833 */ | |
1834 PKIX_Error * | |
1835 PKIX_PL_InfoAccess_GetMethod( | |
1836 PKIX_PL_InfoAccess *infoAccess, | |
1837 PKIX_UInt32 *pMethod, | |
1838 void *plContext); | |
1839 | |
1840 /* | |
1841 * FUNCTION: PKIX_PL_InfoAccess_GetLocation | |
1842 * DESCRIPTION: | |
1843 * | |
1844 * Stores the location of the Information Access from "infoAccess" and | |
1845 * returns in "pLocation". | |
1846 * | |
1847 * SubjectInfoAccess ::= | |
1848 * AccessDescription ::= SEQUENCE { | |
1849 * accessMethod OBJECT IDENTIFIER, | |
1850 * accessLocation GeneralName | |
1851 * } | |
1852 * | |
1853 * PARAMETERS: | |
1854 * "infoAccess" | |
1855 * Address of PKIX_PL_InfoAccess that has the access data. | |
1856 * Must be non-NULL. | |
1857 * "pLocation" | |
1858 * Address where access location will be stored and returned. | |
1859 * Must be non-NULL. | |
1860 * "plContext" | |
1861 * Platform-specific context pointer. | |
1862 * THREAD SAFETY: | |
1863 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1864 * RETURNS: | |
1865 * Returns NULL if the function succeeds. | |
1866 * Returns a Cert Error if the function fails in a non-fatal way. | |
1867 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1868 */ | |
1869 PKIX_Error * | |
1870 PKIX_PL_InfoAccess_GetLocation( | |
1871 PKIX_PL_InfoAccess *infoAccess, | |
1872 PKIX_PL_GeneralName **pLocation, | |
1873 void *plContext); | |
1874 | |
1875 /* | |
1876 * FUNCTION: PKIX_PL_InfoAccess_GetLocationType | |
1877 * DESCRIPTION: | |
1878 * | |
1879 * Stores the type of location of the Information Access from "infoAccess" and | |
1880 * returns in "pType". | |
1881 * | |
1882 * SubjectInfoAccess ::= | |
1883 * AccessDescription ::= SEQUENCE { | |
1884 * accessMethod OBJECT IDENTIFIER, | |
1885 * accessLocation GeneralName | |
1886 * } | |
1887 * | |
1888 * PARAMETERS: | |
1889 * "infoAccess" | |
1890 * Address of PKIX_PL_InfoAccess that has the access data. | |
1891 * Must be non-NULL. | |
1892 * "pType" | |
1893 * Address where access location type will be stored and returned. | |
1894 * Must be non-NULL. | |
1895 * "plContext" | |
1896 * Platform-specific context pointer. | |
1897 * THREAD SAFETY: | |
1898 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1899 * RETURNS: | |
1900 * Returns NULL if the function succeeds. | |
1901 * Returns a Cert Error if the function fails in a non-fatal way. | |
1902 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1903 */ | |
1904 PKIX_Error * | |
1905 PKIX_PL_InfoAccess_GetLocationType( | |
1906 PKIX_PL_InfoAccess *infoAccess, | |
1907 PKIX_UInt32 *pType, | |
1908 void *plContext); | |
1909 | |
1910 PKIX_Error * | |
1911 pkix_pl_InfoAccess_GetAIACerts( | |
1912 PKIX_PL_InfoAccess *ia, | |
1913 void **pNBIOContext, | |
1914 void **pHandle, | |
1915 PKIX_List **pCerts, | |
1916 void *plContext); | |
1917 | |
1918 /* | |
1919 * CRL | |
1920 * | |
1921 * A CRL represents an X.509 certificate revocation list. It can be created | |
1922 * using the bytes of a valid ASN.1 DER encoding. Once created, a CRL is | |
1923 * immutable. The following functions include accessors (gettors) for the | |
1924 * various components of an X.509 CRL, as well as a function for signature | |
1925 * verification. | |
1926 */ | |
1927 | |
1928 /* | |
1929 * FUNCTION: PKIX_PL_CRL_Create | |
1930 * DESCRIPTION: | |
1931 * | |
1932 * Creates a new CRL using the bytes in the ByteArray pointed to by | |
1933 * "byteArray" and stores it at "pCRL". If the bytes are not a valid ASN.1 | |
1934 * DER encoding of a CRL, a PKIX_Error pointer is returned. Once created, a | |
1935 * CRL is immutable. | |
1936 * | |
1937 * CertificateList ::= SEQUENCE { | |
1938 * tbsCertList TBSCertList, | |
1939 * signatureAlgorithm AlgorithmIdentifier, | |
1940 * signatureValue BIT STRING } | |
1941 * | |
1942 * TBSCertList ::= SEQUENCE { | |
1943 * version Version OPTIONAL, | |
1944 * -- if present, MUST be v2 | |
1945 * signature AlgorithmIdentifier, | |
1946 * issuer Name, | |
1947 * thisUpdate Time, | |
1948 * nextUpdate Time OPTIONAL, | |
1949 * revokedCertificates SEQUENCE OF SEQUENCE { | |
1950 * userCertificate CertificateSerialNumber, | |
1951 * revocationDate Time, | |
1952 * crlEntryExtensions Extensions OPTIONAL | |
1953 * -- if present, MUST be v2 | |
1954 * } OPTIONAL, | |
1955 * crlExtensions [0] EXPLICIT Extensions OPTIONAL | |
1956 * -- if present, MUST be v2 | |
1957 * } | |
1958 * | |
1959 * PARAMETERS: | |
1960 * "byteArray" | |
1961 * Address of ByteArray representing the CRL's DER encoding. | |
1962 * Must be non-NULL. | |
1963 * "pCRL" | |
1964 * Address where object pointer will be stored. Must be non-NULL. | |
1965 * "plContext" | |
1966 * Platform-specific context pointer. | |
1967 * THREAD SAFETY: | |
1968 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1969 * RETURNS: | |
1970 * Returns NULL if the function succeeds. | |
1971 * Returns a CRL Error if the function fails in a non-fatal way. | |
1972 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
1973 */ | |
1974 PKIX_Error * | |
1975 PKIX_PL_CRL_Create( | |
1976 PKIX_PL_ByteArray *byteArray, | |
1977 PKIX_PL_CRL **pCRL, | |
1978 void *plContext); | |
1979 | |
1980 /* | |
1981 * FUNCTION: PKIX_PL_CRL_GetIssuer | |
1982 * DESCRIPTION: | |
1983 * | |
1984 * Retrieves a pointer to the X500Name that represents the issuer of the CRL | |
1985 * pointed to by "crl" and stores it at "pCRLIssuer". | |
1986 * | |
1987 * PARAMETERS: | |
1988 * "crl" | |
1989 * Address of CRL whose issuer is to be stored. Must be non-NULL. | |
1990 * "pCRLIssuer" | |
1991 * Address where object pointer will be stored. Must be non-NULL. | |
1992 * "plContext" | |
1993 * Platform-specific context pointer. | |
1994 * THREAD SAFETY: | |
1995 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
1996 * RETURNS: | |
1997 * Returns NULL if the function succeeds. | |
1998 * Returns a CRL Error if the function fails in a non-fatal way. | |
1999 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2000 */ | |
2001 PKIX_Error * | |
2002 PKIX_PL_CRL_GetIssuer( | |
2003 PKIX_PL_CRL *crl, | |
2004 PKIX_PL_X500Name **pCRLIssuer, | |
2005 void *plContext); | |
2006 | |
2007 /* | |
2008 * FUNCTION: PKIX_PL_CRL_GetCriticalExtensionOIDs | |
2009 * DESCRIPTION: | |
2010 * | |
2011 * Retrieves a pointer to the List of OIDs (each OID corresponding to a | |
2012 * critical extension of the CRL pointed to by "crl") and stores it at | |
2013 * "pExtensions". If "crl" does not have any critical extensions, this | |
2014 * function stores an empty List at "pExtensions". | |
2015 * | |
2016 * Note that the List returned by this function is immutable. | |
2017 * | |
2018 * PARAMETERS: | |
2019 * "crl" | |
2020 * Address of CRL whose critical extension OIDs are to be stored. | |
2021 * Must be non-NULL. | |
2022 * "pExtensions" | |
2023 * Address where object pointer will be stored. Must be non-NULL. | |
2024 * "plContext" | |
2025 * Platform-specific context pointer. | |
2026 * THREAD SAFETY: | |
2027 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2028 * RETURNS: | |
2029 * Returns NULL if the function succeeds. | |
2030 * Returns a CRL Error if the function fails in a non-fatal way. | |
2031 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2032 */ | |
2033 PKIX_Error * | |
2034 PKIX_PL_CRL_GetCriticalExtensionOIDs( | |
2035 PKIX_PL_CRL *crl, | |
2036 PKIX_List **pExtensions, /* list of PKIX_PL_OID */ | |
2037 void *plContext); | |
2038 | |
2039 /* | |
2040 * FUNCTION: PKIX_PL_CRL_GetCRLEntryForSerialNumber | |
2041 * DESCRIPTION: | |
2042 * | |
2043 * Retrieves a pointer to the CRLEntry (found in the CRL pointed to by "crl") | |
2044 * corresponding to the BigInt pointed to by "serialNumber" and stores it at | |
2045 * "pCRLEntry". If there is no such CRLEntry, this functions stores NULL at | |
2046 * "pCRLEntry". Once created, a CRLEntry is immutable. | |
2047 * | |
2048 * PARAMETERS: | |
2049 * "crl" | |
2050 * Address of CRL whose CRL Entries are to be searched. Must be non-NULL. | |
2051 * "serialNumber" | |
2052 * Address of BigInt representing serial number of certificate whose | |
2053 * CRLEntry is to be found. Must be non-NULL. | |
2054 * "pCRLEntry" | |
2055 * Address where object pointer will be stored. Must be non-NULL. | |
2056 * "plContext" | |
2057 * Platform-specific context pointer. | |
2058 * THREAD SAFETY: | |
2059 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2060 * RETURNS: | |
2061 * Returns NULL if the function succeeds. | |
2062 * Returns a CRL Error if the function fails in a non-fatal way. | |
2063 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2064 */ | |
2065 PKIX_Error * | |
2066 PKIX_PL_CRL_GetCRLEntryForSerialNumber( | |
2067 PKIX_PL_CRL *crl, | |
2068 PKIX_PL_BigInt *serialNumber, | |
2069 PKIX_PL_CRLEntry **pCRLEntry, | |
2070 void *plContext); | |
2071 | |
2072 /* | |
2073 * FUNCTION: PKIX_PL_CRL_GetCRLNumber | |
2074 * DESCRIPTION: | |
2075 * Retrieves the CRL Number from extension. This is non-critical extension. | |
2076 * | |
2077 * PARAMETERS: | |
2078 * "crl" | |
2079 * Address of CRL whose version is to be stored. Must be non-NULL. | |
2080 * "pCrlNumber" | |
2081 * Address where a CRL Number will be stored. Must be non-NULL. | |
2082 * "plContext" | |
2083 * Platform-specific context pointer. | |
2084 * THREAD SAFETY: | |
2085 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2086 * RETURNS: | |
2087 * Returns NULL if the function succeeds. | |
2088 * Returns a CRL Error if the function fails in a non-fatal way. | |
2089 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2090 */ | |
2091 PKIX_Error * | |
2092 PKIX_PL_CRL_GetCRLNumber( | |
2093 PKIX_PL_CRL *crl, | |
2094 PKIX_PL_BigInt **pCrlNumber, | |
2095 void *plContext); | |
2096 | |
2097 /* | |
2098 * FUNCTION: PKIX_PL_CRL_VerifyUpdateTime | |
2099 * DESCRIPTION: | |
2100 * | |
2101 * Checks whether the CRL pointed to by "crl" would be valid at the time | |
2102 * represented by the Date pointed to by "date" and stores the Boolean result | |
2103 * at "pResult". This check is done only when NIST policy is enforced. | |
2104 * | |
2105 * Time ::= CHOICE { | |
2106 * utcTime UTCTime, | |
2107 * generalTime GeneralizedTime } | |
2108 * | |
2109 * PARAMETERS: | |
2110 * "crl" | |
2111 * Address of CRL whose validity is to be checked. Must be non-NULL. | |
2112 * "date" | |
2113 * Address of Date at which the CRL is being checked for validity. | |
2114 * Must be non-NULL. | |
2115 * "pResult" | |
2116 * Address of Boolean result. Must be non-NULL. | |
2117 * "plContext" | |
2118 * Platform-specific context pointer. | |
2119 * THREAD SAFETY: | |
2120 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2121 * RETURNS: | |
2122 * Returns NULL if the function succeeds. | |
2123 * Returns a CRL Error if the function fails in a non-fatal way. | |
2124 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2125 */ | |
2126 PKIX_Error * | |
2127 PKIX_PL_CRL_VerifyUpdateTime( | |
2128 PKIX_PL_CRL *crl, | |
2129 PKIX_PL_Date *date, | |
2130 PKIX_Boolean *pResult, | |
2131 void *plContext); | |
2132 | |
2133 /* | |
2134 * FUNCTION: PKIX_PL_CRL_VerifySignature | |
2135 * DESCRIPTION: | |
2136 * | |
2137 * Verifies the signature on the CRL pointed to by "crl" using the PublicKey | |
2138 * pointed to by "pubKey". If the signature doesn't verify, a PKIX_Error | |
2139 * pointer is returned. | |
2140 * | |
2141 * PARAMETERS: | |
2142 * "crl" | |
2143 * Address of CRL whose signature is to be verified. Must be non-NULL. | |
2144 * "pubKey" | |
2145 * Address of a Public Key used to verify the signature. Must be non-NULL. | |
2146 * "plContext" | |
2147 * Platform-specific context pointer. | |
2148 * THREAD SAFETY: | |
2149 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2150 * RETURNS: | |
2151 * Returns NULL if the function succeeds. | |
2152 * Returns a CRL Error if the function fails in a non-fatal way. | |
2153 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2154 */ | |
2155 PKIX_Error * | |
2156 PKIX_PL_CRL_VerifySignature( | |
2157 PKIX_PL_CRL *crl, | |
2158 PKIX_PL_PublicKey *pubKey, | |
2159 void *plContext); | |
2160 | |
2161 /* | |
2162 * FUNCTION: PKIX_PL_CRL_ReleaseDerCrl | |
2163 * DESCRIPTION: | |
2164 * | |
2165 * Relinguish the ownership for the crl der. The operation will succeed if | |
2166 * a crl owns the der. If the crl was created from existing crl and does not | |
2167 * own the der, then the function will return null. | |
2168 * | |
2169 * PARAMETERS: | |
2170 * "crl" | |
2171 * Address of CRL whose signature is to be verified. Must be non-NULL. | |
2172 * "derCrl" | |
2173 * Pointer to a SECItem that has der crl. | |
2174 * "plContext" | |
2175 * Platform-specific context pointer. | |
2176 * THREAD SAFETY: | |
2177 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2178 * RETURNS: | |
2179 * Returns NULL if the function succeeds. | |
2180 * Returns a CRL Error if the function fails in a non-fatal way. | |
2181 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2182 */ | |
2183 PKIX_Error * | |
2184 PKIX_PL_CRL_ReleaseDerCrl(PKIX_PL_CRL *crl, | |
2185 SECItem **derCrl, | |
2186 void *plContext); | |
2187 /* | |
2188 * FUNCTION: PKIX_PL_CRL_AdoptDerCrl | |
2189 * DESCRIPTION: | |
2190 * | |
2191 * Adopt memory of the der. The secItem that contains der will be | |
2192 * freed with destruction of parent pkix crl structure. | |
2193 * | |
2194 * * PARAMETERS: | |
2195 * "crl" | |
2196 * Address of CRL whose signature is to be verified. Must be non-NULL. | |
2197 * "derCrl" | |
2198 * Pointer to a SECItem that has der crl. | |
2199 * "plContext" | |
2200 * Platform-specific context pointer. | |
2201 * THREAD SAFETY: | |
2202 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2203 * RETURNS: | |
2204 * Returns NULL if the function succeeds. | |
2205 * Returns a CRL Error if the function fails in a non-fatal way. | |
2206 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2207 */ | |
2208 PKIX_Error * | |
2209 PKIX_PL_CRL_AdoptDerCrl(PKIX_PL_CRL *crl, | |
2210 SECItem *derCrl, | |
2211 void *plContext); | |
2212 | |
2213 /* | |
2214 * FUNCTION: PKIX_PL_CRLEntry_GetCRLEntryReasonCode | |
2215 * DESCRIPTION: | |
2216 * | |
2217 * Retrieves the value of the reason code extension of the CRLEntry pointed | |
2218 * to by "crlEntry" and stores it at "pReason". If the "crlEntry" has no | |
2219 * reason code extension, this function stores -1 at "pReason". | |
2220 * | |
2221 * CRLReason ::= ENUMERATED { | |
2222 * unspecified (0), | |
2223 * keyCompromise (1), | |
2224 * cACompromise (2), | |
2225 * affiliationChanged (3), | |
2226 * superseded (4), | |
2227 * cessationOfOperation (5), | |
2228 * certificateHold (6), | |
2229 * removeFromCRL (8), | |
2230 * privilegeWithdrawn (9), | |
2231 * aACompromise (10) } | |
2232 * | |
2233 * PARAMETERS: | |
2234 * "crlEntry" | |
2235 * Address of CRLEntry whose reason code bit values are to be returned | |
2236 * at "pReason". Must be non-NULL. | |
2237 * "pReason" | |
2238 * Address of PKIX_Int32 where reason code is stored. Must be non-NULL. | |
2239 * "plContext" | |
2240 * Platform-specific context pointer. | |
2241 * THREAD SAFETY: | |
2242 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2243 * RETURNS: | |
2244 * Returns NULL if the function succeeds. | |
2245 * Returns a CRL Error if the function fails in a non-fatal way. | |
2246 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2247 */ | |
2248 PKIX_Error * | |
2249 PKIX_PL_CRLEntry_GetCRLEntryReasonCode( | |
2250 PKIX_PL_CRLEntry *crlEntry, | |
2251 PKIX_Int32 *pReason, | |
2252 void *plContext); | |
2253 | |
2254 /* | |
2255 * FUNCTION: PKIX_PL_CRLEntry_GetCriticalExtensionOIDs | |
2256 * DESCRIPTION: | |
2257 * | |
2258 * Retrieves a pointer to the List of OIDs (each OID corresponding to a | |
2259 * critical extension of the CRLEntry pointed to by "crlEntry") and stores it | |
2260 * at "pExtensions". If "crlEntry" does not have any critical extensions, this | |
2261 * function stores an empty List at "pExtensions". | |
2262 * | |
2263 * Note that the List returned by this function is immutable. | |
2264 * | |
2265 * PARAMETERS: | |
2266 * "crlEntry" | |
2267 * Address of CRLEntry whose critical extension OIDs are to be stored. | |
2268 * Must be non-NULL. | |
2269 * "pExtensions" | |
2270 * Address where object pointer will be stored. Must be non-NULL. | |
2271 * "plContext" | |
2272 * Platform-specific context pointer. | |
2273 * THREAD SAFETY: | |
2274 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2275 * RETURNS: | |
2276 * Returns NULL if the function succeeds. | |
2277 * Returns a CRL Error if the function fails in a non-fatal way. | |
2278 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2279 */ | |
2280 PKIX_Error * | |
2281 PKIX_PL_CRLEntry_GetCriticalExtensionOIDs( | |
2282 PKIX_PL_CRLEntry *crlEntry, | |
2283 PKIX_List **pExtensions, /* list of PKIX_PL_OID */ | |
2284 void *plContext); | |
2285 | |
2286 #ifdef BUILD_LIBPKIX_TESTS | |
2287 /* | |
2288 * FUNCTION: PKIX_PL_X500Name_Create | |
2289 * DESCRIPTION: | |
2290 * | |
2291 * Creates a new X500Name using the UTF8 string representation pointed to by | |
2292 * "stringRep" and stores it at "pName". Once created, an X500Name is | |
2293 * immutable. | |
2294 * | |
2295 * Name ::= CHOICE { | |
2296 * RDNSequence } | |
2297 * | |
2298 * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName | |
2299 * | |
2300 * RelativeDistinguishedName ::= | |
2301 * SET OF AttributeTypeAndValue | |
2302 * | |
2303 * AttributeTypeAndValue ::= SEQUENCE { | |
2304 * type AttributeType, | |
2305 * value AttributeValue } | |
2306 * | |
2307 * AttributeType ::= OBJECT IDENTIFIER | |
2308 * | |
2309 * AttributeValue ::= ANY DEFINED BY AttributeType | |
2310 * | |
2311 * DirectoryString ::= CHOICE { | |
2312 * teletexString TeletexString (SIZE (1..MAX)), | |
2313 * printableString PrintableString (SIZE (1..MAX)), | |
2314 * universalString UniversalString (SIZE (1..MAX)), | |
2315 * utf8String UTF8String (SIZE (1..MAX)), | |
2316 * bmpString BMPString (SIZE (1..MAX)) } | |
2317 * | |
2318 * PARAMETERS: | |
2319 * "stringRep" | |
2320 * Address of UTF8 String representation of X500Name. Must be non-NULL. | |
2321 * "pName" | |
2322 * Address where object pointer will be stored. Must be non-NULL. | |
2323 * "plContext" | |
2324 * Platform-specific context pointer. | |
2325 * THREAD SAFETY: | |
2326 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2327 * RETURNS: | |
2328 * Returns NULL if the function succeeds. | |
2329 * Returns an X500Name Error if the function fails in a non-fatal way. | |
2330 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2331 */ | |
2332 PKIX_Error * | |
2333 PKIX_PL_X500Name_Create ( | |
2334 PKIX_PL_String *stringRep, | |
2335 PKIX_PL_X500Name **pName, | |
2336 void *plContext); | |
2337 | |
2338 #endif /* BUILD_LIBPKIX_TESTS */ | |
2339 | |
2340 /* | |
2341 * FUNCTION: PKIX_PL_X500Name_CreateFromCERTName | |
2342 * DESCRIPTION: | |
2343 * | |
2344 * The function creates x500Name using der encoded DN and/or pointer to | |
2345 * CERTName. If arument "name" is NULL, but derName is supplied when | |
2346 * the function generates nssDN(CERTName type) from der data. If derName | |
2347 * is not supplied, CERTName *name will not be used to generate DN DER | |
2348 * encoding. | |
2349 * | |
2350 * PARAMETERS: | |
2351 * "derName" | |
2352 * Address of DER representation of X500Name. Can be NULL | |
2353 * "name" | |
2354 * Address of CERTName representation of X500Name. Can be NULL | |
2355 * "pName" | |
2356 * Address where object pointer will be stored. Must be non-NULL. | |
2357 * "plContext" | |
2358 * Platform-specific context pointer. | |
2359 * THREAD SAFETY: | |
2360 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2361 * RETURNS: | |
2362 * Returns NULL if the function succeeds. | |
2363 * Returns an X500Name Error if the function fails in a non-fatal way. | |
2364 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2365 */ | |
2366 PKIX_Error * | |
2367 PKIX_PL_X500Name_CreateFromCERTName( | |
2368 SECItem *derName, | |
2369 CERTName *name, | |
2370 PKIX_PL_X500Name **pName, | |
2371 void *plContext); | |
2372 | |
2373 | |
2374 /* | |
2375 * TYPE: PKIX_PL_X500Name_Match | |
2376 * DESCRIPTION: | |
2377 * Checks whether the X500Name pointed to by "firstX500Name" MATCHES the | |
2378 * X500Name pointed to by "secondX500Name" and stores the boolean result at | |
2379 * "pResult". Two X500Names MATCH if they meet the conditions specified by | |
2380 * RFC 3280 (section 4.1.2.4). Namely: | |
2381 * | |
2382 * "This specification requires only a subset of the name comparison | |
2383 * functionality specified in the X.500 series of specifications. | |
2384 * Conforming implementations are REQUIRED to implement the following | |
2385 * name comparison rules: | |
2386 * | |
2387 * (a) attribute values encoded in different types (e.g., PrintableString | |
2388 * and BMPString) MAY be assumed to represent different strings; | |
2389 * | |
2390 * (b) attribute values in types other than PrintableString are case | |
2391 * sensitive (this permits matching of attribute values as binary objects) | |
2392 * | |
2393 * (c) attribute values in PrintableString are not case sensitive | |
2394 * (e.g., "Marianne Swanson" is the same as "MARIANNE SWANSON"); and | |
2395 * | |
2396 * (d) attribute values in PrintableString are compared after removing | |
2397 * leading and trailing white space and converting internal substrings of | |
2398 * one or more consecutive white space characters to a single space." | |
2399 * | |
2400 * PARAMETERS: | |
2401 * "firstX500Name" | |
2402 * Address of first X500Name to compare. Must be non-NULL. | |
2403 * "secondX500Name" | |
2404 * Address of second X500Name to compare. Must be non-NULL. | |
2405 * "pResult" | |
2406 * Address of Boolean result. Must be non-NULL. | |
2407 * "plContext" | |
2408 * Platform-specific context pointer. | |
2409 * THREAD SAFETY: | |
2410 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2411 * RETURNS: | |
2412 * Returns NULL if the function succeeds. | |
2413 * Returns an X500Name Error if the function fails in a non-fatal way. | |
2414 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2415 */ | |
2416 PKIX_Error * | |
2417 PKIX_PL_X500Name_Match( | |
2418 PKIX_PL_X500Name *firstX500Name, | |
2419 PKIX_PL_X500Name *secondX500Name, | |
2420 PKIX_Boolean *pResult, | |
2421 void *plContext); | |
2422 | |
2423 /* | |
2424 * FUNCTION: PKIX_PL_Date_Create_UTCTime | |
2425 * DESCRIPTION: | |
2426 * Creates a new Date of type UTCTime using the string representation pointed | |
2427 * to by "stringRep" and stores it at "pDate". The UTCTime restriction means | |
2428 * that the year can only be specified by the least significant two digits | |
2429 * (YY). As such, Only the years 1950-2049 can be represented. If "stringRep" | |
2430 * is NULL, this function creates a new Date representing the current time | |
2431 * and stores it at "pDate". Once created, a Date is immutable. | |
2432 * | |
2433 * If YY is greater than or equal to 50, the year is interpreted as 19YY. | |
2434 * If YY is less than 50, the year is interpreted as 20YY. | |
2435 * | |
2436 * The string representation of the date must be in the following form: | |
2437 * "YYMMDDhhmmssZ" where: | |
2438 * | |
2439 * YY is the least significant two digits of the year | |
2440 * MM is the month (01 to 12) | |
2441 * DD is the day (01 to 31) | |
2442 * hh is the hour (00 to 23) | |
2443 * mm are the minutes (00 to 59) | |
2444 * ss are the seconds (00 to 59) | |
2445 * Z indicates that local time is GMT | |
2446 * | |
2447 * PARAMETERS: | |
2448 * "stringRep" | |
2449 * Address of String representation of Date. | |
2450 * If NULL, current time is used. | |
2451 * "pDate" | |
2452 * Address where object pointer will be stored. Must be non-NULL. | |
2453 * "plContext" | |
2454 * Platform-specific context pointer. | |
2455 * THREAD SAFETY: | |
2456 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2457 * RETURNS: | |
2458 * Returns NULL if the function succeeds. | |
2459 * Returns a Date Error if the function fails in a non-fatal way. | |
2460 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2461 */ | |
2462 PKIX_Error * | |
2463 PKIX_PL_Date_Create_UTCTime ( | |
2464 PKIX_PL_String *stringRep, | |
2465 PKIX_PL_Date **pDate, | |
2466 void *plContext); | |
2467 | |
2468 /* | |
2469 * FUNCTION: PKIX_PL_Date_Create_UTCTime | |
2470 * DESCRIPTION: | |
2471 * Creates a new Date from PRTime data. | |
2472 * | |
2473 * PARAMETERS: | |
2474 * "time" | |
2475 * Represented time in PRTime type. | |
2476 * "pDate" | |
2477 * Address where object pointer will be stored. Must be non-NULL. | |
2478 * "plContext" | |
2479 * Platform-specific context pointer. | |
2480 * THREAD SAFETY: | |
2481 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2482 * RETURNS: | |
2483 * Returns NULL if the function succeeds. | |
2484 * Returns a Date Error if the function fails in a non-fatal way. | |
2485 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2486 */ | |
2487 PKIX_Error * | |
2488 PKIX_PL_Date_CreateFromPRTime( | |
2489 PRTime time, | |
2490 PKIX_PL_Date **pDate, | |
2491 void *plContext); | |
2492 | |
2493 /* | |
2494 * FUNCTION: PKIX_PL_Date_Create_CurrentOffBySeconds | |
2495 * DESCRIPTION: | |
2496 * Creates a new Date of type UTCTime for current time with seconds off by | |
2497 * "secondsOffset" and returns it at "pDate". | |
2498 * | |
2499 * PARAMETERS: | |
2500 * "secondsOffset" | |
2501 * A PKIX_Int32 indicates the time offset from current. If "secondsOffset" | |
2502 * is negative, the time is in past. | |
2503 * "pDate" | |
2504 * Address where object pointer will be stored. Must be non-NULL. | |
2505 * "plContext" | |
2506 * Platform-specific context pointer. | |
2507 * THREAD SAFETY: | |
2508 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2509 * RETURNS: | |
2510 * Returns NULL if the function succeeds. | |
2511 * Returns a Date Error if the function fails in a non-fatal way. | |
2512 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2513 */ | |
2514 PKIX_Error * | |
2515 PKIX_PL_Date_Create_CurrentOffBySeconds( | |
2516 PKIX_Int32 secondsOffset, | |
2517 PKIX_PL_Date **pDate, | |
2518 void *plContext); | |
2519 | |
2520 #ifdef BUILD_LIBPKIX_TESTS | |
2521 /* | |
2522 * FUNCTION: PKIX_PL_GeneralName_Create | |
2523 * DESCRIPTION: | |
2524 * | |
2525 * Creates a new GeneralName of type "nameType" using the string | |
2526 * representation pointed to by "stringRep" and stores it at "pGName". | |
2527 * All of the GeneralName type format values specified in pkixt.h are | |
2528 * supported, with the exception of PKIX_OTHER_NAME, PKIX_EDIPARTY_NAME, | |
2529 * PKIX_IP_NAME, and PKIX_X400_ADDRESS. A PKIX_ESCASCII string representation | |
2530 * should be used for all supported nameTypes, with the exception of | |
2531 * registeredID and directoryName. For registeredID, the string representation | |
2532 * should be the same as that used by PKIX_PL_OID_Create. For directoryName, | |
2533 * the string representation should be the same as that used by | |
2534 * PKIX_PL_X500Name_Create. If an unsupported name type is used, an Error is | |
2535 * returned. Once created, a GeneralName is immutable. | |
2536 * | |
2537 * GeneralName ::= CHOICE { | |
2538 * otherName [0] OtherName, | |
2539 * rfc822Name [1] IA5String, | |
2540 * dNSName [2] IA5String, | |
2541 * x400Address [3] ORAddress, | |
2542 * directoryName [4] Name, | |
2543 * ediPartyName [5] EDIPartyName, | |
2544 * uniformResourceIdentifier [6] IA5String, | |
2545 * iPAddress [7] OCTET STRING, | |
2546 * registeredID [8] OBJECT IDENTIFIER } | |
2547 * | |
2548 * | |
2549 * NOTE: This function is allowed to be called only by pkix tests programs. | |
2550 * | |
2551 * PARAMETERS: | |
2552 * "nameType" | |
2553 * Type of GeneralName to be created. This must be one of the GeneralName | |
2554 * type format values specified in pkixt.h | |
2555 * "stringRep" | |
2556 * Address of String representation of GeneralName. Must be non-NULL. | |
2557 * "pGName" | |
2558 * Address where object pointer will be stored. Must be non-NULL. | |
2559 * "plContext" | |
2560 * Platform-specific context pointer. | |
2561 * THREAD SAFETY: | |
2562 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2563 * RETURNS: | |
2564 * Returns NULL if the function succeeds. | |
2565 * Returns a GeneralName Error if the function fails in a non-fatal way. | |
2566 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2567 */ | |
2568 PKIX_Error * | |
2569 PKIX_PL_GeneralName_Create ( | |
2570 PKIX_UInt32 nameType, | |
2571 PKIX_PL_String *stringRep, | |
2572 PKIX_PL_GeneralName **pGName, | |
2573 void *plContext); | |
2574 #endif /* BUILD_LIBPKIX_TESTS */ | |
2575 | |
2576 /* | |
2577 * FUNCTION: PKIX_PL_CertNameConstraints_CheckNamesInNameSpace | |
2578 * DESCRIPTION: | |
2579 * | |
2580 * This function checks whether names in "nameList" comply with | |
2581 * "nameConstraints". It stores PKIX_TRUE at "pCheckPass" if the names meet the | |
2582 * requirement of the NameConstraints, PKIX_FALSE otherwise. | |
2583 * | |
2584 * PARAMETERS | |
2585 * "nameList" | |
2586 * List of GeneralNames that are checked for compliance. May be empty | |
2587 * or NULL. | |
2588 * "nameConstraints" | |
2589 * Address of CertNameConstraints that provides lists of permitted | |
2590 * and excluded names. Must be non-NULL. | |
2591 * "pCheckPass" | |
2592 * Address where PKIX_TRUE is returned if the all names in "nameList" are | |
2593 * valid. Must be non-NULL. | |
2594 * "plContext" - Platform-specific context pointer. | |
2595 * THREAD SAFETY: | |
2596 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2597 * RETURNS: | |
2598 * Returns NULL if the function succeeds. | |
2599 * Returns a NameConstraints Error if the function fails in a | |
2600 * non-fatal way. | |
2601 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2602 */ | |
2603 PKIX_Error * | |
2604 PKIX_PL_CertNameConstraints_CheckNamesInNameSpace( | |
2605 PKIX_List *nameList, /* List of PKIX_PL_GeneralName */ | |
2606 PKIX_PL_CertNameConstraints *nameConstraints, | |
2607 PKIX_Boolean *pCheckPass, | |
2608 void *plContext); | |
2609 | |
2610 /* | |
2611 * FUNCTION: PKIX_PL_AIAMgr_Create | |
2612 * DESCRIPTION: | |
2613 * | |
2614 * This function creates an AIAMgr to handle retrieval of Certs and CRLs | |
2615 * from servers given by AIA Certificate extensions. It manages connections | |
2616 * and caches. The manager created is stored at "pAIAMgr". | |
2617 * | |
2618 * PARAMETERS: | |
2619 * "pAIAMgr" | |
2620 * The address at which the result is stored. Must be non-NULL. | |
2621 * THREAD SAFETY: | |
2622 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2623 * RETURNS: | |
2624 * Returns NULL if the function succeeds. | |
2625 * Returns an AIAMgr Error if the function fails in a non-fatal way | |
2626 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2627 */ | |
2628 PKIX_Error * | |
2629 PKIX_PL_AIAMgr_Create( | |
2630 PKIX_PL_AIAMgr **pAIAMgr, | |
2631 void *plContext); | |
2632 | |
2633 /* | |
2634 * FUNCTION: PKIX_PL_AIAMgr_GetAIACerts | |
2635 * DESCRIPTION: | |
2636 * | |
2637 * This function uses the AIAMgr pointed to by "aiaMgr" to retrieve the Certs | |
2638 * specified by an AIA certificate extension, if any, in the Cert pointed to by | |
2639 * "prevCert", storing the results at "pCerts". If the certificate has no such | |
2640 * extension, this function stores NULL at "pCerts". | |
2641 * | |
2642 * If the request is suspended for non-blocking I/O, a platform-dependent | |
2643 * context is stored at "pNBIOContext" and NULL is stored at "pCerts". This | |
2644 * return is referred to as the WOULDBLOCK state. Note that the caller must | |
2645 * check for a non-NULL value at "pNBIOContext", to distinguish this state from | |
2646 * the "no such extension" return described in the first paragraph. (The | |
2647 * alternative would be to return an empty List, but it seemed wrong to incur | |
2648 * the overhead of creating and destroying an empty List for the most common | |
2649 * situation.) | |
2650 * | |
2651 * After a WOULDBLOCK return, the user may continue the operation by calling | |
2652 * pkix_AIAMgr_GetAIACerts (possibly more than once, if the function again | |
2653 * returns in the WOULDBLOCK state) with the previously-returned non-NULL | |
2654 * value of "pNBIOContext". When results are complete, NULL is stored at | |
2655 * "pNBIOContext", and the results (which may be NULL) are stored at "pCerts". | |
2656 * | |
2657 * PARAMETERS: | |
2658 * "aiaMgr" | |
2659 * The AIAMgr which controls the retrieval of certificates. Must be | |
2660 * non-NULL. | |
2661 * "prevCert" | |
2662 * Address of PKIX_PL_Cert which may provide an AIA or SIA extension. Must | |
2663 * be non-NULL. | |
2664 * "pNBIOContext" | |
2665 * Address at which platform-dependent information is returned if request | |
2666 * is suspended for non-blocking I/O. Must be non-NULL. | |
2667 * "pCerts" | |
2668 * Address at which the returned List is stored. Must be non-NULL. | |
2669 * "plContext" | |
2670 * Platform-specific context pointer. | |
2671 * THREAD SAFETY: | |
2672 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | |
2673 * RETURNS: | |
2674 * Returns NULL if the function succeeds. | |
2675 * Returns an AIAMgr Error if the function fails in a non-fatal way | |
2676 * Returns a Fatal Error if the function fails in an unrecoverable way. | |
2677 */ | |
2678 PKIX_Error * | |
2679 PKIX_PL_AIAMgr_GetAIACerts( | |
2680 PKIX_PL_AIAMgr *aiaMgr, | |
2681 PKIX_PL_Cert *prevCert, | |
2682 void **pNBIOContext, | |
2683 PKIX_List **pCerts, | |
2684 void *plContext); | |
2685 | |
2686 typedef PKIX_Error * | |
2687 (*PKIX_PL_VerifyCallback)( | |
2688 PKIX_PL_Object *signedObject, | |
2689 PKIX_PL_Cert *signerCert, /* can be unknown */ | |
2690 PKIX_PL_Date *producedAt, | |
2691 PKIX_ProcessingParams *procParams, | |
2692 void **pNBIOContext, | |
2693 void **pState, | |
2694 PKIX_BuildResult **pBuildResult, | |
2695 PKIX_VerifyNode **pVerifyTree, | |
2696 void *plContext); | |
2697 | |
2698 #ifdef __cplusplus | |
2699 } | |
2700 #endif | |
2701 | |
2702 #endif /* _PKIX_PL_PKI_H */ | |
OLD | NEW |