security/nss/lib/libpkix/include/pkix_crlsel.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rwxr-xr-x

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4 /*
michael@0 5 * This file defines functions associated with the PKIX_CRLSelector and the
michael@0 6 * PKIX_ComCRLSelParams types.
michael@0 7 *
michael@0 8 */
michael@0 9
michael@0 10
michael@0 11 #ifndef _PKIX_CRLSEL_H
michael@0 12 #define _PKIX_CRLSEL_H
michael@0 13
michael@0 14 #include "pkixt.h"
michael@0 15
michael@0 16 #ifdef __cplusplus
michael@0 17 extern "C" {
michael@0 18 #endif
michael@0 19
michael@0 20 /* General
michael@0 21 *
michael@0 22 * Please refer to the libpkix Programmer's Guide for detailed information
michael@0 23 * about how to use the libpkix library. Certain key warnings and notices from
michael@0 24 * that document are repeated here for emphasis.
michael@0 25 *
michael@0 26 * All identifiers in this file (and all public identifiers defined in
michael@0 27 * libpkix) begin with "PKIX_". Private identifiers only intended for use
michael@0 28 * within the library begin with "pkix_".
michael@0 29 *
michael@0 30 * A function returns NULL upon success, and a PKIX_Error pointer upon failure.
michael@0 31 *
michael@0 32 * Unless otherwise noted, for all accessor (gettor) functions that return a
michael@0 33 * PKIX_PL_Object pointer, callers should assume that this pointer refers to a
michael@0 34 * shared object. Therefore, the caller should treat this shared object as
michael@0 35 * read-only and should not modify this shared object. When done using the
michael@0 36 * shared object, the caller should release the reference to the object by
michael@0 37 * using the PKIX_PL_Object_DecRef function.
michael@0 38 *
michael@0 39 * While a function is executing, if its arguments (or anything referred to by
michael@0 40 * its arguments) are modified, free'd, or destroyed, the function's behavior
michael@0 41 * is undefined.
michael@0 42 *
michael@0 43 */
michael@0 44
michael@0 45 /* PKIX_CRLSelector
michael@0 46 *
michael@0 47 * PKIX_CRLSelectors provide a standard way for the caller to select CRLs
michael@0 48 * based on particular criteria. A CRLSelector is typically used by libpkix
michael@0 49 * to retrieve CRLs from a CertStore during certificate chain validation or
michael@0 50 * building. (see pkix_certstore.h) For example, the caller may wish to only
michael@0 51 * select those CRLs that have a particular issuer or a particular value for a
michael@0 52 * private CRL extension. The MatchCallback allows the caller to specify the
michael@0 53 * custom matching logic to be used by a CRLSelector.
michael@0 54
michael@0 55 * By default, the MatchCallback is set to point to the default implementation
michael@0 56 * provided by libpkix, which understands how to process the most common
michael@0 57 * parameters. If the default implementation is used, the caller should set
michael@0 58 * these common parameters using PKIX_CRLSelector_SetCommonCRLSelectorParams.
michael@0 59 * Any common parameter that is not set is assumed to be disabled, which means
michael@0 60 * the default MatchCallback implementation will select all CRLs without
michael@0 61 * regard to that particular disabled parameter. For example, if the
michael@0 62 * MaxCRLNumber parameter is not set, MatchCallback will not filter out any
michael@0 63 * CRL based on its CRL number. As such, if no parameters are set, all are
michael@0 64 * disabled and any CRL will match. If a parameter is disabled, its associated
michael@0 65 * PKIX_ComCRLSelParams_Get* function returns a default value of NULL.
michael@0 66 *
michael@0 67 * If a custom implementation is desired, the default implementation can be
michael@0 68 * overridden by calling PKIX_CRLSelector_SetMatchCallback. In this case, the
michael@0 69 * CRLSelector can be initialized with a crlSelectorContext, which is where
michael@0 70 * the caller can specify the desired parameters the caller wishes to match
michael@0 71 * against. Note that this crlSelectorContext must be a PKIX_PL_Object,
michael@0 72 * allowing it to be reference-counted and allowing it to provide the standard
michael@0 73 * PKIX_PL_Object functions (Equals, Hashcode, ToString, Compare, Duplicate).
michael@0 74 *
michael@0 75 */
michael@0 76
michael@0 77 /*
michael@0 78 * FUNCTION: PKIX_CRLSelector_MatchCallback
michael@0 79 * DESCRIPTION:
michael@0 80 *
michael@0 81 * This callback function determines whether the specified CRL pointed to by
michael@0 82 * "crl" matches the criteria of the CRLSelector pointed to by "selector".
michael@0 83 * If the CRL matches the CRLSelector's criteria, PKIX_TRUE is stored at
michael@0 84 * "pMatch". Otherwise PKIX_FALSE is stored at "pMatch".
michael@0 85 *
michael@0 86 * PARAMETERS:
michael@0 87 * "selector"
michael@0 88 * Address of CRLSelector whose MatchCallback logic and parameters are
michael@0 89 * to be used. Must be non-NULL.
michael@0 90 * "crl"
michael@0 91 * Address of CRL that is to be matched using "selector". Must be non-NULL.
michael@0 92 * "pMatch"
michael@0 93 * Address at which Boolean result is stored. Must be non-NULL.
michael@0 94 * "plContext"
michael@0 95 * Platform-specific context pointer.
michael@0 96 * THREAD SAFETY:
michael@0 97 * Thread Safe
michael@0 98 *
michael@0 99 * Multiple threads must be able to safely call this function without
michael@0 100 * worrying about conflicts, even if they're operating on the same objects.
michael@0 101 * RETURNS:
michael@0 102 * Returns NULL if the function succeeds.
michael@0 103 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 104 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 105 */
michael@0 106 typedef PKIX_Error *
michael@0 107 (*PKIX_CRLSelector_MatchCallback)(
michael@0 108 PKIX_CRLSelector *selector,
michael@0 109 PKIX_PL_CRL *crl,
michael@0 110 PKIX_Boolean *pMatch,
michael@0 111 void *plContext);
michael@0 112
michael@0 113 /*
michael@0 114 * FUNCTION: PKIX_CRLSelector_Create
michael@0 115 * DESCRIPTION:
michael@0 116 *
michael@0 117 * Creates a new CRLSelector using the Object pointed to by
michael@0 118 * "crlSelectorContext" (if any) and stores it at "pSelector". As noted
michael@0 119 * above, by default, the MatchCallback is set to point to the default
michael@0 120 * implementation provided by libpkix, which understands how to process
michael@0 121 * ComCRLSelParams. This is overridden if the MatchCallback pointed to by
michael@0 122 * "callback" is not NULL, in which case the parameters are specified using
michael@0 123 * the Object pointed to by "crlSelectorContext".
michael@0 124 *
michael@0 125 * PARAMETERS:
michael@0 126 * "issue"
michael@0 127 * crl issuer.
michael@0 128 * "crlDpList"
michael@0 129 * distribution points list
michael@0 130 * "callback"
michael@0 131 * The MatchCallback function to be used.
michael@0 132 * "pSelector"
michael@0 133 * Address where object pointer will be stored. Must be non-NULL.
michael@0 134 * "plContext"
michael@0 135 * Platform-specific context pointer.
michael@0 136 * THREAD SAFETY:
michael@0 137 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 138 * RETURNS:
michael@0 139 * Returns NULL if the function succeeds.
michael@0 140 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 141 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 142 */
michael@0 143 PKIX_Error *
michael@0 144 PKIX_CRLSelector_Create(
michael@0 145 PKIX_PL_Cert *issuer,
michael@0 146 PKIX_List *crlDpList,
michael@0 147 PKIX_PL_Date *date,
michael@0 148 PKIX_CRLSelector **pSelector,
michael@0 149 void *plContext);
michael@0 150
michael@0 151 /*
michael@0 152 * FUNCTION: PKIX_CRLSelector_GetMatchCallback
michael@0 153 * DESCRIPTION:
michael@0 154 *
michael@0 155 * Retrieves a pointer to "selector's" Match callback function and puts it in
michael@0 156 * "pCallback".
michael@0 157 *
michael@0 158 * PARAMETERS:
michael@0 159 * "selector"
michael@0 160 * The CRLSelector whose Match callback is desired. Must be non-NULL.
michael@0 161 * "pCallback"
michael@0 162 * Address where Match callback function pointer will be stored.
michael@0 163 * Must be non-NULL.
michael@0 164 * "plContext"
michael@0 165 * Platform-specific context pointer.
michael@0 166 * THREAD SAFETY:
michael@0 167 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 168 * RETURNS:
michael@0 169 * Returns NULL if the function succeeds.
michael@0 170 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 171 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 172 */
michael@0 173 PKIX_Error *
michael@0 174 PKIX_CRLSelector_GetMatchCallback(
michael@0 175 PKIX_CRLSelector *selector,
michael@0 176 PKIX_CRLSelector_MatchCallback *pCallback,
michael@0 177 void *plContext);
michael@0 178
michael@0 179 /*
michael@0 180 * FUNCTION: PKIX_CRLSelector_GetCRLSelectorContext
michael@0 181 * DESCRIPTION:
michael@0 182 *
michael@0 183 * Retrieves a pointer to a PKIX_PL_Object representing the context (if any)
michael@0 184 * of the CRLSelector pointed to by "selector" and stores it at
michael@0 185 * "pCRLSelectorContext".
michael@0 186 *
michael@0 187 * PARAMETERS:
michael@0 188 * "selector"
michael@0 189 * Address of CRLSelector whose context is to be stored. Must be non-NULL.
michael@0 190 * "pCRLSelectorContext"
michael@0 191 * Address where object pointer will be stored. Must be non-NULL.
michael@0 192 * "plContext"
michael@0 193 * Platform-specific context pointer.
michael@0 194 * THREAD SAFETY:
michael@0 195 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 196 * RETURNS:
michael@0 197 * Returns NULL if the function succeeds.
michael@0 198 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 199 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 200 */
michael@0 201 PKIX_Error *
michael@0 202 PKIX_CRLSelector_GetCRLSelectorContext(
michael@0 203 PKIX_CRLSelector *selector,
michael@0 204 void **pCRLSelectorContext,
michael@0 205 void *plContext);
michael@0 206
michael@0 207 /*
michael@0 208 * FUNCTION: PKIX_CRLSelector_GetCommonCRLSelectorParams
michael@0 209 * DESCRIPTION:
michael@0 210 *
michael@0 211 * Retrieves a pointer to the ComCRLSelParams object that represent the common
michael@0 212 * parameters of the CRLSelector pointed to by "selector" and stores it at
michael@0 213 * "pCommonCRLSelectorParams". If there are no common parameters stored with
michael@0 214 * the CRLSelector, this function stores NULL at "pCommonCRLSelectorParams".
michael@0 215 *
michael@0 216 * PARAMETERS:
michael@0 217 * "selector"
michael@0 218 * Address of CRLSelector whose ComCRLSelParams are to be stored.
michael@0 219 * Must be non-NULL.
michael@0 220 * "pCommonCRLSelectorParams"
michael@0 221 * Address where object pointer will be stored. Must be non-NULL.
michael@0 222 * "plContext"
michael@0 223 * Platform-specific context pointer.
michael@0 224 * THREAD SAFETY:
michael@0 225 * Conditionally Thread Safe
michael@0 226 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 227 * RETURNS:
michael@0 228 * Returns NULL if the function succeeds.
michael@0 229 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 230 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 231 */
michael@0 232 PKIX_Error *
michael@0 233 PKIX_CRLSelector_GetCommonCRLSelectorParams(
michael@0 234 PKIX_CRLSelector *selector,
michael@0 235 PKIX_ComCRLSelParams **pCommonCRLSelectorParams,
michael@0 236 void *plContext);
michael@0 237
michael@0 238 /*
michael@0 239 * FUNCTION: PKIX_CRLSelector_SetCommonCRLSelectorParams
michael@0 240 * DESCRIPTION:
michael@0 241 *
michael@0 242 * Sets the common parameters for the CRLSelector pointed to by "selector"
michael@0 243 * using the ComCRLSelParams pointed to by "commonCRLSelectorParams".
michael@0 244 *
michael@0 245 * PARAMETERS:
michael@0 246 * "selector"
michael@0 247 * Address of CRLSelector whose common parameters are to be set.
michael@0 248 * Must be non-NULL.
michael@0 249 * "commonCRLSelectorParams"
michael@0 250 * Address of ComCRLSelParams representing the common parameters.
michael@0 251 * "plContext"
michael@0 252 * Platform-specific context pointer.
michael@0 253 * THREAD SAFETY:
michael@0 254 * Not Thread Safe - assumes exclusive access to "selector"
michael@0 255 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 256 * RETURNS:
michael@0 257 * Returns NULL if the function succeeds.
michael@0 258 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 259 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 260 */
michael@0 261 PKIX_Error *
michael@0 262 PKIX_CRLSelector_SetCommonCRLSelectorParams(
michael@0 263 PKIX_CRLSelector *selector,
michael@0 264 PKIX_ComCRLSelParams *commonCRLSelectorParams,
michael@0 265 void *plContext);
michael@0 266
michael@0 267 /* PKIX_ComCRLSelParams
michael@0 268 *
michael@0 269 * PKIX_ComCRLSelParams are X.509 parameters commonly used with CRLSelectors,
michael@0 270 * especially determining which CRLs to retrieve from a CertStore.
michael@0 271 * PKIX_ComCRLSelParams are typically used with those CRLSelectors that use
michael@0 272 * the default implementation of MatchCallback, which understands how to
michael@0 273 * process ComCRLSelParams.
michael@0 274 */
michael@0 275
michael@0 276 /*
michael@0 277 * FUNCTION: PKIX_ComCRLSelParams_Create
michael@0 278 * DESCRIPTION:
michael@0 279 *
michael@0 280 * Creates a new ComCRLSelParams object and stores it at "pParams".
michael@0 281 *
michael@0 282 * PARAMETERS:
michael@0 283 * "pParams"
michael@0 284 * Address where object pointer will be stored. Must be non-NULL.
michael@0 285 * "plContext"
michael@0 286 * Platform-specific context pointer.
michael@0 287 * THREAD SAFETY:
michael@0 288 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 289 * RETURNS:
michael@0 290 * Returns NULL if the function succeeds.
michael@0 291 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 292 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 293 */
michael@0 294 PKIX_Error *
michael@0 295 PKIX_ComCRLSelParams_Create(
michael@0 296 PKIX_ComCRLSelParams **pParams,
michael@0 297 void *plContext);
michael@0 298
michael@0 299 /*
michael@0 300 * FUNCTION: PKIX_ComCRLSelParams_GetIssuerNames
michael@0 301 * DESCRIPTION:
michael@0 302 *
michael@0 303 * Retrieves a pointer to the List of X500Names (if any) representing the
michael@0 304 * issuer names criterion that is set in the ComCRLSelParams pointed to by
michael@0 305 * "params" and stores it at "pNames". In order to match against this
michael@0 306 * criterion, a CRL's IssuerName must match at least one of the criterion's
michael@0 307 * issuer names.
michael@0 308 *
michael@0 309 * If "params" does not have this criterion set, this function stores NULL at
michael@0 310 * "pNames", in which case all CRLs are considered to match.
michael@0 311 *
michael@0 312 * Note that the List returned by this function is immutable.
michael@0 313 *
michael@0 314 * PARAMETERS:
michael@0 315 * "params"
michael@0 316 * Address of ComCRLSelParams whose issuer names criterion (if any) is to
michael@0 317 * be stored. Must be non-NULL.
michael@0 318 * "pNames"
michael@0 319 * Address where object pointer will be stored. Must be non-NULL.
michael@0 320 * "plContext"
michael@0 321 * Platform-specific context pointer.
michael@0 322 * THREAD SAFETY:
michael@0 323 * Conditionally Thread Safe
michael@0 324 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 325 * RETURNS:
michael@0 326 * Returns NULL if the function succeeds.
michael@0 327 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 328 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 329 */
michael@0 330 PKIX_Error *
michael@0 331 PKIX_ComCRLSelParams_GetIssuerNames(
michael@0 332 PKIX_ComCRLSelParams *params,
michael@0 333 PKIX_List **pNames, /* list of PKIX_PL_X500Name */
michael@0 334 void *plContext);
michael@0 335
michael@0 336 /*
michael@0 337 * FUNCTION: PKIX_ComCRLSelParams_SetIssuerNames
michael@0 338 * DESCRIPTION:
michael@0 339 *
michael@0 340 * Sets the issuer names criterion of the ComCRLSelParams pointed to by
michael@0 341 * "params" using a List of X500Names pointed to by "names". In order to match
michael@0 342 * against this criterion, a CRL's IssuerName must match at least one of the
michael@0 343 * criterion's issuer names.
michael@0 344 *
michael@0 345 * PARAMETERS:
michael@0 346 * "params"
michael@0 347 * Address of ComCRLSelParamsParams whose issuer names criterion is to be
michael@0 348 * set. Must be non-NULL.
michael@0 349 * "names"
michael@0 350 * Address of List of X500Names used to set the criterion
michael@0 351 * "plContext"
michael@0 352 * Platform-specific context pointer.
michael@0 353 * THREAD SAFETY:
michael@0 354 * Not Thread Safe - assumes exclusive access to "params"
michael@0 355 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 356 * RETURNS:
michael@0 357 * Returns NULL if the function succeeds.
michael@0 358 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 359 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 360 */
michael@0 361 PKIX_Error *
michael@0 362 PKIX_ComCRLSelParams_SetIssuerNames(
michael@0 363 PKIX_ComCRLSelParams *params,
michael@0 364 PKIX_List *names, /* list of PKIX_PL_X500Name */
michael@0 365 void *plContext);
michael@0 366
michael@0 367 /*
michael@0 368 * FUNCTION: PKIX_ComCRLSelParams_AddIssuerName
michael@0 369 * DESCRIPTION:
michael@0 370 *
michael@0 371 * Adds to the issuer names criterion of the ComCRLSelParams pointed to by
michael@0 372 * "params" using the X500Name pointed to by "name". In order to match
michael@0 373 * against this criterion, a CRL's IssuerName must match at least one of the
michael@0 374 * criterion's issuer names.
michael@0 375 *
michael@0 376 * PARAMETERS:
michael@0 377 * "params"
michael@0 378 * Address of ComCRLSelParams whose issuer names criterion is to be added
michael@0 379 * to. Must be non-NULL.
michael@0 380 * "name"
michael@0 381 * Address of X500Name to be added.
michael@0 382 * "plContext"
michael@0 383 * Platform-specific context pointer.
michael@0 384 * THREAD SAFETY:
michael@0 385 * Not Thread Safe - assumes exclusive access to "params"
michael@0 386 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 387 * RETURNS:
michael@0 388 * Returns NULL if the function succeeds.
michael@0 389 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 390 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 391 */
michael@0 392 PKIX_Error *
michael@0 393 PKIX_ComCRLSelParams_AddIssuerName(
michael@0 394 PKIX_ComCRLSelParams *params,
michael@0 395 PKIX_PL_X500Name *name,
michael@0 396 void *plContext);
michael@0 397
michael@0 398 /*
michael@0 399 * FUNCTION: PKIX_ComCRLSelParams_GetCertificateChecking
michael@0 400 * DESCRIPTION:
michael@0 401 *
michael@0 402 * Retrieves a pointer to the Cert (if any) representing the certificate whose
michael@0 403 * revocation status is being checked. This is not a criterion. It is simply
michael@0 404 * optional information that may help a CertStore find relevant CRLs.
michael@0 405 *
michael@0 406 * If "params" does not have a certificate set, this function stores NULL at
michael@0 407 * "pCert", in which case there is no optional information to provide.
michael@0 408 *
michael@0 409 * PARAMETERS:
michael@0 410 * "params"
michael@0 411 * Address of ComCRLSelParams whose certificate being checked (if any) is
michael@0 412 * to be stored. Must be non-NULL.
michael@0 413 * "pCert"
michael@0 414 * Address where object pointer will be stored. Must be non-NULL.
michael@0 415 * "plContext"
michael@0 416 * Platform-specific context pointer.
michael@0 417 * THREAD SAFETY:
michael@0 418 * Conditionally Thread Safe
michael@0 419 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 420 * RETURNS:
michael@0 421 * Returns NULL if the function succeeds
michael@0 422 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 423 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 424 */
michael@0 425 PKIX_Error *
michael@0 426 PKIX_ComCRLSelParams_GetCertificateChecking(
michael@0 427 PKIX_ComCRLSelParams *params,
michael@0 428 PKIX_PL_Cert **pCert,
michael@0 429 void *plContext);
michael@0 430
michael@0 431 /*
michael@0 432 * FUNCTION: PKIX_ComCRLSelParams_SetCertificateChecking
michael@0 433 * DESCRIPTION:
michael@0 434 *
michael@0 435 * Sets the ComCRLSelParams pointed to by "params" with the certificate
michael@0 436 * (pointed to by "cert") whose revocation status is being checked. This is
michael@0 437 * not a criterion. It is simply optional information that may help a
michael@0 438 * CertStore find relevant CRLs.
michael@0 439 *
michael@0 440 * PARAMETERS:
michael@0 441 * "params"
michael@0 442 * Address of ComCRLSelParams whose certificate being checked is to be
michael@0 443 * set. Must be non-NULL.
michael@0 444 * "cert"
michael@0 445 * Address of Cert whose revocation status is being checked
michael@0 446 * "plContext"
michael@0 447 * Platform-specific context pointer.
michael@0 448 * THREAD SAFETY:
michael@0 449 * Not Thread Safe - assumes exclusive access to "params"
michael@0 450 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 451 * RETURNS:
michael@0 452 * Returns NULL if the function succeeds.
michael@0 453 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 454 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 455 */
michael@0 456 PKIX_Error *
michael@0 457 PKIX_ComCRLSelParams_SetCertificateChecking(
michael@0 458 PKIX_ComCRLSelParams *params,
michael@0 459 PKIX_PL_Cert *cert,
michael@0 460 void *plContext);
michael@0 461
michael@0 462 /*
michael@0 463 * FUNCTION: PKIX_ComCRLSelParams_GetDateAndTime
michael@0 464 * DESCRIPTION:
michael@0 465 *
michael@0 466 * Retrieves a pointer to the Date (if any) representing the dateAndTime
michael@0 467 * criterion that is set in the ComCRLSelParams pointed to by "params" and
michael@0 468 * stores it at "pDate". In order to match against this criterion, a CRL's
michael@0 469 * thisUpdate component must be less than or equal to the criterion's
michael@0 470 * dateAndTime and the CRL's nextUpdate component must be later than the
michael@0 471 * criterion's dateAndTime. There is no match if the CRL does not contain a
michael@0 472 * nextUpdate component.
michael@0 473 *
michael@0 474 * If "params" does not have this criterion set, this function stores NULL at
michael@0 475 * "pDate", in which case all CRLs are considered to match.
michael@0 476 *
michael@0 477 * PARAMETERS:
michael@0 478 * "params"
michael@0 479 * Address of ComCRLSelParams whose dateAndTime criterion (if any) is to
michael@0 480 * be stored. Must be non-NULL.
michael@0 481 * "pDate"
michael@0 482 * Address where object pointer will be stored. Must be non-NULL.
michael@0 483 * "plContext"
michael@0 484 * Platform-specific context pointer.
michael@0 485 * THREAD SAFETY:
michael@0 486 * Conditionally Thread Safe
michael@0 487 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 488 * RETURNS:
michael@0 489 * Returns NULL if the function succeeds.
michael@0 490 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 491 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 492 */
michael@0 493 PKIX_Error *
michael@0 494 PKIX_ComCRLSelParams_GetDateAndTime(
michael@0 495 PKIX_ComCRLSelParams *params,
michael@0 496 PKIX_PL_Date **pDate,
michael@0 497 void *plContext);
michael@0 498
michael@0 499 /*
michael@0 500 * FUNCTION: PKIX_ComCRLSelParams_SetDateAndTime
michael@0 501 * DESCRIPTION:
michael@0 502 *
michael@0 503 * Sets the dateAndTime criterion of the ComCRLSelParams pointed to by
michael@0 504 * "params" using a Date pointed to by "date". In order to match against this
michael@0 505 * criterion, a CRL's thisUpdate component must be less than or equal to the
michael@0 506 * criterion's dateAndTime and the CRL's nextUpdate component must be later
michael@0 507 * than the criterion's dateAndTime. There is no match if the CRL does not
michael@0 508 * contain a nextUpdate component.
michael@0 509 *
michael@0 510 * PARAMETERS:
michael@0 511 * "params"
michael@0 512 * Address of ComCRLSelParamsParams whose dateAndTime criterion is to be
michael@0 513 * set. Must be non-NULL.
michael@0 514 * "date"
michael@0 515 * Address of Date used to set the criterion
michael@0 516 * "plContext"
michael@0 517 * Platform-specific context pointer.
michael@0 518 * THREAD SAFETY:
michael@0 519 * Not Thread Safe - assumes exclusive access to "params"
michael@0 520 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 521 * RETURNS:
michael@0 522 * Returns NULL if the function succeeds.
michael@0 523 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 524 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 525 */
michael@0 526 PKIX_Error *
michael@0 527 PKIX_ComCRLSelParams_SetDateAndTime(
michael@0 528 PKIX_ComCRLSelParams *params,
michael@0 529 PKIX_PL_Date *date,
michael@0 530 void *plContext);
michael@0 531
michael@0 532 /*
michael@0 533 * FUNCTION: PKIX_ComCRLSelParams_GetNISTPolicyEnabled
michael@0 534 * DESCRIPTION:
michael@0 535 *
michael@0 536 * Retrieves a pointer to the Boolean representing the NIST CRL policy
michael@0 537 * activation flag that is set in the ComCRLSelParams pointed to by "params"
michael@0 538 * and stores it at "enabled". If enabled, a CRL must have nextUpdate field.
michael@0 539 *
michael@0 540 * Default value for this flag is TRUE.
michael@0 541 *
michael@0 542 * PARAMETERS:
michael@0 543 * "params"
michael@0 544 * Address of ComCRLSelParams whose NIST CRL policy criterion is to
michael@0 545 * be stored. Must be non-NULL.
michael@0 546 * "pEnabled"
michael@0 547 * Address where object pointer will be stored. Must be non-NULL.
michael@0 548 * "plContext"
michael@0 549 * Platform-specific context pointer.
michael@0 550 * THREAD SAFETY:
michael@0 551 * Conditionally Thread Safe
michael@0 552 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 553 * RETURNS:
michael@0 554 * Returns NULL if the function succeeds.
michael@0 555 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 556 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 557 */
michael@0 558 PKIX_Error *
michael@0 559 PKIX_ComCRLSelParams_GetNISTPolicyEnabled(
michael@0 560 PKIX_ComCRLSelParams *params,
michael@0 561 PKIX_Boolean *pEnabled,
michael@0 562 void *plContext);
michael@0 563
michael@0 564 /*
michael@0 565 * FUNCTION: PKIX_ComCRLSelParams_SetNISTPolicyEnabled
michael@0 566 * DESCRIPTION:
michael@0 567 *
michael@0 568 * Sets the NIST crl policy criterion of the ComCRLSelParams pointed to by
michael@0 569 * "params" using a "enabled" flag. In order to match against this
michael@0 570 * criterion, a CRL's nextUpdate must be available and criterion's
michael@0 571 * dataAndTime must be within thisUpdate and nextUpdate time period.
michael@0 572 *
michael@0 573 * PARAMETERS:
michael@0 574 * "params"
michael@0 575 * Address of ComCRLSelParamsParams whose NIST CRL policy criterion
michael@0 576 * is to be set. Must be non-NULL.
michael@0 577 * "enabled"
michael@0 578 * Address of Bollean used to set the criterion
michael@0 579 * "plContext"
michael@0 580 * Platform-specific context pointer.
michael@0 581 * THREAD SAFETY:
michael@0 582 * Not Thread Safe - assumes exclusive access to "params"
michael@0 583 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 584 * RETURNS:
michael@0 585 * Returns NULL if the function succeeds.
michael@0 586 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 587 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 588 */
michael@0 589 PKIX_Error *
michael@0 590 PKIX_ComCRLSelParams_SetNISTPolicyEnabled(
michael@0 591 PKIX_ComCRLSelParams *params,
michael@0 592 PKIX_Boolean enabled,
michael@0 593 void *plContext);
michael@0 594
michael@0 595 /*
michael@0 596 * FUNCTION: PKIX_ComCRLSelParams_GetMaxCRLNumber
michael@0 597 * DESCRIPTION:
michael@0 598 *
michael@0 599 * Retrieves a pointer to the BigInt (if any) representing the maxCRLNumber
michael@0 600 * criterion that is set in the ComCRLSelParams pointed to by "params" and
michael@0 601 * stores it at "pNumber". In order to match against this criterion, a CRL
michael@0 602 * must have a CRL number extension whose value is less than or equal to the
michael@0 603 * criterion's value.
michael@0 604 *
michael@0 605 * If "params" does not have this criterion set, this function stores NULL at
michael@0 606 * "pNumber", in which case all CRLs are considered to match.
michael@0 607 *
michael@0 608 * PARAMETERS:
michael@0 609 * "params"
michael@0 610 * Address of ComCRLSelParams whose maxCRLNumber criterion (if any) is to
michael@0 611 * be stored. Must be non-NULL.
michael@0 612 * "pNumber"
michael@0 613 * Address where object pointer will be stored. Must be non-NULL.
michael@0 614 * "plContext"
michael@0 615 * Platform-specific context pointer.
michael@0 616 * THREAD SAFETY:
michael@0 617 * Conditionally Thread Safe
michael@0 618 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 619 * RETURNS:
michael@0 620 * Returns NULL if the function succeeds.
michael@0 621 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 622 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 623 */
michael@0 624 PKIX_Error *
michael@0 625 PKIX_ComCRLSelParams_GetMaxCRLNumber(
michael@0 626 PKIX_ComCRLSelParams *params,
michael@0 627 PKIX_PL_BigInt **pNumber,
michael@0 628 void *plContext);
michael@0 629
michael@0 630 /*
michael@0 631 * FUNCTION: PKIX_ComCRLSelParams_SetMaxCRLNumber
michael@0 632 * DESCRIPTION:
michael@0 633 *
michael@0 634 * Sets the maxCRLNumber criterion of the ComCRLSelParams pointed to by
michael@0 635 * "params" using a BigInt pointed to by "number". In order to match against
michael@0 636 * this criterion, a CRL must have a CRL number extension whose value is less
michael@0 637 * than or equal to the criterion's value.
michael@0 638 *
michael@0 639 * PARAMETERS:
michael@0 640 * "params"
michael@0 641 * Address of ComCRLSelParamsParams whose maxCRLNumber criterion is to be
michael@0 642 * set. Must be non-NULL.
michael@0 643 * "number"
michael@0 644 * Address of BigInt used to set the criterion
michael@0 645 * "plContext"
michael@0 646 * Platform-specific context pointer.
michael@0 647 * THREAD SAFETY:
michael@0 648 * Not Thread Safe - assumes exclusive access to "params"
michael@0 649 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 650 * RETURNS:
michael@0 651 * Returns NULL if the function succeeds.
michael@0 652 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 653 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 654 */
michael@0 655 PKIX_Error *
michael@0 656 PKIX_ComCRLSelParams_SetMaxCRLNumber(
michael@0 657 PKIX_ComCRLSelParams *params,
michael@0 658 PKIX_PL_BigInt *number,
michael@0 659 void *plContext);
michael@0 660
michael@0 661 /*
michael@0 662 * FUNCTION: PKIX_ComCRLSelParams_GetMinCRLNumber
michael@0 663 * DESCRIPTION:
michael@0 664 *
michael@0 665 * Retrieves a pointer to the BigInt (if any) representing the minCRLNumber
michael@0 666 * criterion that is set in the ComCRLSelParams pointed to by "params" and
michael@0 667 * stores it at "pNumber". In order to match against this criterion, a CRL
michael@0 668 * must have a CRL number extension whose value is greater than or equal to
michael@0 669 * the criterion's value.
michael@0 670 *
michael@0 671 * If "params" does not have this criterion set, this function stores NULL at
michael@0 672 * "pNumber", in which case all CRLs are considered to match.
michael@0 673 *
michael@0 674 * PARAMETERS:
michael@0 675 * "params"
michael@0 676 * Address of ComCRLSelParams whose minCRLNumber criterion (if any) is to
michael@0 677 * be stored. Must be non-NULL.
michael@0 678 * "pNumber"
michael@0 679 * Address where object pointer will be stored. Must be non-NULL.
michael@0 680 * "plContext"
michael@0 681 * Platform-specific context pointer.
michael@0 682 * THREAD SAFETY:
michael@0 683 * Conditionally Thread Safe
michael@0 684 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 685 * RETURNS:
michael@0 686 * Returns NULL if the function succeeds.
michael@0 687 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 688 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 689 */
michael@0 690 PKIX_Error *
michael@0 691 PKIX_ComCRLSelParams_GetMinCRLNumber(
michael@0 692 PKIX_ComCRLSelParams *params,
michael@0 693 PKIX_PL_BigInt **pNumber,
michael@0 694 void *plContext);
michael@0 695
michael@0 696 /*
michael@0 697 * FUNCTION: PKIX_ComCRLSelParams_SetMinCRLNumber
michael@0 698 * DESCRIPTION:
michael@0 699 *
michael@0 700 * Sets the minCRLNumber criterion of the ComCRLSelParams pointed to by
michael@0 701 * "params" using a BigInt pointed to by "number". In order to match against
michael@0 702 * this criterion, a CRL must have a CRL number extension whose value is
michael@0 703 * greater than or equal to the criterion's value.
michael@0 704 *
michael@0 705 * PARAMETERS:
michael@0 706 * "params"
michael@0 707 * Address of ComCRLSelParamsParams whose minCRLNumber criterion is to be
michael@0 708 * set. Must be non-NULL.
michael@0 709 * "number"
michael@0 710 * Address of BigInt used to set the criterion
michael@0 711 * "plContext"
michael@0 712 * Platform-specific context pointer.
michael@0 713 * THREAD SAFETY:
michael@0 714 * Not Thread Safe - assumes exclusive access to "params"
michael@0 715 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 716 * RETURNS:
michael@0 717 * Returns NULL if the function succeeds.
michael@0 718 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 719 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 720 */
michael@0 721 PKIX_Error *
michael@0 722 PKIX_ComCRLSelParams_SetMinCRLNumber(
michael@0 723 PKIX_ComCRLSelParams *params,
michael@0 724 PKIX_PL_BigInt *number,
michael@0 725 void *plContext);
michael@0 726
michael@0 727 /*
michael@0 728 * FUNCTION: PKIX_ComCRLSelParams_SetCrlDp
michael@0 729 * DESCRIPTION:
michael@0 730 *
michael@0 731 * Sets crldp list that can be used to download a crls.
michael@0 732 *
michael@0 733 * PARAMETERS:
michael@0 734 * "params"
michael@0 735 * Address of ComCRLSelParamsParams whose minCRLNumber criterion is to be
michael@0 736 * set. Must be non-NULL.
michael@0 737 * "crldpList"
michael@0 738 * A list of CRLDPs. Can be an emptry list.
michael@0 739 * "plContext"
michael@0 740 * Platform-specific context pointer.
michael@0 741 * THREAD SAFETY:
michael@0 742 * Not Thread Safe - assumes exclusive access to "params"
michael@0 743 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 744 * RETURNS:
michael@0 745 * Returns NULL if the function succeeds.
michael@0 746 * Returns a CRLSelector Error if the function fails in a non-fatal way.
michael@0 747 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 748 */
michael@0 749 PKIX_Error*
michael@0 750 PKIX_ComCRLSelParams_SetCrlDp(
michael@0 751 PKIX_ComCRLSelParams *params,
michael@0 752 PKIX_List *crldpList,
michael@0 753 void *plContext);
michael@0 754
michael@0 755 #ifdef __cplusplus
michael@0 756 }
michael@0 757 #endif
michael@0 758
michael@0 759 #endif /* _PKIX_CRLSEL_H */

mercurial