| OLD | NEW |
| (Empty) | |
| 1 /* ***** BEGIN LICENSE BLOCK ***** |
| 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 3 * |
| 4 * The contents of this file are subject to the Mozilla Public License Version |
| 5 * 1.1 (the "License"); you may not use this file except in compliance with |
| 6 * the License. You may obtain a copy of the License at |
| 7 * http://www.mozilla.org/MPL/ |
| 8 * |
| 9 * Software distributed under the License is distributed on an "AS IS" basis, |
| 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 11 * for the specific language governing rights and limitations under the |
| 12 * License. |
| 13 * |
| 14 * The Original Code is the PKIX-C library. |
| 15 * |
| 16 * The Initial Developer of the Original Code is |
| 17 * Sun Microsystems, Inc. |
| 18 * Portions created by the Initial Developer are |
| 19 * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. |
| 20 * |
| 21 * Contributor(s): |
| 22 * Sun Microsystems, Inc. |
| 23 * |
| 24 * Alternatively, the contents of this file may be used under the terms of |
| 25 * either the GNU General Public License Version 2 or later (the "GPL"), or |
| 26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 27 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 28 * of those above. If you wish to allow use of your version of this file only |
| 29 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 30 * use your version of this file under the terms of the MPL, indicate your |
| 31 * decision by deleting the provisions above and replace them with the notice |
| 32 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 33 * the provisions above, a recipient may use your version of this file under |
| 34 * the terms of any one of the MPL, the GPL or the LGPL. |
| 35 * |
| 36 * ***** END LICENSE BLOCK ***** */ |
| 37 /* |
| 38 * This file defines functions associated with the PKIX_CertStore type. |
| 39 * |
| 40 */ |
| 41 |
| 42 #ifndef _PKIX_CERTSTORE_H |
| 43 #define _PKIX_CERTSTORE_H |
| 44 |
| 45 #include "pkixt.h" |
| 46 |
| 47 #ifdef __cplusplus |
| 48 extern "C" { |
| 49 #endif |
| 50 |
| 51 /* General |
| 52 * |
| 53 * Please refer to the libpkix Programmer's Guide for detailed information |
| 54 * about how to use the libpkix library. Certain key warnings and notices from |
| 55 * that document are repeated here for emphasis. |
| 56 * |
| 57 * All identifiers in this file (and all public identifiers defined in |
| 58 * libpkix) begin with "PKIX_". Private identifiers only intended for use |
| 59 * within the library begin with "pkix_". |
| 60 * |
| 61 * A function returns NULL upon success, and a PKIX_Error pointer upon failure. |
| 62 * |
| 63 * Unless otherwise noted, for all accessor (gettor) functions that return a |
| 64 * PKIX_PL_Object pointer, callers should assume that this pointer refers to a |
| 65 * shared object. Therefore, the caller should treat this shared object as |
| 66 * read-only and should not modify this shared object. When done using the |
| 67 * shared object, the caller should release the reference to the object by |
| 68 * using the PKIX_PL_Object_DecRef function. |
| 69 * |
| 70 * While a function is executing, if its arguments (or anything referred to by |
| 71 * its arguments) are modified, free'd, or destroyed, the function's behavior |
| 72 * is undefined. |
| 73 * |
| 74 */ |
| 75 |
| 76 /* PKIX_CertStore |
| 77 * |
| 78 * A PKIX_CertStore provides a standard way for the caller to retrieve |
| 79 * certificates and CRLs from a particular repository (or "store") of |
| 80 * certificates and CRLs, including LDAP directories, flat files, local |
| 81 * databases, etc. The CertCallback allows custom certificate retrieval logic |
| 82 * to be used while the CRLCallback allows custom CRL retrieval logic to be |
| 83 * used. Additionally, a CertStore can be initialized with a certStoreContext, |
| 84 * which is where the caller can specify configuration data such as the host |
| 85 * name of an LDAP server. Note that this certStoreContext must be an |
| 86 * Object (although any object type), allowing it to be reference-counted and |
| 87 * allowing it to provide the standard Object functions (Equals, Hashcode, |
| 88 * ToString, Compare, Duplicate). Please note that each certStoreContext must |
| 89 * provide Equals and Hashcode functions in order for the caching (on Cert and |
| 90 * CertChain) to work correctly. When providing those two functions, it is not |
| 91 * required that all the components of the object be hashed or checked for |
| 92 * equality, but merely that the functions distinguish between unique |
| 93 * instances of the certStoreContext. |
| 94 * |
| 95 * Once the caller has created the CertStore object, the caller then specifies |
| 96 * these CertStore objects in a ProcessingParams object and passes that object |
| 97 * to PKIX_ValidateChain or PKIX_BuildChain, which uses the objects to call the |
| 98 * user's callback functions as needed during the validation or building |
| 99 * process. |
| 100 * |
| 101 * The order of CertStores stored (as a list) at ProcessingParams determines |
| 102 * the order in which certificates are retrieved. Trusted CertStores should |
| 103 * precede non-trusted ones on the list of CertStores so their certificates |
| 104 * are evaluated ahead of other certificates selected on the basis of the same |
| 105 * selector criteria. |
| 106 * |
| 107 * The CheckTrustCallback function is used when the CertStore object |
| 108 * supports trust status, which means a Cert's trust status can be altered |
| 109 * dynamically. When a CertStore object is created, if the |
| 110 * CheckTrustCallback is initialized to be non-NULL, this CertStore is |
| 111 * defaulted as supporting trust. Then whenever a Cert needs to (re)check its |
| 112 * trust status, this callback can be invoked. When a Cert is retrieved by |
| 113 * a CertStore supports trust, at its GetCertCallback, the CertStore |
| 114 * information should be updated in Cert's data structure so the link between |
| 115 * the Cert and CertStore exists. |
| 116 * |
| 117 */ |
| 118 |
| 119 /* |
| 120 * FUNCTION: PKIX_CertStore_CertCallback |
| 121 * DESCRIPTION: |
| 122 * |
| 123 * This callback function retrieves from the CertStore pointed to by "store" |
| 124 * all the certificates that match the CertSelector pointed to by "selector". |
| 125 * It places these certificates in a List and stores a pointer to the List at |
| 126 * "pCerts". If no certificates are found which match the CertSelector's |
| 127 * criteria, this function stores an empty List at "pCerts". In either case, if |
| 128 * the operation is completed, NULL is stored at "pNBIOContext". |
| 129 * |
| 130 * A CertStore which uses non-blocking I/O may store platform-dependent |
| 131 * information at "pNBIOContext" and NULL at "pCerts" to indicate that I/O is |
| 132 * pending. A subsequent call to PKIX_CertStore_CertContinue is required to |
| 133 * finish the operation and to obtain the List of Certs. |
| 134 * |
| 135 * Note that the List returned by this function is immutable. |
| 136 * |
| 137 * PARAMETERS: |
| 138 * "store" |
| 139 * Address of CertStore from which Certs are to be retrieved. |
| 140 * Must be non-NULL. |
| 141 * "selector" |
| 142 * Address of CertSelector whose criteria must be satisfied. |
| 143 * Must be non-NULL. |
| 144 * "verifyNode" |
| 145 * Parent log node for tracking of filtered out certs. |
| 146 * "pNBIOContext" |
| 147 * Address at which platform-dependent information is stored if the |
| 148 * operation is suspended for non-blocking I/O. Must be non-NULL. |
| 149 * "pCerts" |
| 150 * Address where object pointer will be stored. Must be non-NULL. |
| 151 * "plContext" |
| 152 * Platform-specific context pointer. |
| 153 * THREAD SAFETY: |
| 154 * Thread Safe |
| 155 * |
| 156 * Multiple threads must be able to safely call this function without |
| 157 * worrying about conflicts, even if they're operating on the same object. |
| 158 * RETURNS: |
| 159 * Returns NULL if the function succeeds. |
| 160 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 161 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 162 */ |
| 163 typedef PKIX_Error * |
| 164 (*PKIX_CertStore_CertCallback)( |
| 165 PKIX_CertStore *store, |
| 166 PKIX_CertSelector *selector, |
| 167 PKIX_VerifyNode *verifyNode, |
| 168 void **pNBIOContext, |
| 169 PKIX_List **pCerts, /* list of PKIX_PL_Cert */ |
| 170 void *plContext); |
| 171 |
| 172 /* |
| 173 * FUNCTION: PKIX_CertStore_CertContinue |
| 174 * DESCRIPTION: |
| 175 * |
| 176 * This function continues the non-blocking operation initiated by an earlier |
| 177 * call to the CertCallback function, for the CertStore pointed to by "store". |
| 178 * If an earlier call did not terminate with the WOULDBLOCK indication (non-NUL
L |
| 179 * value returned in "pNBIOContext") calling this function will return a fatal |
| 180 * error. If the operation is completed the certificates found are placed in a |
| 181 * List, a pointer to which is stored at "pCerts". If no certificates are found |
| 182 * which match the CertSelector's criteria, this function stores an empty List |
| 183 * at "pCerts". In either case, if the operation is completed, NULL is stored |
| 184 * at "pNBIOContext". |
| 185 * |
| 186 * If non-blocking I/O is still pending this function stores platform-dependent |
| 187 * information at "pNBIOContext" and NULL at "pCerts". A subsequent call to |
| 188 * PKIX_CertStore_CertContinue is required to finish the operation and to |
| 189 * obtain the List of Certs. |
| 190 * |
| 191 * Note that the List returned by this function is immutable. |
| 192 * |
| 193 * PARAMETERS: |
| 194 * "store" |
| 195 * Address of CertStore from which Certs are to be retrieved. |
| 196 * Must be non-NULL. |
| 197 * "selector" |
| 198 * Address of CertSelector whose criteria must be satisfied. |
| 199 * Must be non-NULL. |
| 200 * "verifyNode" |
| 201 * Parent log node for tracking of filtered out certs. |
| 202 * "pNBIOContext" |
| 203 * Address at which platform-dependent information is stored if the |
| 204 * operation is suspended for non-blocking I/O. Must be non-NULL. |
| 205 * "pCerts" |
| 206 * Address where object pointer will be stored. Must be non-NULL. |
| 207 * "plContext" |
| 208 * Platform-specific context pointer. |
| 209 * THREAD SAFETY: |
| 210 * Thread Safe |
| 211 * |
| 212 * Multiple threads must be able to safely call this function without |
| 213 * worrying about conflicts, even if they're operating on the same object. |
| 214 * RETURNS: |
| 215 * Returns NULL if the function succeeds. |
| 216 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 217 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 218 */ |
| 219 PKIX_Error * |
| 220 PKIX_CertStore_CertContinue( |
| 221 PKIX_CertStore *store, |
| 222 PKIX_CertSelector *selector, |
| 223 PKIX_VerifyNode *verifyNode, |
| 224 void **pNBIOContext, |
| 225 PKIX_List **pCerts, /* list of PKIX_PL_Cert */ |
| 226 void *plContext); |
| 227 |
| 228 typedef PKIX_Error * |
| 229 (*PKIX_CertStore_CertContinueFunction)( |
| 230 PKIX_CertStore *store, |
| 231 PKIX_CertSelector *selector, |
| 232 PKIX_VerifyNode *verifyNode, |
| 233 void **pNBIOContext, |
| 234 PKIX_List **pCerts, /* list of PKIX_PL_Cert */ |
| 235 void *plContext); |
| 236 |
| 237 /* |
| 238 * FUNCTION: PKIX_CertStore_CRLCallback |
| 239 * DESCRIPTION: |
| 240 * |
| 241 * This callback function retrieves from the CertStore pointed to by "store" |
| 242 * all the CRLs that match the CRLSelector pointed to by "selector". It |
| 243 * places these CRLs in a List and stores a pointer to the List at "pCRLs". |
| 244 * If no CRLs are found which match the CRLSelector's criteria, this function |
| 245 * stores an empty List at "pCRLs". In either case, if the operation is |
| 246 * completed, NULL is stored at "pNBIOContext". |
| 247 * |
| 248 * A CertStore which uses non-blocking I/O may store platform-dependent |
| 249 * information at "pNBIOContext" and NULL at "pCrls" to indicate that I/O is |
| 250 * pending. A subsequent call to PKIX_CertStore_CRLContinue is required to |
| 251 * finish the operation and to obtain the List of Crls. |
| 252 * |
| 253 * Note that the List returned by this function is immutable. |
| 254 * |
| 255 * PARAMETERS: |
| 256 * "store" |
| 257 * Address of CertStore from which CRLs are to be retrieved. |
| 258 * Must be non-NULL. |
| 259 * "selector" |
| 260 * Address of CRLSelector whose criteria must be satisfied. |
| 261 * Must be non-NULL. |
| 262 * "pCrls" |
| 263 * Address where object pointer will be stored. Must be non-NULL. |
| 264 * "plContext" |
| 265 * Platform-specific context pointer. |
| 266 * THREAD SAFETY: |
| 267 * Thread Safe |
| 268 * |
| 269 * Multiple threads must be able to safely call this function without |
| 270 * worrying about conflicts, even if they're operating on the same object. |
| 271 * RETURNS: |
| 272 * Returns NULL if the function succeeds. |
| 273 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 274 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 275 */ |
| 276 typedef PKIX_Error * |
| 277 (*PKIX_CertStore_CRLCallback)( |
| 278 PKIX_CertStore *store, |
| 279 PKIX_CRLSelector *selector, |
| 280 void **pNBIOContext, |
| 281 PKIX_List **pCrls, /* list of PKIX_PL_CRL */ |
| 282 void *plContext); |
| 283 |
| 284 /* |
| 285 * FUNCTION: PKIX_CertStore_ImportCrlCallback |
| 286 * DESCRIPTION: |
| 287 * |
| 288 * The function imports crl list into a cert store. Stores that |
| 289 * have local cache may only have that function defined. |
| 290 * |
| 291 * PARAMETERS: |
| 292 * "store" |
| 293 * Address of CertStore from which CRLs are to be retrieved. |
| 294 * Must be non-NULL. |
| 295 * "issuerName" |
| 296 * Name of the issuer that will be used to track bad der crls. |
| 297 * "crlList" |
| 298 * Address on the importing crl list. |
| 299 * "plContext" |
| 300 * Platform-specific context pointer. |
| 301 * THREAD SAFETY: |
| 302 * Thread Safe |
| 303 * |
| 304 * Multiple threads must be able to safely call this function without |
| 305 * worrying about conflicts, even if they're operating on the same object. |
| 306 * RETURNS: |
| 307 * Returns NULL if the function succeeds. |
| 308 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 309 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 310 */ |
| 311 typedef PKIX_Error * |
| 312 (*PKIX_CertStore_ImportCrlCallback)( |
| 313 PKIX_CertStore *store, |
| 314 PKIX_PL_X500Name *issuerName, |
| 315 PKIX_List *crlList, |
| 316 void *plContext); |
| 317 |
| 318 /* |
| 319 * FUNCTION: PKIX_CertStore_CheckRevokationByCrlCallback |
| 320 * DESCRIPTION: |
| 321 * |
| 322 * The function checks revocation status of a cert with specified |
| 323 * issuer, date. It returns revocation status of a cert and |
| 324 * a reason code(if any) if a cert was revoked. |
| 325 * |
| 326 * PARAMETERS: |
| 327 * "store" |
| 328 * Address of CertStore from which CRLs are to be retrieved. |
| 329 * Must be non-NULL. |
| 330 * "cert" |
| 331 * Certificate which revocation status will be checked. |
| 332 * "issuer" |
| 333 * Issuer certificate of the "crl". |
| 334 * "date" |
| 335 * Date of the revocation check. |
| 336 * "crlDownloadDone" |
| 337 * Indicates, that all needed crl downloads are done by the time of |
| 338 * the revocation check. |
| 339 * "reasonCode" |
| 340 * If cert is revoked, returned reason code for which a cert was revoked. |
| 341 * "revStatus" |
| 342 * Returned revocation status of the cert. See PKIX_RevocationStatus |
| 343 * for more details |
| 344 * "plContext" |
| 345 * Platform-specific context pointer. |
| 346 * THREAD SAFETY: |
| 347 * Thread Safe |
| 348 * |
| 349 * Multiple threads must be able to safely call this function without |
| 350 * worrying about conflicts, even if they're operating on the same object. |
| 351 * RETURNS: |
| 352 * Returns NULL if the function succeeds. |
| 353 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 354 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 355 */ |
| 356 typedef PKIX_Error * |
| 357 (*PKIX_CertStore_CheckRevokationByCrlCallback)( |
| 358 PKIX_CertStore *store, |
| 359 PKIX_PL_Cert *cert, |
| 360 PKIX_PL_Cert *issuer, |
| 361 PKIX_PL_Date *date, |
| 362 PKIX_Boolean crlDownloadDone, |
| 363 PKIX_UInt32 *reasonCode, |
| 364 PKIX_RevocationStatus *revStatus, |
| 365 void *plContext); |
| 366 |
| 367 /* |
| 368 * FUNCTION: PKIX_CertStore_CrlContinue |
| 369 * DESCRIPTION: |
| 370 * |
| 371 * This function continues the non-blocking operation initiated by an earlier |
| 372 * call to the CRLCallback function, for the CertStore pointed to by "store". |
| 373 * If an earlier call did not terminate with the WOULDBLOCK indication (non-NUL
L |
| 374 * value returned in "pNBIOContext") calling this function will return a fatal |
| 375 * error. If the operation is completed the crls found are placed in a List, a |
| 376 * pointer to which is stored at "pCrls". If no crls are found which match the |
| 377 * CRLSelector's criteria, this function stores an empty List at "pCrls". In |
| 378 * either case, if the operation is completed, NULL is stored at "pNBIOContext"
. |
| 379 * |
| 380 * If non-blocking I/O is still pending this function stores platform-dependent |
| 381 * information at "pNBIOContext" and NULL at "pCrls". A subsequent call to |
| 382 * PKIX_CertStore_CrlContinue is required to finish the operation and to |
| 383 * obtain the List of Crls. |
| 384 * |
| 385 * Note that the List returned by this function is immutable. |
| 386 * |
| 387 * PARAMETERS: |
| 388 * "store" |
| 389 * Address of CertStore from which Crls are to be retrieved. |
| 390 * Must be non-NULL. |
| 391 * "selector" |
| 392 * Address of CRLSelector whose criteria must be satisfied. |
| 393 * Must be non-NULL. |
| 394 * "pNBIOContext" |
| 395 * Address at which platform-dependent information is stored if the |
| 396 * operation is suspended for non-blocking I/O. Must be non-NULL. |
| 397 * "pCrls" |
| 398 * Address where object pointer will be stored. Must be non-NULL. |
| 399 * "plContext" |
| 400 * Platform-specific context pointer. |
| 401 * THREAD SAFETY: |
| 402 * Thread Safe |
| 403 * |
| 404 * Multiple threads must be able to safely call this function without |
| 405 * worrying about conflicts, even if they're operating on the same object. |
| 406 * RETURNS: |
| 407 * Returns NULL if the function succeeds. |
| 408 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 409 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 410 */ |
| 411 PKIX_Error * |
| 412 PKIX_CertStore_CrlContinue( |
| 413 PKIX_CertStore *store, |
| 414 PKIX_CRLSelector *selector, |
| 415 void **pNBIOContext, |
| 416 PKIX_List **pCrls, /* list of PKIX_PL_CRL */ |
| 417 void *plContext); |
| 418 |
| 419 typedef PKIX_Error * |
| 420 (*PKIX_CertStore_CrlContinueFunction)( |
| 421 PKIX_CertStore *store, |
| 422 PKIX_CRLSelector *selector, |
| 423 void **pNBIOContext, |
| 424 PKIX_List **pCrls, /* list of PKIX_PL_CRL */ |
| 425 void *plContext); |
| 426 |
| 427 /* |
| 428 * FUNCTION: PKIX_CertStore_CheckTrustCallback |
| 429 * DESCRIPTION: |
| 430 * |
| 431 * This callback function rechecks "cert's" trust status from the CertStore |
| 432 * pointed to by "store". |
| 433 * |
| 434 * PARAMETERS: |
| 435 * "store" |
| 436 * Address of CertStore from which Certs are to be checked. |
| 437 * Must be non-NULL. |
| 438 * "cert" |
| 439 * Address of Cert whose trust status needs to be rechecked. |
| 440 * Must be non-NULL. |
| 441 * "pTrusted" |
| 442 * Address of PKIX_Boolean where the trust status is returned. |
| 443 * Must be non-NULL. |
| 444 * "plContext" |
| 445 * Platform-specific context pointer. |
| 446 * THREAD SAFETY: |
| 447 * Thread Safe |
| 448 * |
| 449 * Multiple threads must be able to safely call this function without |
| 450 * worrying about conflicts, even if they're operating on the same object. |
| 451 * RETURNS: |
| 452 * Returns NULL if the function succeeds. |
| 453 * Returns a CertStore Error if the function fails in a non-fatal way. |
| 454 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 455 */ |
| 456 typedef PKIX_Error * |
| 457 (*PKIX_CertStore_CheckTrustCallback)( |
| 458 PKIX_CertStore *store, |
| 459 PKIX_PL_Cert *cert, |
| 460 PKIX_Boolean *pTrusted, |
| 461 void *plContext); |
| 462 |
| 463 /* |
| 464 * FUNCTION: PKIX_CertStore_Create |
| 465 * DESCRIPTION: |
| 466 * |
| 467 * Creates a new CertStore and stores it at "pStore". The new CertStore uses |
| 468 * the CertCallback pointed to by "certCallback" and the CRLCallback pointed |
| 469 * to by "crlCallback" as its callback functions and uses the Object pointed |
| 470 * to by "certStoreContext" as its context . Note that this certStoreContext |
| 471 * must be an Object (although any object type), allowing it to be |
| 472 * reference-counted and allowing it to provide the standard Object functions |
| 473 * (Equals, Hashcode, ToString, Compare, Duplicate). Once created, a |
| 474 * CertStore object is immutable, although the underlying repository can |
| 475 * change. For example, a CertStore will often be a front-end for a database |
| 476 * or directory. The contents of that directory can change after the |
| 477 * CertStore object is created, but the CertStore object remains immutable. |
| 478 * |
| 479 * PARAMETERS: |
| 480 * "certCallback" |
| 481 * The CertCallback function to be used. Must be non-NULL. |
| 482 * "crlCallback" |
| 483 * The CRLCallback function to be used. Must be non-NULL. |
| 484 * "certContinue" |
| 485 * The function to be used to resume a certCallback that returned with a |
| 486 * WOULDBLOCK condition. Must be non-NULL if certStore supports non-blockin
g |
| 487 * I/O. |
| 488 * "crlContinue" |
| 489 * The function to be used to resume a crlCallback that returned with a |
| 490 * WOULDBLOCK condition. Must be non-NULL if certStore supports non-blockin
g |
| 491 * I/O. |
| 492 * "trustCallback" |
| 493 * Address of PKIX_CertStore_CheckTrustCallback which is called to |
| 494 * verify the trust status of Certs in this CertStore. |
| 495 * "certStoreContext" |
| 496 * Address of Object representing the CertStore's context (if any). |
| 497 * "cachedFlag" |
| 498 * If TRUE indicates data retrieved from CertStore should be cached. |
| 499 * "localFlag" |
| 500 * Boolean value indicating whether this CertStore is local. |
| 501 * "pStore" |
| 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 CertStore 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_CertStore_Create( |
| 514 PKIX_CertStore_CertCallback certCallback, |
| 515 PKIX_CertStore_CRLCallback crlCallback, |
| 516 PKIX_CertStore_CertContinueFunction certContinue, |
| 517 PKIX_CertStore_CrlContinueFunction crlContinue, |
| 518 PKIX_CertStore_CheckTrustCallback trustCallback, |
| 519 PKIX_CertStore_ImportCrlCallback importCrlCallback, |
| 520 PKIX_CertStore_CheckRevokationByCrlCallback checkRevByCrlCallback, |
| 521 PKIX_PL_Object *certStoreContext, |
| 522 PKIX_Boolean cachedFlag, |
| 523 PKIX_Boolean localFlag, |
| 524 PKIX_CertStore **pStore, |
| 525 void *plContext); |
| 526 |
| 527 /* |
| 528 * FUNCTION: PKIX_CertStore_GetCertCallback |
| 529 * DESCRIPTION: |
| 530 * |
| 531 * Retrieves a pointer to "store's" Cert callback function and put it in |
| 532 * "pCallback". |
| 533 * |
| 534 * PARAMETERS: |
| 535 * "store" |
| 536 * The CertStore whose Cert callback is desired. Must be non-NULL. |
| 537 * "pCallback" |
| 538 * Address where Cert callback function pointer will be stored. |
| 539 * Must be non-NULL. |
| 540 * "plContext" |
| 541 * Platform-specific context pointer. |
| 542 * THREAD SAFETY: |
| 543 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 544 * RETURNS: |
| 545 * Returns NULL if the function succeeds. |
| 546 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 547 */ |
| 548 PKIX_Error * |
| 549 PKIX_CertStore_GetCertCallback( |
| 550 PKIX_CertStore *store, |
| 551 PKIX_CertStore_CertCallback *pCallback, |
| 552 void *plContext); |
| 553 |
| 554 /* |
| 555 * FUNCTION: PKIX_CertStore_GetCRLCallback |
| 556 * DESCRIPTION: |
| 557 * |
| 558 * Retrieves a pointer to "store's" CRL callback function and put it in |
| 559 * "pCallback". |
| 560 * |
| 561 * PARAMETERS: |
| 562 * "store" |
| 563 * The CertStore whose CRL callback is desired. Must be non-NULL. |
| 564 * "pCallback" |
| 565 * Address where CRL callback function pointer will be stored. |
| 566 * Must be non-NULL. |
| 567 * "plContext" |
| 568 * Platform-specific context pointer. |
| 569 * THREAD SAFETY: |
| 570 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 571 * RETURNS: |
| 572 * Returns NULL if the function succeeds. |
| 573 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 574 */ |
| 575 PKIX_Error * |
| 576 PKIX_CertStore_GetCRLCallback( |
| 577 PKIX_CertStore *store, |
| 578 PKIX_CertStore_CRLCallback *pCallback, |
| 579 void *plContext); |
| 580 |
| 581 /* |
| 582 * FUNCTION: PKIX_CertStore_GetImportCrlCallback |
| 583 * DESCRIPTION: |
| 584 * |
| 585 * Retrieves a pointer to "store's" Import CRL callback function and put it in |
| 586 * "pCallback". |
| 587 * |
| 588 * PARAMETERS: |
| 589 * "store" |
| 590 * The CertStore whose CRL callback is desired. Must be non-NULL. |
| 591 * "pCallback" |
| 592 * Address where CRL callback function pointer will be stored. |
| 593 * Must be non-NULL. |
| 594 * "plContext" |
| 595 * Platform-specific context pointer. |
| 596 * THREAD SAFETY: |
| 597 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 598 * RETURNS: |
| 599 * Returns NULL if the function succeeds. |
| 600 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 601 */ |
| 602 PKIX_Error * |
| 603 PKIX_CertStore_GetImportCrlCallback( |
| 604 PKIX_CertStore *store, |
| 605 PKIX_CertStore_ImportCrlCallback *pCallback, |
| 606 void *plContext); |
| 607 |
| 608 /* |
| 609 * FUNCTION: PKIX_CertStore_GetCheckRevByCrl |
| 610 * DESCRIPTION: |
| 611 * |
| 612 * Retrieves a pointer to "store's" CRL revocation checker callback function |
| 613 * and put it in "pCallback". |
| 614 * |
| 615 * PARAMETERS: |
| 616 * "store" |
| 617 * The CertStore whose CRL callback is desired. Must be non-NULL. |
| 618 * "pCallback" |
| 619 * Address where CRL callback function pointer will be stored. |
| 620 * Must be non-NULL. |
| 621 * "plContext" |
| 622 * Platform-specific context pointer. |
| 623 * THREAD SAFETY: |
| 624 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 625 * RETURNS: |
| 626 * Returns NULL if the function succeeds. |
| 627 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 628 */ |
| 629 PKIX_Error * |
| 630 PKIX_CertStore_GetCrlCheckerFn( |
| 631 PKIX_CertStore *store, |
| 632 PKIX_CertStore_CheckRevokationByCrlCallback *pCallback, |
| 633 void *plContext); |
| 634 |
| 635 /* |
| 636 * FUNCTION: PKIX_CertStore_GetTrustCallback |
| 637 * DESCRIPTION: |
| 638 * |
| 639 * Retrieves the function pointer to the CheckTrust callback function of the |
| 640 * CertStore pointed to by "store" and stores it at "pCallback". |
| 641 * |
| 642 * PARAMETERS: |
| 643 * "store" |
| 644 * The CertStore whose CheckTrust callback is desired. Must be non-NULL. |
| 645 * "pCallback" |
| 646 * Address where CheckTrust callback function pointer will be stored. |
| 647 * Must be non-NULL. |
| 648 * "plContext" |
| 649 * Platform-specific context pointer. |
| 650 * THREAD SAFETY: |
| 651 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 652 * RETURNS: |
| 653 * Returns NULL if the function succeeds. |
| 654 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 655 */ |
| 656 PKIX_Error * |
| 657 PKIX_CertStore_GetTrustCallback( |
| 658 PKIX_CertStore *store, |
| 659 PKIX_CertStore_CheckTrustCallback *pCallback, |
| 660 void *plContext); |
| 661 |
| 662 /* |
| 663 * FUNCTION: PKIX_CertStore_GetCertStoreContext |
| 664 * DESCRIPTION: |
| 665 * |
| 666 * Retrieves a pointer to the Object representing the context (if any) |
| 667 * of the CertStore pointed to by "store" and stores it at |
| 668 * "pCertStoreContext". |
| 669 * |
| 670 * PARAMETERS: |
| 671 * "store" |
| 672 * Address of CertStore whose context is to be stored. Must be non-NULL. |
| 673 * "pCertStoreContext" |
| 674 * Address where object pointer will be stored. Must be non-NULL. |
| 675 * "plContext" |
| 676 * Platform-specific context pointer. |
| 677 * THREAD SAFETY: |
| 678 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 679 * RETURNS: |
| 680 * Returns NULL if the function succeeds. |
| 681 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 682 */ |
| 683 PKIX_Error * |
| 684 PKIX_CertStore_GetCertStoreContext( |
| 685 PKIX_CertStore *store, |
| 686 PKIX_PL_Object **pCertStoreContext, |
| 687 void *plContext); |
| 688 |
| 689 /* |
| 690 * FUNCTION: PKIX_CertStore_GetCertStoreCacheFlag |
| 691 * DESCRIPTION: |
| 692 * |
| 693 * Retrieves the Boolean cache flag of the CertStore pointed to by "store" and |
| 694 * stores it at "pCachedFlag". |
| 695 * |
| 696 * PARAMETERS: |
| 697 * "store" |
| 698 * Address of CertStore whose cache flag is to be stored. Must be non-NULL. |
| 699 * "pCacheFlag" |
| 700 * Address where the result will be stored. Must be non-NULL. |
| 701 * "plContext" |
| 702 * Platform-specific context pointer. |
| 703 * THREAD SAFETY: |
| 704 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 705 * RETURNS: |
| 706 * Returns NULL if the function succeeds. |
| 707 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 708 */ |
| 709 PKIX_Error * |
| 710 PKIX_CertStore_GetCertStoreCacheFlag( |
| 711 PKIX_CertStore *store, |
| 712 PKIX_Boolean *pCacheFlag, |
| 713 void *plContext); |
| 714 |
| 715 /* |
| 716 * FUNCTION: PKIX_CertStore_GetLocalFlag |
| 717 * DESCRIPTION: |
| 718 * |
| 719 * Retrieves the Boolean localFlag for the CertStore pointed to by "store" and |
| 720 * stores it at "pLocalFlag". The localFlag is TRUE if the CertStore can |
| 721 * fulfill a request without performing network I/O. |
| 722 * |
| 723 * PARAMETERS: |
| 724 * "store" |
| 725 * The CertStore whose Local flag is desired. Must be non-NULL. |
| 726 * "pCallback" |
| 727 * Address where the Boolean LocalFlag will be stored. Must be non-NULL. |
| 728 * "plContext" |
| 729 * Platform-specific context pointer. |
| 730 * THREAD SAFETY: |
| 731 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
| 732 * RETURNS: |
| 733 * Returns NULL if the function succeeds. |
| 734 * Returns a Fatal Error if the function fails in an unrecoverable way. |
| 735 */ |
| 736 PKIX_Error * |
| 737 PKIX_CertStore_GetLocalFlag( |
| 738 PKIX_CertStore *store, |
| 739 PKIX_Boolean *pLocalFlag, |
| 740 void *plContext); |
| 741 |
| 742 #ifdef __cplusplus |
| 743 } |
| 744 #endif |
| 745 |
| 746 #endif /* _PKIX_CERTSTORE_H */ |
| OLD | NEW |