security/nss/lib/libpkix/include/pkix_params.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 various parameters used
michael@0 6 * by the top-level functions.
michael@0 7 *
michael@0 8 */
michael@0 9
michael@0 10 #ifndef _PKIX_PARAMS_H
michael@0 11 #define _PKIX_PARAMS_H
michael@0 12
michael@0 13 #include "pkixt.h"
michael@0 14
michael@0 15 #ifdef __cplusplus
michael@0 16 extern "C" {
michael@0 17 #endif
michael@0 18
michael@0 19 /* General
michael@0 20 *
michael@0 21 * Please refer to the libpkix Programmer's Guide for detailed information
michael@0 22 * about how to use the libpkix library. Certain key warnings and notices from
michael@0 23 * that document are repeated here for emphasis.
michael@0 24 *
michael@0 25 * All identifiers in this file (and all public identifiers defined in
michael@0 26 * libpkix) begin with "PKIX_". Private identifiers only intended for use
michael@0 27 * within the library begin with "pkix_".
michael@0 28 *
michael@0 29 * A function returns NULL upon success, and a PKIX_Error pointer upon failure.
michael@0 30 *
michael@0 31 * Unless otherwise noted, for all accessor (gettor) functions that return a
michael@0 32 * PKIX_PL_Object pointer, callers should assume that this pointer refers to a
michael@0 33 * shared object. Therefore, the caller should treat this shared object as
michael@0 34 * read-only and should not modify this shared object. When done using the
michael@0 35 * shared object, the caller should release the reference to the object by
michael@0 36 * using the PKIX_PL_Object_DecRef function.
michael@0 37 *
michael@0 38 * While a function is executing, if its arguments (or anything referred to by
michael@0 39 * its arguments) are modified, free'd, or destroyed, the function's behavior
michael@0 40 * is undefined.
michael@0 41 *
michael@0 42 */
michael@0 43
michael@0 44 /* PKIX_ProcessingParams
michael@0 45 *
michael@0 46 * PKIX_ProcessingParams are parameters used when validating or building a
michael@0 47 * chain of certificates. Using the parameters, the caller can specify several
michael@0 48 * things, including the various inputs to the PKIX chain validation
michael@0 49 * algorithm (such as trust anchors, initial policies, etc), any customized
michael@0 50 * functionality (such as CertChainCheckers, RevocationCheckers, CertStores),
michael@0 51 * and whether revocation checking should be disabled.
michael@0 52 *
michael@0 53 * Once the caller has created the ProcessingParams object, the caller then
michael@0 54 * passes it to PKIX_ValidateChain or PKIX_BuildChain, which uses it to call
michael@0 55 * the user's callback functions as needed during the validation or building
michael@0 56 * process.
michael@0 57 *
michael@0 58 * If a parameter is not set (or is set to NULL), it will be set to the
michael@0 59 * default value for that parameter. The default value for the Date parameter
michael@0 60 * is NULL, which indicates the current time when the path is validated. The
michael@0 61 * default for the remaining parameters is the least constrained.
michael@0 62 */
michael@0 63
michael@0 64 /*
michael@0 65 * FUNCTION: PKIX_ProcessingParams_Create
michael@0 66 * DESCRIPTION:
michael@0 67 *
michael@0 68 * Creates a new ProcessingParams object. Trust anchor list is set to
michael@0 69 * newly created empty list of trust. In this case trust anchors will
michael@0 70 * be taken from provided cert store. Pointed to the created
michael@0 71 * ProcessingParams object is stored in "pParams".
michael@0 72 *
michael@0 73 * PARAMETERS:
michael@0 74 * "anchors"
michael@0 75 * Address of List of (non-empty) TrustAnchors to be used.
michael@0 76 * Must be non-NULL.
michael@0 77 * "pParams"
michael@0 78 * Address where object pointer will be stored. Must be non-NULL.
michael@0 79 * "plContext"
michael@0 80 * Platform-specific context pointer.
michael@0 81 * THREAD SAFETY:
michael@0 82 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 83 * RETURNS:
michael@0 84 * Returns NULL if the function succeeds.
michael@0 85 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 86 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 87 */
michael@0 88 PKIX_Error *
michael@0 89 PKIX_ProcessingParams_Create(
michael@0 90 PKIX_ProcessingParams **pParams,
michael@0 91 void *plContext);
michael@0 92
michael@0 93 /*
michael@0 94 * FUNCTION: PKIX_ProcessingParams_GetCertChainCheckers
michael@0 95 * DESCRIPTION:
michael@0 96 *
michael@0 97 * Retrieves a pointer to the List of CertChainCheckers (if any) that are set
michael@0 98 * in the ProcessingParams pointed to by "params" and stores it at
michael@0 99 * "pCheckers". Each CertChainChecker represents a custom certificate
michael@0 100 * validation check used by PKIX_ValidateChain or PKIX_BuildChain as needed
michael@0 101 * during the validation or building process. If "params" does not have any
michael@0 102 * CertChainCheckers, this function stores an empty List at "pCheckers".
michael@0 103 *
michael@0 104 * PARAMETERS:
michael@0 105 * "params"
michael@0 106 * Address of ProcessingParams whose List of CertChainCheckers (if any)
michael@0 107 * are to be stored. Must be non-NULL.
michael@0 108 * "pCheckers"
michael@0 109 * Address where object pointer will be stored. Must be non-NULL.
michael@0 110 * "plContext"
michael@0 111 * Platform-specific context pointer.
michael@0 112 * THREAD SAFETY:
michael@0 113 * Conditionally Thread Safe
michael@0 114 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 115 * RETURNS:
michael@0 116 * Returns NULL if the function succeeds.
michael@0 117 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 118 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 119 */
michael@0 120 PKIX_Error *
michael@0 121 PKIX_ProcessingParams_GetCertChainCheckers(
michael@0 122 PKIX_ProcessingParams *params,
michael@0 123 PKIX_List **pCheckers, /* list of PKIX_CertChainChecker */
michael@0 124 void *plContext);
michael@0 125
michael@0 126 /*
michael@0 127 * FUNCTION: PKIX_ProcessingParams_SetCertChainCheckers
michael@0 128 * DESCRIPTION:
michael@0 129 *
michael@0 130 * Sets the ProcessingParams pointed to by "params" with a List of
michael@0 131 * CertChainCheckers pointed to by "checkers". Each CertChainChecker
michael@0 132 * represents a custom certificate validation check used by
michael@0 133 * PKIX_ValidateChain or PKIX_BuildChain as needed during the validation or
michael@0 134 * building process. If "checkers" is NULL, no CertChainCheckers will be used.
michael@0 135 *
michael@0 136 * PARAMETERS:
michael@0 137 * "params"
michael@0 138 * Address of ProcessingParams whose List of CertChainCheckers is to be
michael@0 139 * set. Must be non-NULL.
michael@0 140 * "checkers"
michael@0 141 * Address of List of CertChainCheckers to be set. If NULL, no
michael@0 142 * CertChainCheckers will be used.
michael@0 143 * "plContext"
michael@0 144 * Platform-specific context pointer.
michael@0 145 * THREAD SAFETY:
michael@0 146 * Not Thread Safe - assumes exclusive access to "params" and "checkers"
michael@0 147 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 148 * RETURNS:
michael@0 149 * Returns NULL if the function succeeds.
michael@0 150 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 151 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 152 */
michael@0 153 PKIX_Error *
michael@0 154 PKIX_ProcessingParams_SetCertChainCheckers(
michael@0 155 PKIX_ProcessingParams *params,
michael@0 156 PKIX_List *checkers, /* list of PKIX_CertChainChecker */
michael@0 157 void *plContext);
michael@0 158
michael@0 159 /*
michael@0 160 * FUNCTION: PKIX_ProcessingParams_AddCertChainChecker
michael@0 161 * DESCRIPTION:
michael@0 162 *
michael@0 163 * Adds the CertChainChecker pointed to by "checker" to the ProcessingParams
michael@0 164 * pointed to by "params". The CertChainChecker represents a custom
michael@0 165 * certificate validation check used by PKIX_ValidateChain or PKIX_BuildChain
michael@0 166 * as needed during the validation or building process.
michael@0 167 *
michael@0 168 * PARAMETERS:
michael@0 169 * "params"
michael@0 170 * Address of ProcessingParams to be added to. Must be non-NULL.
michael@0 171 * "checker"
michael@0 172 * Address of CertChainChecker to be added. Must be non-NULL.
michael@0 173 * "plContext"
michael@0 174 * Platform-specific context pointer.
michael@0 175 * THREAD SAFETY:
michael@0 176 * Not Thread Safe - assumes exclusive access to "params"
michael@0 177 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 178 * RETURNS:
michael@0 179 * Returns NULL if the function succeeds.
michael@0 180 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 181 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 182 */
michael@0 183 PKIX_Error *
michael@0 184 PKIX_ProcessingParams_AddCertChainChecker(
michael@0 185 PKIX_ProcessingParams *params,
michael@0 186 PKIX_CertChainChecker *checker,
michael@0 187 void *plContext);
michael@0 188
michael@0 189 /*
michael@0 190 * FUNCTION: PKIX_ProcessingParams_GetRevocationChecker
michael@0 191 * DESCRIPTION:
michael@0 192 *
michael@0 193 * Retrieves a pointer to the RevocationChecker that are set
michael@0 194 * in the ProcessingParams pointed to by "params" and stores it at
michael@0 195 * "pRevChecker". Each RevocationChecker represents a revocation
michael@0 196 * check used by PKIX_ValidateChain or PKIX_BuildChain as needed during the
michael@0 197 * validation or building process. If "params" does not have any
michael@0 198 * RevocationCheckers, this function stores an empty List at "pRevChecker".
michael@0 199 *
michael@0 200 * PARAMETERS:
michael@0 201 * "params"
michael@0 202 * Address of ProcessingParams whose List of RevocationCheckers
michael@0 203 * is to be stored. Must be non-NULL.
michael@0 204 * "pRevChecker"
michael@0 205 * Address where object pointer will be stored. Must be non-NULL.
michael@0 206 * "plContext"
michael@0 207 * Platform-specific context pointer.
michael@0 208 * THREAD SAFETY:
michael@0 209 * Conditionally Thread Safe
michael@0 210 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 211 * RETURNS:
michael@0 212 * Returns NULL if the function succeeds.
michael@0 213 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 214 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 215 */
michael@0 216 PKIX_Error *
michael@0 217 PKIX_ProcessingParams_GetRevocationChecker(
michael@0 218 PKIX_ProcessingParams *params,
michael@0 219 PKIX_RevocationChecker **pChecker,
michael@0 220 void *plContext);
michael@0 221
michael@0 222 /*
michael@0 223 * FUNCTION: PKIX_ProcessingParams_SetRevocationChecker
michael@0 224 * DESCRIPTION:
michael@0 225 *
michael@0 226 * Sets the ProcessingParams pointed to by "params" with a
michael@0 227 * RevocationChecker pointed to by "revChecker". Revocation
michael@0 228 * checker object should be created and assigned to processing
michael@0 229 * parameters before chain build or validation can begin.
michael@0 230 *
michael@0 231 * PARAMETERS:
michael@0 232 * "params"
michael@0 233 * Address of ProcessingParams whose List of RevocationCheckers is to be
michael@0 234 * set. Must be non-NULL.
michael@0 235 * "revChecker"
michael@0 236 * Address of RevocationChecker to be set. Must be set before chain
michael@0 237 * building or validation.
michael@0 238 * "plContext"
michael@0 239 * Platform-specific context pointer.
michael@0 240 * THREAD SAFETY:
michael@0 241 * Not Thread Safe - assumes exclusive access to "params"
michael@0 242 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 243 * RETURNS:
michael@0 244 * Returns NULL if the function succeeds.
michael@0 245 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 246 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 247 */
michael@0 248 PKIX_Error *
michael@0 249 PKIX_ProcessingParams_SetRevocationChecker(
michael@0 250 PKIX_ProcessingParams *params,
michael@0 251 PKIX_RevocationChecker *revChecker,
michael@0 252 void *plContext);
michael@0 253
michael@0 254 /*
michael@0 255 * FUNCTION: PKIX_ProcessingParams_GetCertStores
michael@0 256 * DESCRIPTION:
michael@0 257 *
michael@0 258 * Retrieves a pointer to the List of CertStores (if any) that are set in the
michael@0 259 * ProcessingParams pointed to by "params" and stores it at "pStores". Each
michael@0 260 * CertStore represents a particular repository from which certificates and
michael@0 261 * CRLs can be retrieved by PKIX_ValidateChain or PKIX_BuildChain as needed
michael@0 262 * during the validation or building process. If "params" does not have any
michael@0 263 * CertStores, this function stores an empty List at "pStores".
michael@0 264 *
michael@0 265 * PARAMETERS:
michael@0 266 * "params"
michael@0 267 * Address of ProcessingParams whose List of CertStores (if any) are to
michael@0 268 * be stored. Must be non-NULL.
michael@0 269 * "pStores"
michael@0 270 * Address where object pointer will be stored. Must be non-NULL.
michael@0 271 * "plContext"
michael@0 272 * Platform-specific context pointer.
michael@0 273 * THREAD SAFETY:
michael@0 274 * Conditionally Thread Safe
michael@0 275 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 276 * RETURNS:
michael@0 277 * Returns NULL if the function succeeds.
michael@0 278 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 279 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 280 */
michael@0 281 PKIX_Error *
michael@0 282 PKIX_ProcessingParams_GetCertStores(
michael@0 283 PKIX_ProcessingParams *params,
michael@0 284 PKIX_List **pStores, /* list of PKIX_CertStore */
michael@0 285 void *plContext);
michael@0 286
michael@0 287 /*
michael@0 288 * FUNCTION: PKIX_ProcessingParams_SetCertStores
michael@0 289 * DESCRIPTION:
michael@0 290 *
michael@0 291 * Sets the ProcessingParams pointed to by "params" with a List of CertStores
michael@0 292 * pointed to by "stores". Each CertStore represents a particular repository
michael@0 293 * from which certificates and CRLs can be retrieved by PKIX_ValidateChain or
michael@0 294 * PKIX_BuildChain as needed during the validation or building process. If
michael@0 295 * "stores" is NULL, no CertStores will be used.
michael@0 296 *
michael@0 297 * PARAMETERS:
michael@0 298 * "params"
michael@0 299 * Address of ProcessingParams whose List of CertStores is to be set.
michael@0 300 * Must be non-NULL.
michael@0 301 * "stores"
michael@0 302 * Address of List of CertStores to be set. If NULL, no CertStores will
michael@0 303 * be used.
michael@0 304 * "plContext"
michael@0 305 * Platform-specific context pointer.
michael@0 306 * THREAD SAFETY:
michael@0 307 * Not Thread Safe - assumes exclusive access to "params"
michael@0 308 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 309 * RETURNS:
michael@0 310 * Returns NULL if the function succeeds.
michael@0 311 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 312 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 313 */
michael@0 314 PKIX_Error *
michael@0 315 PKIX_ProcessingParams_SetCertStores(
michael@0 316 PKIX_ProcessingParams *params,
michael@0 317 PKIX_List *stores, /* list of PKIX_CertStore */
michael@0 318 void *plContext);
michael@0 319
michael@0 320 /*
michael@0 321 * FUNCTION: PKIX_ProcessingParams_AddCertStore
michael@0 322 * DESCRIPTION:
michael@0 323 *
michael@0 324 * Adds the CertStore pointed to by "store" to the ProcessingParams pointed
michael@0 325 * to by "params". The CertStore represents a particular repository from
michael@0 326 * which certificates and CRLs can be retrieved by PKIX_ValidateChain or
michael@0 327 * PKIX_BuildChain as needed during the validation or building process.
michael@0 328 *
michael@0 329 * PARAMETERS:
michael@0 330 * "params"
michael@0 331 * Address of ProcessingParams to be added to. Must be non-NULL.
michael@0 332 * "store"
michael@0 333 * Address of CertStore to be added.
michael@0 334 * "plContext"
michael@0 335 * Platform-specific context pointer.
michael@0 336 * THREAD SAFETY:
michael@0 337 * Not Thread Safe - assumes exclusive access to "params"
michael@0 338 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 339 * RETURNS:
michael@0 340 * Returns NULL if the function succeeds.
michael@0 341 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 342 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 343 */
michael@0 344 PKIX_Error *
michael@0 345 PKIX_ProcessingParams_AddCertStore(
michael@0 346 PKIX_ProcessingParams *params,
michael@0 347 PKIX_CertStore *store,
michael@0 348 void *plContext);
michael@0 349
michael@0 350 /*
michael@0 351 * FUNCTION: PKIX_ProcessingParams_GetDate
michael@0 352 * DESCRIPTION:
michael@0 353 *
michael@0 354 * Retrieves a pointer to the Date (if any) that is set in the
michael@0 355 * ProcessingParams pointed to by "params" and stores it at "pDate". The
michael@0 356 * Date represents the time for which the validation of the certificate chain
michael@0 357 * should be determined. If "params" does not have any Date set, this function
michael@0 358 * stores NULL at "pDate".
michael@0 359 *
michael@0 360 * PARAMETERS:
michael@0 361 * "params"
michael@0 362 * Address of ProcessingParams whose Date (if any) is to be stored.
michael@0 363 * Must be non-NULL.
michael@0 364 * "pDate"
michael@0 365 * Address where object pointer will be stored. Must be non-NULL.
michael@0 366 * "plContext"
michael@0 367 * Platform-specific context pointer.
michael@0 368 * THREAD SAFETY:
michael@0 369 * Conditionally Thread Safe
michael@0 370 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 371 * RETURNS:
michael@0 372 * Returns NULL if the function succeeds.
michael@0 373 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 374 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 375 */
michael@0 376 PKIX_Error *
michael@0 377 PKIX_ProcessingParams_GetDate(
michael@0 378 PKIX_ProcessingParams *params,
michael@0 379 PKIX_PL_Date **pDate,
michael@0 380 void *plContext);
michael@0 381
michael@0 382 /*
michael@0 383 * FUNCTION: PKIX_ProcessingParams_SetDate
michael@0 384 * DESCRIPTION:
michael@0 385 *
michael@0 386 * Sets the ProcessingParams pointed to by "params" with a Date pointed to by
michael@0 387 * "date". The Date represents the time for which the validation of the
michael@0 388 * certificate chain should be determined. If "date" is NULL, the current
michael@0 389 * time is used during validation.
michael@0 390 *
michael@0 391 * PARAMETERS:
michael@0 392 * "params"
michael@0 393 * Address of ProcessingParams whose Date is to be set. Must be non-NULL.
michael@0 394 * "date"
michael@0 395 * Address of Date to be set. If NULL, current time is used.
michael@0 396 * "plContext"
michael@0 397 * Platform-specific context pointer.
michael@0 398 * THREAD SAFETY:
michael@0 399 * Not Thread Safe - assumes exclusive access to "params"
michael@0 400 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 401 * RETURNS:
michael@0 402 * Returns NULL if the function succeeds.
michael@0 403 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 404 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 405 */
michael@0 406 PKIX_Error *
michael@0 407 PKIX_ProcessingParams_SetDate(
michael@0 408 PKIX_ProcessingParams *params,
michael@0 409 PKIX_PL_Date *date,
michael@0 410 void *plContext);
michael@0 411
michael@0 412 /*
michael@0 413 * FUNCTION: PKIX_ProcessingParams_GetInitialPolicies
michael@0 414 * DESCRIPTION:
michael@0 415 *
michael@0 416 * Retrieves a pointer to the List of OIDs (if any) that are set in the
michael@0 417 * ProcessingParams pointed to by "params" and stores it at "pInitPolicies".
michael@0 418 * Each OID represents an initial policy identifier, indicating that any
michael@0 419 * one of these policies would be acceptable to the certificate user for
michael@0 420 * the purposes of certification path processing. If "params" does not have
michael@0 421 * any initial policies, this function stores an empty List at
michael@0 422 * "pInitPolicies".
michael@0 423 *
michael@0 424 * PARAMETERS:
michael@0 425 * "params"
michael@0 426 * Address of ProcessingParams whose List of OIDs (if any) are to be
michael@0 427 * stored. Must be non-NULL.
michael@0 428 * "pInitPolicies"
michael@0 429 * Address where object pointer will be stored. Must be non-NULL.
michael@0 430 * "plContext"
michael@0 431 * Platform-specific context pointer.
michael@0 432 * THREAD SAFETY:
michael@0 433 * Conditionally Thread Safe
michael@0 434 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 435 * RETURNS:
michael@0 436 * Returns NULL if the function succeeds.
michael@0 437 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 438 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 439 */
michael@0 440 PKIX_Error *
michael@0 441 PKIX_ProcessingParams_GetInitialPolicies(
michael@0 442 PKIX_ProcessingParams *params,
michael@0 443 PKIX_List **pInitPolicies, /* list of PKIX_PL_OID */
michael@0 444 void *plContext);
michael@0 445
michael@0 446 /*
michael@0 447 * FUNCTION: PKIX_ProcessingParams_SetInitialPolicies
michael@0 448 * DESCRIPTION:
michael@0 449 *
michael@0 450 * Sets the ProcessingParams pointed to by "params" with a List of OIDs
michael@0 451 * pointed to by "initPolicies".
michael@0 452 *
michael@0 453 * Each OID represents an initial policy identifier, indicating that any
michael@0 454 * one of these policies would be acceptable to the certificate user for
michael@0 455 * the purposes of certification path processing. By default, any policy
michael@0 456 * is acceptable (i.e. all policies), so a user that wants to allow any
michael@0 457 * policy as acceptable does not need to call this method. Similarly, if
michael@0 458 * initPolicies is NULL or points to an empty List, all policies are
michael@0 459 * acceptable.
michael@0 460 *
michael@0 461 * PARAMETERS:
michael@0 462 * "params"
michael@0 463 * Address of ProcessingParams whose List of OIDs is to be set.
michael@0 464 * Must be non-NULL.
michael@0 465 * "initPolicies"
michael@0 466 * Address of List of OIDs to be set. If NULL or if pointing to an empty
michael@0 467 * List, all policies are acceptable.
michael@0 468 * "plContext"
michael@0 469 * Platform-specific context pointer.
michael@0 470 * THREAD SAFETY:
michael@0 471 * Not Thread Safe - assumes exclusive access to "params"
michael@0 472 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 473 * RETURNS:
michael@0 474 * Returns NULL if the function succeeds.
michael@0 475 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 476 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 477 */
michael@0 478 PKIX_Error *
michael@0 479 PKIX_ProcessingParams_SetInitialPolicies(
michael@0 480 PKIX_ProcessingParams *params,
michael@0 481 PKIX_List *initPolicies, /* list of PKIX_PL_OID */
michael@0 482 void *plContext);
michael@0 483
michael@0 484 /*
michael@0 485 * FUNCTION: PKIX_ProcessingParams_GetPolicyQualifiersRejected
michael@0 486 * DESCRIPTION:
michael@0 487 *
michael@0 488 * Checks whether the ProcessingParams pointed to by "params" indicate that
michael@0 489 * policy qualifiers should be rejected and stores the Boolean result at
michael@0 490 * "pRejected".
michael@0 491 *
michael@0 492 * PARAMETERS:
michael@0 493 * "params"
michael@0 494 * Address of ProcessingParams used to determine whether or not policy
michael@0 495 * qualifiers should be rejected. Must be non-NULL.
michael@0 496 * "pRejected"
michael@0 497 * Address where Boolean will be stored. Must be non-NULL.
michael@0 498 * "plContext"
michael@0 499 * Platform-specific context pointer.
michael@0 500 * THREAD SAFETY:
michael@0 501 * Conditionally Thread Safe
michael@0 502 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 503 * RETURNS:
michael@0 504 * Returns NULL if the function succeeds.
michael@0 505 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 506 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 507 */
michael@0 508 PKIX_Error *
michael@0 509 PKIX_ProcessingParams_GetPolicyQualifiersRejected(
michael@0 510 PKIX_ProcessingParams *params,
michael@0 511 PKIX_Boolean *pRejected,
michael@0 512 void *plContext);
michael@0 513
michael@0 514 /*
michael@0 515 * FUNCTION: PKIX_ProcessingParams_SetPolicyQualifiersRejected
michael@0 516 * DESCRIPTION:
michael@0 517 *
michael@0 518 * Specifies in the ProcessingParams pointed to by "params" whether policy
michael@0 519 * qualifiers are rejected using the Boolean value of "rejected".
michael@0 520 *
michael@0 521 * PARAMETERS:
michael@0 522 * "params"
michael@0 523 * Address of ProcessingParams to be set. Must be non-NULL.
michael@0 524 * "rejected"
michael@0 525 * Boolean value indicating whether policy qualifiers are to be rejected.
michael@0 526 * "plContext"
michael@0 527 * Platform-specific context pointer.
michael@0 528 * THREAD SAFETY:
michael@0 529 * Not Thread Safe - assumes exclusive access to "params"
michael@0 530 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 531 * RETURNS:
michael@0 532 * Returns NULL if the function succeeds.
michael@0 533 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 534 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 535 */
michael@0 536 PKIX_Error *
michael@0 537 PKIX_ProcessingParams_SetPolicyQualifiersRejected(
michael@0 538 PKIX_ProcessingParams *params,
michael@0 539 PKIX_Boolean rejected,
michael@0 540 void *plContext);
michael@0 541
michael@0 542 /*
michael@0 543 * FUNCTION: PKIX_ProcessingParams_GetTargetCertConstraints
michael@0 544 * DESCRIPTION:
michael@0 545 *
michael@0 546 * Retrieves a pointer to the CertSelector (if any) that is set in the
michael@0 547 * ProcessingParams pointed to by "params" and stores it at "pConstraints".
michael@0 548 * The CertSelector represents the constraints to be placed on the target
michael@0 549 * certificate. If "params" does not have any CertSelector set, this function
michael@0 550 * stores NULL at "pConstraints".
michael@0 551 *
michael@0 552 * PARAMETERS:
michael@0 553 * "params"
michael@0 554 * Address of ProcessingParams whose CertSelector (if any) is to be
michael@0 555 * stored. Must be non-NULL.
michael@0 556 * "pConstraints"
michael@0 557 * Address where object pointer will be stored. Must be non-NULL.
michael@0 558 * "plContext"
michael@0 559 * Platform-specific context pointer.
michael@0 560 * THREAD SAFETY:
michael@0 561 * Conditionally Thread Safe
michael@0 562 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 563 * RETURNS:
michael@0 564 * Returns NULL if the function succeeds.
michael@0 565 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 566 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 567 */
michael@0 568 PKIX_Error *
michael@0 569 PKIX_ProcessingParams_GetTargetCertConstraints(
michael@0 570 PKIX_ProcessingParams *params,
michael@0 571 PKIX_CertSelector **pConstraints,
michael@0 572 void *plContext);
michael@0 573
michael@0 574 /*
michael@0 575 * FUNCTION: PKIX_ProcessingParams_SetTargetCertConstraints
michael@0 576 * DESCRIPTION:
michael@0 577 *
michael@0 578 * Sets the ProcessingParams pointed to by "params" with a CertSelector
michael@0 579 * pointed to by "constraints". The CertSelector represents the constraints
michael@0 580 * to be placed on the target certificate. If "constraints" is NULL, no
michael@0 581 * constraints are defined.
michael@0 582 *
michael@0 583 * PARAMETERS:
michael@0 584 * "params"
michael@0 585 * Address of ProcessingParams whose CertSelector is to be set.
michael@0 586 * Must be non-NULL.
michael@0 587 * "constraints"
michael@0 588 * Address of CertSelector to be set. If NULL, no constraints are defined.
michael@0 589 * "plContext"
michael@0 590 * Platform-specific context pointer.
michael@0 591 * THREAD SAFETY:
michael@0 592 * Not Thread Safe - assumes exclusive access to "params"
michael@0 593 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 594 * RETURNS:
michael@0 595 * Returns NULL if the function succeeds.
michael@0 596 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 597 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 598 */
michael@0 599 PKIX_Error *
michael@0 600 PKIX_ProcessingParams_SetTargetCertConstraints(
michael@0 601 PKIX_ProcessingParams *params,
michael@0 602 PKIX_CertSelector *constraints,
michael@0 603 void *plContext);
michael@0 604
michael@0 605 /*
michael@0 606 * FUNCTION: PKIX_ProcessingParams_GetTrustAnchors
michael@0 607 * DESCRIPTION:
michael@0 608 *
michael@0 609 * Retrieves a pointer to the List of TrustAnchors that are set in
michael@0 610 * the ProcessingParams pointed to by "params" and stores it at "pAnchors".
michael@0 611 * If the function succeeds, the pointer to the List is guaranteed to be
michael@0 612 * non-NULL and the List is guaranteed to be non-empty.
michael@0 613 *
michael@0 614 * PARAMETERS:
michael@0 615 * "params"
michael@0 616 * Address of ProcessingParams whose List of TrustAnchors are to
michael@0 617 * be stored. Must be non-NULL.
michael@0 618 * "pAnchors"
michael@0 619 * Address where object pointer will be stored. Must be non-NULL.
michael@0 620 * "plContext"
michael@0 621 * Platform-specific context pointer.
michael@0 622 * THREAD SAFETY:
michael@0 623 * Conditionally Thread Safe
michael@0 624 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 625 * RETURNS:
michael@0 626 * Returns NULL if the function succeeds.
michael@0 627 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 628 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 629 */
michael@0 630 PKIX_Error *
michael@0 631 PKIX_ProcessingParams_GetTrustAnchors(
michael@0 632 PKIX_ProcessingParams *params,
michael@0 633 PKIX_List **pAnchors, /* list of TrustAnchor */
michael@0 634 void *plContext);
michael@0 635 /*
michael@0 636 * FUNCTION: PKIX_ProcessingParams_SetTrustAnchors
michael@0 637 * DESCRIPTION:
michael@0 638 *
michael@0 639 * Sets user defined set of trust anchors. The handling of the trust anchors
michael@0 640 * may be furthered alter via PKIX_ProcessingParams_SetUseOnlyTrustAnchors.
michael@0 641 * By default, a certificate will be considered invalid if it does not chain
michael@0 642 * to a trusted anchor from this list.
michael@0 643 *
michael@0 644 * PARAMETERS:
michael@0 645 * "params"
michael@0 646 * Address of ProcessingParams whose List of TrustAnchors are to
michael@0 647 * be stored. Must be non-NULL.
michael@0 648 * "anchors"
michael@0 649 * Address of the trust anchors list object. Must be non-NULL.
michael@0 650 * "plContext"
michael@0 651 * Platform-specific context pointer.
michael@0 652 * THREAD SAFETY:
michael@0 653 * Conditionally Thread Safe
michael@0 654 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 655 * RETURNS:
michael@0 656 * Returns NULL if the function succeeds.
michael@0 657 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 658 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 659 */
michael@0 660 PKIX_Error *
michael@0 661 PKIX_ProcessingParams_SetTrustAnchors(
michael@0 662 PKIX_ProcessingParams *params,
michael@0 663 PKIX_List *pAnchors, /* list of TrustAnchor */
michael@0 664 void *plContext);
michael@0 665
michael@0 666 /*
michael@0 667 * FUNCTION: PKIX_ProcessingParams_GetUseOnlyTrustAnchors
michael@0 668 * DESCRIPTION:
michael@0 669 *
michael@0 670 * Retrieves a pointer to the Boolean. The boolean value represents
michael@0 671 * the switch value that is used to identify whether trust anchors, if
michael@0 672 * specified, should be the exclusive source of trust information.
michael@0 673 * If the function succeeds, the pointer to the Boolean is guaranteed to be
michael@0 674 * non-NULL.
michael@0 675 *
michael@0 676 * PARAMETERS:
michael@0 677 * "params"
michael@0 678 * Address of ProcessingParams. Must be non-NULL.
michael@0 679 * "pUseOnlyTrustAnchors"
michael@0 680 * Address where object pointer will be stored. Must be non-NULL.
michael@0 681 * "plContext"
michael@0 682 * Platform-specific context pointer.
michael@0 683 * THREAD SAFETY:
michael@0 684 * Conditionally Thread Safe
michael@0 685 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 686 * RETURNS:
michael@0 687 * Returns NULL if the function succeeds.
michael@0 688 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 689 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 690 */
michael@0 691 PKIX_Error *
michael@0 692 PKIX_ProcessingParams_GetUseOnlyTrustAnchors(
michael@0 693 PKIX_ProcessingParams *params,
michael@0 694 PKIX_Boolean *pUseOnlyTrustAnchors,
michael@0 695 void *plContext);
michael@0 696
michael@0 697 /*
michael@0 698 * FUNCTION: PKIX_ProcessingParams_SetUseOnlyTrustAnchors
michael@0 699 * DESCRIPTION:
michael@0 700 *
michael@0 701 * Configures whether trust anchors are used as the exclusive source of trust.
michael@0 702 *
michael@0 703 * PARAMETERS:
michael@0 704 * "params"
michael@0 705 * Address of ProcessingParams. Must be non-NULL.
michael@0 706 * "useOnlyTrustAnchors"
michael@0 707 * If true, indicates that trust anchors should be used exclusively when
michael@0 708 * they have been specified via PKIX_ProcessingParams_SetTrustAnchors. A
michael@0 709 * certificate will be considered invalid if it does not chain to a
michael@0 710 * trusted anchor from that list.
michael@0 711 * If false, indicates that the trust anchors are additive to whatever
michael@0 712 * existing trust stores are configured. A certificate is considered
michael@0 713 * valid if it chains to EITHER a trusted anchor from that list OR a
michael@0 714 * certificate marked trusted in a trust store.
michael@0 715 * "plContext"
michael@0 716 * Platform-specific context pointer.
michael@0 717 * THREAD SAFETY:
michael@0 718 * Conditionally Thread Safe
michael@0 719 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 720 * RETURNS:
michael@0 721 * Returns NULL if the function succeeds.
michael@0 722 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 723 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 724 */
michael@0 725 PKIX_Error *
michael@0 726 PKIX_ProcessingParams_SetUseOnlyTrustAnchors(
michael@0 727 PKIX_ProcessingParams *params,
michael@0 728 PKIX_Boolean useOnlyTrustAnchors,
michael@0 729 void *plContext);
michael@0 730
michael@0 731 /*
michael@0 732 * FUNCTION: PKIX_ProcessingParams_GetUseAIAForCertFetching
michael@0 733 * DESCRIPTION:
michael@0 734 *
michael@0 735 * Retrieves a pointer to the Boolean. The boolean value represents
michael@0 736 * the switch value that is used to identify if url in cert AIA extension
michael@0 737 * may be used for cert fetching.
michael@0 738 * If the function succeeds, the pointer to the Boolean is guaranteed to be
michael@0 739 * non-NULL.
michael@0 740 *
michael@0 741 * PARAMETERS:
michael@0 742 * "params"
michael@0 743 * Address of ProcessingParams. Must be non-NULL.
michael@0 744 * "pUseAIA"
michael@0 745 * Address where object pointer will be stored. Must be non-NULL.
michael@0 746 * "plContext"
michael@0 747 * Platform-specific context pointer.
michael@0 748 * THREAD SAFETY:
michael@0 749 * Conditionally Thread Safe
michael@0 750 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 751 * RETURNS:
michael@0 752 * Returns NULL if the function succeeds.
michael@0 753 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 754 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 755 */
michael@0 756 PKIX_Error *
michael@0 757 PKIX_ProcessingParams_GetUseAIAForCertFetching(
michael@0 758 PKIX_ProcessingParams *params,
michael@0 759 PKIX_Boolean *pUseAIA, /* list of TrustAnchor */
michael@0 760 void *plContext);
michael@0 761 /*
michael@0 762 * FUNCTION: PKIX_ProcessingParams_SetTrustAnchors
michael@0 763 * DESCRIPTION:
michael@0 764 *
michael@0 765 * Sets switch value that defines if url in cert AIA extension
michael@0 766 * may be used for cert fetching.
michael@0 767 *
michael@0 768 * PARAMETERS:
michael@0 769 * "params"
michael@0 770 * Address of ProcessingParams.
michael@0 771 * "useAIA"
michael@0 772 * Address of the trust anchors list object. Must be non-NULL.
michael@0 773 * "plContext"
michael@0 774 * Platform-specific context pointer.
michael@0 775 * THREAD SAFETY:
michael@0 776 * Conditionally Thread Safe
michael@0 777 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 778 * RETURNS:
michael@0 779 * Returns NULL if the function succeeds.
michael@0 780 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 781 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 782 */
michael@0 783 PKIX_Error *
michael@0 784 PKIX_ProcessingParams_SetUseAIAForCertFetching(
michael@0 785 PKIX_ProcessingParams *params,
michael@0 786 PKIX_Boolean useAIA,
michael@0 787 void *plContext);
michael@0 788
michael@0 789 /*
michael@0 790 * FUNCTION: PKIX_ProcessingParams_SetQualifyTargetCert
michael@0 791 * DESCRIPTION:
michael@0 792 *
michael@0 793 * Sets a boolean value that tells if libpkix needs to check that
michael@0 794 * the target certificate satisfies the conditions set in processing
michael@0 795 * parameters. Includes but not limited to date, ku and eku checks.
michael@0 796 *
michael@0 797 * PARAMETERS:
michael@0 798 * "params"
michael@0 799 * Address of ProcessingParams whose List of TrustAnchors are to
michael@0 800 * be stored. Must be non-NULL.
michael@0 801 * "qualifyTargetCert"
michael@0 802 * boolean value if set to true will trigger qualification of the
michael@0 803 * target certificate.
michael@0 804 * "plContext"
michael@0 805 * Platform-specific context pointer.
michael@0 806 * THREAD SAFETY:
michael@0 807 * Conditionally Thread Safe
michael@0 808 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 809 * RETURNS:
michael@0 810 * Returns NULL if the function succeeds.
michael@0 811 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 812 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 813 */
michael@0 814 PKIX_Error *
michael@0 815 PKIX_ProcessingParams_SetQualifyTargetCert(
michael@0 816 PKIX_ProcessingParams *params,
michael@0 817 PKIX_Boolean qualifyTargetCert,
michael@0 818 void *plContext);
michael@0 819
michael@0 820 /*
michael@0 821 * FUNCTION: PKIX_ProcessingParams_GetHintCerts
michael@0 822 * DESCRIPTION:
michael@0 823 *
michael@0 824 * Retrieves a pointer to a List of Certs supplied by the user as a suggested
michael@0 825 * partial CertChain (subject to verification), that are set in the
michael@0 826 * ProcessingParams pointed to by "params", and stores it at "pHintCerts".
michael@0 827 * The List returned may be empty or NULL.
michael@0 828 *
michael@0 829 * PARAMETERS:
michael@0 830 * "params"
michael@0 831 * Address of ProcessingParams whose List of TrustAnchors are to
michael@0 832 * be stored. Must be non-NULL.
michael@0 833 * "pHintCerts"
michael@0 834 * Address where object pointer will be stored. Must be non-NULL.
michael@0 835 * "plContext"
michael@0 836 * Platform-specific context pointer.
michael@0 837 * THREAD SAFETY:
michael@0 838 * Conditionally Thread Safe
michael@0 839 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 840 * RETURNS:
michael@0 841 * Returns NULL if the function succeeds.
michael@0 842 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 843 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 844 */
michael@0 845 PKIX_Error *
michael@0 846 PKIX_ProcessingParams_GetHintCerts(
michael@0 847 PKIX_ProcessingParams *params,
michael@0 848 PKIX_List **pHintCerts,
michael@0 849 void *plContext);
michael@0 850
michael@0 851 /*
michael@0 852 * FUNCTION: PKIX_ProcessingParams_SetHintCerts
michael@0 853 * DESCRIPTION:
michael@0 854 *
michael@0 855 * Stores a pointer to a List of Certs supplied by the user as a suggested
michael@0 856 * partial CertChain (subject to verification), as an element in the
michael@0 857 * ProcessingParams pointed to by "params". The List may be empty or NULL.
michael@0 858 *
michael@0 859 * PARAMETERS:
michael@0 860 * "params"
michael@0 861 * Address of ProcessingParams whose List of HintCerts is to be stored.
michael@0 862 * Must be non-NULL.
michael@0 863 * "hintCerts"
michael@0 864 * Address where object pointer will be stored. Must be non-NULL.
michael@0 865 * "plContext"
michael@0 866 * Platform-specific context pointer.
michael@0 867 * THREAD SAFETY:
michael@0 868 * Conditionally Thread Safe
michael@0 869 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 870 * RETURNS:
michael@0 871 * Returns NULL if the function succeeds.
michael@0 872 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 873 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 874 */
michael@0 875 PKIX_Error *
michael@0 876 PKIX_ProcessingParams_SetHintCerts(
michael@0 877 PKIX_ProcessingParams *params,
michael@0 878 PKIX_List *hintCerts,
michael@0 879 void *plContext);
michael@0 880
michael@0 881 /*
michael@0 882 * FUNCTION: PKIX_ProcessingParams_GetResourceLimits
michael@0 883 * DESCRIPTION:
michael@0 884 *
michael@0 885 * Retrieves a pointer to the ResourceLimits (if any) that is set in the
michael@0 886 * ProcessingParams pointed to by "params" and stores it at "pResourceLimits".
michael@0 887 * The ResourceLimits represent the maximum resource usage that the caller
michael@0 888 * desires (such as MaxTime). The ValidateChain or BuildChain call will not
michael@0 889 * exceed these maximum limits. If "params" does not have any ResourceLimits
michael@0 890 * set, this function stores NULL at "pResourceLimits".
michael@0 891 *
michael@0 892 * PARAMETERS:
michael@0 893 * "params"
michael@0 894 * Address of ProcessingParams whose ResourceLimits (if any) are to be
michael@0 895 * stored. Must be non-NULL.
michael@0 896 * "pResourceLimits"
michael@0 897 * Address where object pointer will be stored. Must be non-NULL.
michael@0 898 * "plContext"
michael@0 899 * Platform-specific context pointer.
michael@0 900 * THREAD SAFETY:
michael@0 901 * Conditionally Thread Safe
michael@0 902 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 903 * RETURNS:
michael@0 904 * Returns NULL if the function succeeds.
michael@0 905 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 906 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 907 */
michael@0 908 PKIX_Error *
michael@0 909 PKIX_ProcessingParams_GetResourceLimits(
michael@0 910 PKIX_ProcessingParams *params,
michael@0 911 PKIX_ResourceLimits **pResourceLimits,
michael@0 912 void *plContext);
michael@0 913
michael@0 914 /*
michael@0 915 * FUNCTION: PKIX_ProcessingParams_SetResourceLimits
michael@0 916 * DESCRIPTION:
michael@0 917 *
michael@0 918 * Sets the ProcessingParams pointed to by "params" with a ResourceLimits
michael@0 919 * object pointed to by "resourceLimits". The ResourceLimits represent the
michael@0 920 * maximum resource usage that the caller desires (such as MaxTime). The
michael@0 921 * ValidateChain or BuildChain call will not exceed these maximum limits.
michael@0 922 * If "resourceLimits" is NULL, no ResourceLimits are defined.
michael@0 923 *
michael@0 924 * PARAMETERS:
michael@0 925 * "params"
michael@0 926 * Address of ProcessingParams whose ResourceLimits are to be set.
michael@0 927 * Must be non-NULL.
michael@0 928 * "resourceLimits"
michael@0 929 * Address of ResourceLimits to be set. If NULL, no limits are defined.
michael@0 930 * "plContext"
michael@0 931 * Platform-specific context pointer.
michael@0 932 * THREAD SAFETY:
michael@0 933 * Not Thread Safe - assumes exclusive access to "params"
michael@0 934 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 935 * RETURNS:
michael@0 936 * Returns NULL if the function succeeds.
michael@0 937 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 938 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 939 */
michael@0 940 PKIX_Error *
michael@0 941 PKIX_ProcessingParams_SetResourceLimits(
michael@0 942 PKIX_ProcessingParams *params,
michael@0 943 PKIX_ResourceLimits *resourceLimits,
michael@0 944 void *plContext);
michael@0 945
michael@0 946 /*
michael@0 947 * FUNCTION: PKIX_ProcessingParams_IsAnyPolicyInhibited
michael@0 948 * DESCRIPTION:
michael@0 949 *
michael@0 950 * Checks whether the ProcessingParams pointed to by "params" indicate that
michael@0 951 * anyPolicy is inhibited and stores the Boolean result at "pInhibited".
michael@0 952 *
michael@0 953 * PARAMETERS:
michael@0 954 * "params"
michael@0 955 * Address of ProcessingParams used to determine whether or not anyPolicy
michael@0 956 * inhibited. Must be non-NULL.
michael@0 957 * "pInhibited"
michael@0 958 * Address where Boolean will be stored. Must be non-NULL.
michael@0 959 * "plContext"
michael@0 960 * Platform-specific context pointer.
michael@0 961 * THREAD SAFETY:
michael@0 962 * Conditionally Thread Safe
michael@0 963 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 964 * RETURNS:
michael@0 965 * Returns NULL if the function succeeds.
michael@0 966 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 967 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 968 */
michael@0 969 PKIX_Error *
michael@0 970 PKIX_ProcessingParams_IsAnyPolicyInhibited(
michael@0 971 PKIX_ProcessingParams *params,
michael@0 972 PKIX_Boolean *pInhibited,
michael@0 973 void *plContext);
michael@0 974
michael@0 975 /*
michael@0 976 * FUNCTION: PKIX_ProcessingParams_SetAnyPolicyInhibited
michael@0 977 * DESCRIPTION:
michael@0 978 *
michael@0 979 * Specifies in the ProcessingParams pointed to by "params" whether anyPolicy
michael@0 980 * is inhibited using the Boolean value of "inhibited".
michael@0 981 *
michael@0 982 * PARAMETERS:
michael@0 983 * "params"
michael@0 984 * Address of ProcessingParams to be set. Must be non-NULL.
michael@0 985 * "inhibited"
michael@0 986 * Boolean value indicating whether anyPolicy is to be inhibited.
michael@0 987 * "plContext"
michael@0 988 * Platform-specific context pointer.
michael@0 989 * THREAD SAFETY:
michael@0 990 * Not Thread Safe - assumes exclusive access to "params"
michael@0 991 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 992 * RETURNS:
michael@0 993 * Returns NULL if the function succeeds.
michael@0 994 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 995 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 996 */
michael@0 997 PKIX_Error *
michael@0 998 PKIX_ProcessingParams_SetAnyPolicyInhibited(
michael@0 999 PKIX_ProcessingParams *params,
michael@0 1000 PKIX_Boolean inhibited,
michael@0 1001 void *plContext);
michael@0 1002
michael@0 1003 /*
michael@0 1004 * FUNCTION: PKIX_ProcessingParams_IsExplicitPolicyRequired
michael@0 1005 * DESCRIPTION:
michael@0 1006 *
michael@0 1007 * Checks whether the ProcessingParams pointed to by "params" indicate that
michael@0 1008 * explicit policies are required and stores the Boolean result at
michael@0 1009 * "pRequired".
michael@0 1010 *
michael@0 1011 * PARAMETERS:
michael@0 1012 * "params"
michael@0 1013 * Address of ProcessingParams used to determine whether or not explicit
michael@0 1014 * policies are required. Must be non-NULL.
michael@0 1015 * "pRequired"
michael@0 1016 * Address where Boolean will be stored. Must be non-NULL.
michael@0 1017 * "plContext"
michael@0 1018 * Platform-specific context pointer.
michael@0 1019 * THREAD SAFETY:
michael@0 1020 * Conditionally Thread Safe
michael@0 1021 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1022 * RETURNS:
michael@0 1023 * Returns NULL if the function succeeds.
michael@0 1024 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1025 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1026 */
michael@0 1027 PKIX_Error *
michael@0 1028 PKIX_ProcessingParams_IsExplicitPolicyRequired(
michael@0 1029 PKIX_ProcessingParams *params,
michael@0 1030 PKIX_Boolean *pRequired,
michael@0 1031 void *plContext);
michael@0 1032
michael@0 1033 /*
michael@0 1034 * FUNCTION: PKIX_ProcessingParams_SetExplicitPolicyRequired
michael@0 1035 * DESCRIPTION:
michael@0 1036 *
michael@0 1037 * Specifies in the ProcessingParams pointed to by "params" whether explicit
michael@0 1038 * policies are required using the Boolean value of "required".
michael@0 1039 *
michael@0 1040 * PARAMETERS:
michael@0 1041 * "params"
michael@0 1042 * Address of ProcessingParams to be set. Must be non-NULL.
michael@0 1043 * "required"
michael@0 1044 * Boolean value indicating whether explicit policies are to be required.
michael@0 1045 * "plContext"
michael@0 1046 * Platform-specific context pointer.
michael@0 1047 * THREAD SAFETY:
michael@0 1048 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1049 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1050 * RETURNS:
michael@0 1051 * Returns NULL if the function succeeds.
michael@0 1052 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1053 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1054 */
michael@0 1055 PKIX_Error *
michael@0 1056 PKIX_ProcessingParams_SetExplicitPolicyRequired(
michael@0 1057 PKIX_ProcessingParams *params,
michael@0 1058 PKIX_Boolean required,
michael@0 1059 void *plContext);
michael@0 1060
michael@0 1061 /*
michael@0 1062 * FUNCTION: PKIX_ProcessingParams_IsPolicyMappingInhibited
michael@0 1063 * DESCRIPTION:
michael@0 1064 *
michael@0 1065 * Checks whether the ProcessingParams pointed to by "params" indicate that
michael@0 1066 * policyMapping is inhibited and stores the Boolean result at "pInhibited".
michael@0 1067 *
michael@0 1068 * PARAMETERS:
michael@0 1069 * "params"
michael@0 1070 * Address of ProcessingParams used to determine whether or not policy
michael@0 1071 * mappings are inhibited. Must be non-NULL.
michael@0 1072 * "pInhibited"
michael@0 1073 * Address where Boolean will be stored. Must be non-NULL.
michael@0 1074 * "plContext"
michael@0 1075 * Platform-specific context pointer.
michael@0 1076 * THREAD SAFETY:
michael@0 1077 * Conditionally Thread Safe
michael@0 1078 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1079 * RETURNS:
michael@0 1080 * Returns NULL if the function succeeds.
michael@0 1081 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1082 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1083 */
michael@0 1084 PKIX_Error *
michael@0 1085 PKIX_ProcessingParams_IsPolicyMappingInhibited(
michael@0 1086 PKIX_ProcessingParams *params,
michael@0 1087 PKIX_Boolean *pInhibited,
michael@0 1088 void *plContext);
michael@0 1089
michael@0 1090 /*
michael@0 1091 * FUNCTION: PKIX_ProcessingParams_SetPolicyMappingInhibited
michael@0 1092 * DESCRIPTION:
michael@0 1093 *
michael@0 1094 * Specifies in the ProcessingParams pointed to by "params" whether policy
michael@0 1095 * mapping is inhibited using the Boolean value of "inhibited".
michael@0 1096 *
michael@0 1097 * PARAMETERS:
michael@0 1098 * "params"
michael@0 1099 * Address of ProcessingParams to be set. Must be non-NULL.
michael@0 1100 * "inhibited"
michael@0 1101 * Boolean value indicating whether policy mapping is to be inhibited.
michael@0 1102 * "plContext"
michael@0 1103 * Platform-specific context pointer.
michael@0 1104 * THREAD SAFETY:
michael@0 1105 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1106 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1107 * RETURNS:
michael@0 1108 * Returns NULL if the function succeeds.
michael@0 1109 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1110 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1111 */
michael@0 1112 PKIX_Error *
michael@0 1113 PKIX_ProcessingParams_SetPolicyMappingInhibited(
michael@0 1114 PKIX_ProcessingParams *params,
michael@0 1115 PKIX_Boolean inhibited,
michael@0 1116 void *plContext);
michael@0 1117
michael@0 1118
michael@0 1119 /* PKIX_ValidateParams
michael@0 1120 *
michael@0 1121 * PKIX_ValidateParams consists of a ProcessingParams object as well as the
michael@0 1122 * List of Certs (certChain) that the caller is trying to validate.
michael@0 1123 */
michael@0 1124
michael@0 1125 /*
michael@0 1126 * FUNCTION: PKIX_ValidateParams_Create
michael@0 1127 * DESCRIPTION:
michael@0 1128 *
michael@0 1129 * Creates a new ValidateParams object and stores it at "pParams".
michael@0 1130 *
michael@0 1131 * PARAMETERS:
michael@0 1132 * "procParams"
michael@0 1133 * Address of ProcessingParams to be used. Must be non-NULL.
michael@0 1134 * "chain"
michael@0 1135 * Address of List of Certs (certChain) to be validated. Must be non-NULL.
michael@0 1136 * "pParams"
michael@0 1137 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1138 * "plContext"
michael@0 1139 * Platform-specific context pointer.
michael@0 1140 * THREAD SAFETY:
michael@0 1141 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1142 * RETURNS:
michael@0 1143 * Returns NULL if the function succeeds.
michael@0 1144 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1145 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1146 */
michael@0 1147 PKIX_Error *
michael@0 1148 PKIX_ValidateParams_Create(
michael@0 1149 PKIX_ProcessingParams *procParams,
michael@0 1150 PKIX_List *chain,
michael@0 1151 PKIX_ValidateParams **pParams,
michael@0 1152 void *plContext);
michael@0 1153
michael@0 1154 /*
michael@0 1155 * FUNCTION: PKIX_ValidateParams_GetProcessingParams
michael@0 1156 * DESCRIPTION:
michael@0 1157 *
michael@0 1158 * Retrieves a pointer to the ProcessingParams that represent the basic
michael@0 1159 * certificate processing parameters used during chain validation and chain
michael@0 1160 * building from the ValidateParams pointed to by "valParams" and stores it
michael@0 1161 * at "pProcParams". If the function succeeds, the pointer to the
michael@0 1162 * ProcessingParams is guaranteed to be non-NULL.
michael@0 1163 *
michael@0 1164 * PARAMETERS:
michael@0 1165 * "valParams"
michael@0 1166 * Address of ValidateParams whose ProcessingParams are to be stored.
michael@0 1167 * Must be non-NULL.
michael@0 1168 * "pProcParams"
michael@0 1169 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1170 * "plContext"
michael@0 1171 * Platform-specific context pointer.
michael@0 1172 * THREAD SAFETY:
michael@0 1173 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1174 * RETURNS:
michael@0 1175 * Returns NULL if the function succeeds.
michael@0 1176 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1177 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1178 */
michael@0 1179 PKIX_Error *
michael@0 1180 PKIX_ValidateParams_GetProcessingParams(
michael@0 1181 PKIX_ValidateParams *valParams,
michael@0 1182 PKIX_ProcessingParams **pProcParams,
michael@0 1183 void *plContext);
michael@0 1184
michael@0 1185 /*
michael@0 1186 * FUNCTION: PKIX_ValidateParams_GetCertChain
michael@0 1187 * DESCRIPTION:
michael@0 1188 *
michael@0 1189 * Retrieves a pointer to the List of Certs (certChain) that is set in the
michael@0 1190 * ValidateParams pointed to by "valParams" and stores it at "pChain". If the
michael@0 1191 * function succeeds, the pointer to the CertChain is guaranteed to be
michael@0 1192 * non-NULL.
michael@0 1193 *
michael@0 1194 * PARAMETERS:
michael@0 1195 * "valParams"
michael@0 1196 * Address of ValidateParams whose CertChain is to be stored.
michael@0 1197 * Must be non-NULL.
michael@0 1198 * "pChain"
michael@0 1199 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1200 * "plContext"
michael@0 1201 * Platform-specific context pointer.
michael@0 1202 * THREAD SAFETY:
michael@0 1203 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1204 * RETURNS:
michael@0 1205 * Returns NULL if the function succeeds.
michael@0 1206 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1207 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1208 */
michael@0 1209 PKIX_Error *
michael@0 1210 PKIX_ValidateParams_GetCertChain(
michael@0 1211 PKIX_ValidateParams *valParams,
michael@0 1212 PKIX_List **pChain,
michael@0 1213 void *plContext);
michael@0 1214
michael@0 1215 /* PKIX_TrustAnchor
michael@0 1216 *
michael@0 1217 * A PKIX_TrustAnchor represents a trusted entity and can be specified using a
michael@0 1218 * self-signed certificate or using the trusted CA's name and public key. In
michael@0 1219 * order to limit the trust in the trusted entity, name constraints can also
michael@0 1220 * be imposed on the trust anchor.
michael@0 1221 */
michael@0 1222
michael@0 1223 /*
michael@0 1224 * FUNCTION: PKIX_TrustAnchor_CreateWithCert
michael@0 1225 * DESCRIPTION:
michael@0 1226 *
michael@0 1227 * Creates a new TrustAnchor object using the Cert pointed to by "cert" as
michael@0 1228 * the trusted certificate and stores it at "pAnchor". Once created, a
michael@0 1229 * TrustAnchor is immutable.
michael@0 1230 *
michael@0 1231 * PARAMETERS:
michael@0 1232 * "cert"
michael@0 1233 * Address of Cert to use as trusted certificate. Must be non-NULL.
michael@0 1234 * "pAnchor"
michael@0 1235 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1236 * "plContext"
michael@0 1237 * Platform-specific context pointer.
michael@0 1238 * THREAD SAFETY:
michael@0 1239 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1240 * RETURNS:
michael@0 1241 * Returns NULL if the function succeeds.
michael@0 1242 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1243 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1244 */
michael@0 1245 PKIX_Error *
michael@0 1246 PKIX_TrustAnchor_CreateWithCert(
michael@0 1247 PKIX_PL_Cert *cert,
michael@0 1248 PKIX_TrustAnchor **pAnchor,
michael@0 1249 void *plContext);
michael@0 1250
michael@0 1251 /*
michael@0 1252 * FUNCTION: PKIX_TrustAnchor_CreateWithNameKeyPair
michael@0 1253 * DESCRIPTION:
michael@0 1254 *
michael@0 1255 * Creates a new TrustAnchor object using the X500Name pointed to by "name",
michael@0 1256 * and the PublicKey pointed to by "pubKey" and stores it at "pAnchor". The
michael@0 1257 * CertNameConstraints pointed to by "nameConstraints" (if any) are used to
michael@0 1258 * limit the trust placed in this trust anchor. To indicate that name
michael@0 1259 * constraints don't apply, set "nameConstraints" to NULL. Once created, a
michael@0 1260 * TrustAnchor is immutable.
michael@0 1261 *
michael@0 1262 * PARAMETERS:
michael@0 1263 * "name"
michael@0 1264 * Address of X500Name to use as name of trusted CA. Must be non-NULL.
michael@0 1265 * "pubKey"
michael@0 1266 * Address of PublicKey to use as trusted public key. Must be non-NULL.
michael@0 1267 * "nameConstraints"
michael@0 1268 * Address of CertNameConstraints to use as initial name constraints.
michael@0 1269 * If NULL, no name constraints are applied.
michael@0 1270 * "pAnchor"
michael@0 1271 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1272 * "plContext"
michael@0 1273 * Platform-specific context pointer.
michael@0 1274 * THREAD SAFETY:
michael@0 1275 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1276 * RETURNS:
michael@0 1277 * Returns NULL if the function succeeds.
michael@0 1278 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1279 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1280 */
michael@0 1281 PKIX_Error *
michael@0 1282 PKIX_TrustAnchor_CreateWithNameKeyPair(
michael@0 1283 PKIX_PL_X500Name *name,
michael@0 1284 PKIX_PL_PublicKey *pubKey,
michael@0 1285 PKIX_PL_CertNameConstraints *nameConstraints,
michael@0 1286 PKIX_TrustAnchor **pAnchor,
michael@0 1287 void *plContext);
michael@0 1288
michael@0 1289 /*
michael@0 1290 * FUNCTION: PKIX_TrustAnchor_GetTrustedCert
michael@0 1291 * DESCRIPTION:
michael@0 1292 *
michael@0 1293 * Retrieves a pointer to the Cert that is set in the TrustAnchor pointed to
michael@0 1294 * by "anchor" and stores it at "pCert". If "anchor" does not have a Cert
michael@0 1295 * set, this function stores NULL at "pCert".
michael@0 1296 *
michael@0 1297 * PARAMETERS:
michael@0 1298 * "anchor"
michael@0 1299 * Address of TrustAnchor whose Cert is to be stored. Must be non-NULL.
michael@0 1300 * "pChain"
michael@0 1301 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1302 * "plContext"
michael@0 1303 * Platform-specific context pointer.
michael@0 1304 * THREAD SAFETY:
michael@0 1305 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1306 * RETURNS:
michael@0 1307 * Returns NULL if the function succeeds.
michael@0 1308 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1309 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1310 */
michael@0 1311 PKIX_Error *
michael@0 1312 PKIX_TrustAnchor_GetTrustedCert(
michael@0 1313 PKIX_TrustAnchor *anchor,
michael@0 1314 PKIX_PL_Cert **pCert,
michael@0 1315 void *plContext);
michael@0 1316
michael@0 1317 /*
michael@0 1318 * FUNCTION: PKIX_TrustAnchor_GetCAName
michael@0 1319 * DESCRIPTION:
michael@0 1320 *
michael@0 1321 * Retrieves a pointer to the CA's X500Name (if any) that is set in the
michael@0 1322 * TrustAnchor pointed to by "anchor" and stores it at "pCAName". If "anchor"
michael@0 1323 * does not have an X500Name set, this function stores NULL at "pCAName".
michael@0 1324 *
michael@0 1325 * PARAMETERS:
michael@0 1326 * "anchor"
michael@0 1327 * Address of TrustAnchor whose CA Name is to be stored. Must be non-NULL.
michael@0 1328 * "pCAName"
michael@0 1329 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1330 * "plContext"
michael@0 1331 * Platform-specific context pointer.
michael@0 1332 * THREAD SAFETY:
michael@0 1333 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1334 * RETURNS:
michael@0 1335 * Returns NULL if the function succeeds.
michael@0 1336 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1337 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1338 */
michael@0 1339 PKIX_Error *
michael@0 1340 PKIX_TrustAnchor_GetCAName(
michael@0 1341 PKIX_TrustAnchor *anchor,
michael@0 1342 PKIX_PL_X500Name **pCAName,
michael@0 1343 void *plContext);
michael@0 1344
michael@0 1345 /*
michael@0 1346 * FUNCTION: PKIX_TrustAnchor_GetCAPublicKey
michael@0 1347 * DESCRIPTION:
michael@0 1348 *
michael@0 1349 * Retrieves a pointer to the CA's PublicKey (if any) that is set in the
michael@0 1350 * TrustAnchor pointed to by "anchor" and stores it at "pPubKey". If "anchor"
michael@0 1351 * does not have a PublicKey set, this function stores NULL at "pPubKey".
michael@0 1352 *
michael@0 1353 * PARAMETERS:
michael@0 1354 * "anchor"
michael@0 1355 * Address of TrustAnchor whose CA PublicKey is to be stored.
michael@0 1356 * Must be non-NULL.
michael@0 1357 * "pPubKey"
michael@0 1358 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1359 * "plContext"
michael@0 1360 * Platform-specific context pointer.
michael@0 1361 * THREAD SAFETY:
michael@0 1362 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1363 * RETURNS:
michael@0 1364 * Returns NULL if the function succeeds.
michael@0 1365 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1366 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1367 */
michael@0 1368 PKIX_Error *
michael@0 1369 PKIX_TrustAnchor_GetCAPublicKey(
michael@0 1370 PKIX_TrustAnchor *anchor,
michael@0 1371 PKIX_PL_PublicKey **pPubKey,
michael@0 1372 void *plContext);
michael@0 1373
michael@0 1374 /*
michael@0 1375 * FUNCTION: PKIX_TrustAnchor_GetNameConstraints
michael@0 1376 * DESCRIPTION:
michael@0 1377 *
michael@0 1378 * Retrieves a pointer to the CertNameConstraints (if any) set in the
michael@0 1379 * TrustAnchor pointed to by "anchor" and stores it at "pConstraints". If
michael@0 1380 * "anchor" does not have any CertNameConstraints set, this function stores
michael@0 1381 * NULL at "pConstraints".
michael@0 1382 *
michael@0 1383 * PARAMETERS:
michael@0 1384 * "anchor"
michael@0 1385 * Address of TrustAnchor whose CertNameConstraints are to be stored.
michael@0 1386 * Must be non-NULL.
michael@0 1387 * "pConstraints"
michael@0 1388 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1389 * "plContext"
michael@0 1390 * Platform-specific context pointer.
michael@0 1391 * THREAD SAFETY:
michael@0 1392 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1393 * RETURNS:
michael@0 1394 * Returns NULL if the function succeeds.
michael@0 1395 * Returns a Params Error if the function fails in a non-fatal way.
michael@0 1396 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1397 */
michael@0 1398 PKIX_Error *
michael@0 1399 PKIX_TrustAnchor_GetNameConstraints(
michael@0 1400 PKIX_TrustAnchor *anchor,
michael@0 1401 PKIX_PL_CertNameConstraints **pNameConstraints,
michael@0 1402 void *plContext);
michael@0 1403
michael@0 1404 /* PKIX_ResourceLimits
michael@0 1405 *
michael@0 1406 * A PKIX_ResourceLimits object represents the maximum resource usage that
michael@0 1407 * the caller desires. The ValidateChain or BuildChain call
michael@0 1408 * will not exceed these maximum limits. For example, the caller may want
michael@0 1409 * a timeout value of 1 minute, meaning that if the ValidateChain or
michael@0 1410 * BuildChain function is unable to finish in 1 minute, it should abort
michael@0 1411 * with an Error.
michael@0 1412 */
michael@0 1413
michael@0 1414 /*
michael@0 1415 * FUNCTION: PKIX_ResourceLimits_Create
michael@0 1416 * DESCRIPTION:
michael@0 1417 *
michael@0 1418 * Creates a new ResourceLimits object and stores it at "pResourceLimits".
michael@0 1419 *
michael@0 1420 * PARAMETERS:
michael@0 1421 * "pResourceLimits"
michael@0 1422 * Address where object pointer will be stored. Must be non-NULL.
michael@0 1423 * "plContext"
michael@0 1424 * Platform-specific context pointer.
michael@0 1425 * THREAD SAFETY:
michael@0 1426 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
michael@0 1427 * RETURNS:
michael@0 1428 * Returns NULL if the function succeeds.
michael@0 1429 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1430 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1431 */
michael@0 1432 PKIX_Error *
michael@0 1433 PKIX_ResourceLimits_Create(
michael@0 1434 PKIX_ResourceLimits **pResourceLimits,
michael@0 1435 void *plContext);
michael@0 1436
michael@0 1437 /*
michael@0 1438 * FUNCTION: PKIX_ResourceLimits_GetMaxTime
michael@0 1439 * DESCRIPTION:
michael@0 1440 *
michael@0 1441 * Retrieves a PKIX_UInt32 (if any) representing the maximum time that is
michael@0 1442 * set in the ResourceLimits object pointed to by "resourceLimits" and stores
michael@0 1443 * it at "pMaxTime". This maximum time (in seconds) should not be exceeded
michael@0 1444 * by the function whose ProcessingParams contain this ResourceLimits object
michael@0 1445 * (typically ValidateChain or BuildChain). It essentially functions as a
michael@0 1446 * time-out value and is only appropriate if blocking I/O is being used.
michael@0 1447 *
michael@0 1448 * PARAMETERS:
michael@0 1449 * "resourceLimits"
michael@0 1450 * Address of ResourceLimits object whose maximum time (in seconds) is
michael@0 1451 * to be stored. Must be non-NULL.
michael@0 1452 * "pMaxTime"
michael@0 1453 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
michael@0 1454 * "plContext"
michael@0 1455 * Platform-specific context pointer.
michael@0 1456 * THREAD SAFETY:
michael@0 1457 * Conditionally Thread Safe
michael@0 1458 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1459 * RETURNS:
michael@0 1460 * Returns NULL if the function succeeds.
michael@0 1461 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1462 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1463 */
michael@0 1464 PKIX_Error *
michael@0 1465 PKIX_ResourceLimits_GetMaxTime(
michael@0 1466 PKIX_ResourceLimits *resourceLimits,
michael@0 1467 PKIX_UInt32 *pMaxTime,
michael@0 1468 void *plContext);
michael@0 1469
michael@0 1470 /*
michael@0 1471 * FUNCTION: PKIX_ResourceLimits_SetMaxTime
michael@0 1472 * DESCRIPTION:
michael@0 1473 *
michael@0 1474 * Sets the maximum time of the ResourceLimits object pointed to by
michael@0 1475 * "resourceLimits" using the PKIX_UInt32 value of "maxTime". This
michael@0 1476 * maximum time (in seconds) should not be exceeded by the function
michael@0 1477 * whose ProcessingParams contain this ResourceLimits object
michael@0 1478 * (typically ValidateChain or BuildChain). It essentially functions as a
michael@0 1479 * time-out value and is only appropriate if blocking I/O is being used.
michael@0 1480 *
michael@0 1481 * PARAMETERS:
michael@0 1482 * "resourceLimits"
michael@0 1483 * Address of ResourceLimits object whose maximum time (in seconds) is
michael@0 1484 * to be set. Must be non-NULL.
michael@0 1485 * "maxTime"
michael@0 1486 * Value of PKIX_UInt32 representing the maximum time (in seconds)
michael@0 1487 * "plContext"
michael@0 1488 * Platform-specific context pointer.
michael@0 1489 * THREAD SAFETY:
michael@0 1490 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1491 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1492 * RETURNS:
michael@0 1493 * Returns NULL if the function succeeds.
michael@0 1494 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1495 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1496 */
michael@0 1497 PKIX_Error *
michael@0 1498 PKIX_ResourceLimits_SetMaxTime(
michael@0 1499 PKIX_ResourceLimits *resourceLimits,
michael@0 1500 PKIX_UInt32 maxTime,
michael@0 1501 void *plContext);
michael@0 1502
michael@0 1503 /*
michael@0 1504 * FUNCTION: PKIX_ResourceLimits_GetMaxFanout
michael@0 1505 * DESCRIPTION:
michael@0 1506 *
michael@0 1507 * Retrieves a PKIX_UInt32 (if any) representing the maximum fanout that is
michael@0 1508 * set in the ResourceLimits object pointed to by "resourceLimits" and stores
michael@0 1509 * it at "pMaxFanout". This maximum fanout (number of certs) should not be
michael@0 1510 * exceeded by the function whose ProcessingParams contain this ResourceLimits
michael@0 1511 * object (typically ValidateChain or BuildChain). If the builder encounters
michael@0 1512 * more than this maximum number of certificates when searching for the next
michael@0 1513 * candidate certificate, it should abort and return an error. This
michael@0 1514 * parameter is only relevant for ValidateChain if it needs to internally call
michael@0 1515 * BuildChain (e.g. in order to build the chain to a CRL's issuer).
michael@0 1516 *
michael@0 1517 * PARAMETERS:
michael@0 1518 * "resourceLimits"
michael@0 1519 * Address of ResourceLimits object whose maximum fanout (number of certs)
michael@0 1520 * is to be stored. Must be non-NULL.
michael@0 1521 * "pMaxFanout"
michael@0 1522 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
michael@0 1523 * "plContext"
michael@0 1524 * Platform-specific context pointer.
michael@0 1525 * THREAD SAFETY:
michael@0 1526 * Conditionally Thread Safe
michael@0 1527 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1528 * RETURNS:
michael@0 1529 * Returns NULL if the function succeeds.
michael@0 1530 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1531 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1532 */
michael@0 1533 PKIX_Error *
michael@0 1534 PKIX_ResourceLimits_GetMaxFanout(
michael@0 1535 PKIX_ResourceLimits *resourceLimits,
michael@0 1536 PKIX_UInt32 *pMaxFanout,
michael@0 1537 void *plContext);
michael@0 1538
michael@0 1539 /*
michael@0 1540 * FUNCTION: PKIX_ResourceLimits_SetMaxFanout
michael@0 1541 * DESCRIPTION:
michael@0 1542 *
michael@0 1543 * Sets the maximum fanout of the ResourceLimits object pointed to by
michael@0 1544 * "resourceLimits" using the PKIX_UInt32 value of "maxFanout". This maximum
michael@0 1545 * fanout (number of certs) should not be exceeded by the function whose
michael@0 1546 * ProcessingParams contain this ResourceLimits object (typically ValidateChain
michael@0 1547 * or BuildChain). If the builder encounters more than this maximum number of
michael@0 1548 * certificates when searching for the next candidate certificate, it should
michael@0 1549 * abort and return an Error. This parameter is only relevant for ValidateChain
michael@0 1550 * if it needs to internally call BuildChain (e.g. in order to build the
michael@0 1551 * chain to a CRL's issuer).
michael@0 1552 *
michael@0 1553 * PARAMETERS:
michael@0 1554 * "resourceLimits"
michael@0 1555 * Address of ResourceLimits object whose maximum fanout (number of certs)
michael@0 1556 * is to be set. Must be non-NULL.
michael@0 1557 * "maxFanout"
michael@0 1558 * Value of PKIX_UInt32 representing the maximum fanout (number of certs)
michael@0 1559 * "plContext"
michael@0 1560 * Platform-specific context pointer.
michael@0 1561 * THREAD SAFETY:
michael@0 1562 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1563 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1564 * RETURNS:
michael@0 1565 * Returns NULL if the function succeeds.
michael@0 1566 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1567 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1568 */
michael@0 1569 PKIX_Error *
michael@0 1570 PKIX_ResourceLimits_SetMaxFanout(
michael@0 1571 PKIX_ResourceLimits *resourceLimits,
michael@0 1572 PKIX_UInt32 maxFanout,
michael@0 1573 void *plContext);
michael@0 1574
michael@0 1575 /*
michael@0 1576 * FUNCTION: PKIX_ResourceLimits_GetMaxDepth
michael@0 1577 * DESCRIPTION:
michael@0 1578 *
michael@0 1579 * Retrieves a PKIX_UInt32 (if any) representing the maximum depth that is
michael@0 1580 * set in the ResourceLimits object pointed to by "resourceLimits" and stores
michael@0 1581 * it at "pMaxDepth". This maximum depth (number of certs) should not be
michael@0 1582 * exceeded by the function whose ProcessingParams contain this ResourceLimits
michael@0 1583 * object (typically ValidateChain or BuildChain). If the builder encounters
michael@0 1584 * more than this maximum number of certificates when searching for the next
michael@0 1585 * candidate certificate, it should abort and return an error. This
michael@0 1586 * parameter is only relevant for ValidateChain if it needs to internally call
michael@0 1587 * BuildChain (e.g. in order to build the chain to a CRL's issuer).
michael@0 1588 *
michael@0 1589 * PARAMETERS:
michael@0 1590 * "resourceLimits"
michael@0 1591 * Address of ResourceLimits object whose maximum depth (number of certs)
michael@0 1592 * is to be stored. Must be non-NULL.
michael@0 1593 * "pMaxDepth"
michael@0 1594 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
michael@0 1595 * "plContext"
michael@0 1596 * Platform-specific context pointer.
michael@0 1597 * THREAD SAFETY:
michael@0 1598 * Conditionally Thread Safe
michael@0 1599 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1600 * RETURNS:
michael@0 1601 * Returns NULL if the function succeeds.
michael@0 1602 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1603 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1604 */
michael@0 1605 PKIX_Error *
michael@0 1606 PKIX_ResourceLimits_GetMaxDepth(
michael@0 1607 PKIX_ResourceLimits *resourceLimits,
michael@0 1608 PKIX_UInt32 *pMaxDepth,
michael@0 1609 void *plContext);
michael@0 1610
michael@0 1611 /*
michael@0 1612 * FUNCTION: PKIX_ResourceLimits_SetMaxDepth
michael@0 1613 * DESCRIPTION:
michael@0 1614 *
michael@0 1615 * Sets the maximum depth of the ResourceLimits object pointed to by
michael@0 1616 * "resourceLimits" using the PKIX_UInt32 value of "maxDepth". This maximum
michael@0 1617 * depth (number of certs) should not be exceeded by the function whose
michael@0 1618 * ProcessingParams contain this ResourceLimits object (typically ValidateChain
michael@0 1619 * or BuildChain). If the builder encounters more than this maximum number of
michael@0 1620 * certificates when searching for the next candidate certificate, it should
michael@0 1621 * abort and return an Error. This parameter is only relevant for ValidateChain
michael@0 1622 * if it needs to internally call BuildChain (e.g. in order to build the
michael@0 1623 * chain to a CRL's issuer).
michael@0 1624 *
michael@0 1625 * PARAMETERS:
michael@0 1626 * "resourceLimits"
michael@0 1627 * Address of ResourceLimits object whose maximum depth (number of certs)
michael@0 1628 * is to be set. Must be non-NULL.
michael@0 1629 * "maxDepth"
michael@0 1630 * Value of PKIX_UInt32 representing the maximum depth (number of certs)
michael@0 1631 * "plContext"
michael@0 1632 * Platform-specific context pointer.
michael@0 1633 * THREAD SAFETY:
michael@0 1634 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1635 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1636 * RETURNS:
michael@0 1637 * Returns NULL if the function succeeds.
michael@0 1638 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1639 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1640 */
michael@0 1641 PKIX_Error *
michael@0 1642 PKIX_ResourceLimits_SetMaxDepth(
michael@0 1643 PKIX_ResourceLimits *resourceLimits,
michael@0 1644 PKIX_UInt32 maxDepth,
michael@0 1645 void *plContext);
michael@0 1646
michael@0 1647 /*
michael@0 1648 * FUNCTION: PKIX_ResourceLimits_GetMaxNumberOfCerts
michael@0 1649 * DESCRIPTION:
michael@0 1650 *
michael@0 1651 * Retrieves a PKIX_UInt32 (if any) representing the maximum number of traversed
michael@0 1652 * certs that is set in the ResourceLimits object pointed to by "resourceLimits"
michael@0 1653 * and stores it at "pMaxNumber". This maximum number of traversed certs should
michael@0 1654 * not be exceeded by the function whose ProcessingParams contain this ResourceLimits
michael@0 1655 * object (typically ValidateChain or BuildChain). If the builder traverses more
michael@0 1656 * than this number of certs during the build process, it should abort and
michael@0 1657 * return an Error. This parameter is only relevant for ValidateChain if it
michael@0 1658 * needs to internally call BuildChain (e.g. in order to build the chain to a
michael@0 1659 * CRL's issuer).
michael@0 1660 *
michael@0 1661 * PARAMETERS:
michael@0 1662 * "resourceLimits"
michael@0 1663 * Address of ResourceLimits object whose maximum number of traversed certs
michael@0 1664 * is to be stored. Must be non-NULL.
michael@0 1665 * "pMaxNumber"
michael@0 1666 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
michael@0 1667 * "plContext"
michael@0 1668 * Platform-specific context pointer.
michael@0 1669 * THREAD SAFETY:
michael@0 1670 * Conditionally Thread Safe
michael@0 1671 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1672 * RETURNS:
michael@0 1673 * Returns NULL if the function succeeds.
michael@0 1674 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1675 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1676 */
michael@0 1677 PKIX_Error *
michael@0 1678 PKIX_ResourceLimits_GetMaxNumberOfCerts(
michael@0 1679 PKIX_ResourceLimits *resourceLimits,
michael@0 1680 PKIX_UInt32 *pMaxNumber,
michael@0 1681 void *plContext);
michael@0 1682
michael@0 1683 /*
michael@0 1684 * FUNCTION: PKIX_ResourceLimits_SetMaxNumberOfCerts
michael@0 1685 * DESCRIPTION:
michael@0 1686 *
michael@0 1687 * Sets the maximum number of traversed certs of the ResourceLimits object
michael@0 1688 * pointed to by "resourceLimits" using the PKIX_UInt32 value of "maxNumber".
michael@0 1689 * This maximum number of traversed certs should not be exceeded by the function
michael@0 1690 * whose ProcessingParams contain this ResourceLimits object (typically ValidateChain
michael@0 1691 * or BuildChain). If the builder traverses more than this number of certs
michael@0 1692 * during the build process, it should abort and return an Error. This parameter
michael@0 1693 * is only relevant for ValidateChain if it needs to internally call BuildChain
michael@0 1694 * (e.g. in order to build the chain to a CRL's issuer).
michael@0 1695 *
michael@0 1696 * PARAMETERS:
michael@0 1697 * "resourceLimits"
michael@0 1698 * Address of ResourceLimits object whose maximum number of traversed certs
michael@0 1699 * is to be set. Must be non-NULL.
michael@0 1700 * "maxNumber"
michael@0 1701 * Value of PKIX_UInt32 representing the maximum number of traversed certs
michael@0 1702 * "plContext"
michael@0 1703 * Platform-specific context pointer.
michael@0 1704 * THREAD SAFETY:
michael@0 1705 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1706 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1707 * RETURNS:
michael@0 1708 * Returns NULL if the function succeeds.
michael@0 1709 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1710 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1711 */
michael@0 1712 PKIX_Error *
michael@0 1713 PKIX_ResourceLimits_SetMaxNumberOfCerts(
michael@0 1714 PKIX_ResourceLimits *resourceLimits,
michael@0 1715 PKIX_UInt32 maxNumber,
michael@0 1716 void *plContext);
michael@0 1717
michael@0 1718 /*
michael@0 1719 * FUNCTION: PKIX_ResourceLimits_GetMaxNumberOfCRLs
michael@0 1720 * DESCRIPTION:
michael@0 1721 *
michael@0 1722 * Retrieves a PKIX_UInt32 (if any) representing the maximum number of traversed
michael@0 1723 * CRLs that is set in the ResourceLimits object pointed to by "resourceLimits"
michael@0 1724 * and stores it at "pMaxNumber". This maximum number of traversed CRLs should
michael@0 1725 * not be exceeded by the function whose ProcessingParams contain this ResourceLimits
michael@0 1726 * object (typically ValidateChain or BuildChain). If the builder traverses more
michael@0 1727 * than this number of CRLs during the build process, it should abort and
michael@0 1728 * return an Error. This parameter is only relevant for ValidateChain if it
michael@0 1729 * needs to internally call BuildChain (e.g. in order to build the chain to a
michael@0 1730 * CRL's issuer).
michael@0 1731 *
michael@0 1732 * PARAMETERS:
michael@0 1733 * "resourceLimits"
michael@0 1734 * Address of ResourceLimits object whose maximum number of traversed CRLs
michael@0 1735 * is to be stored. Must be non-NULL.
michael@0 1736 * "pMaxNumber"
michael@0 1737 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
michael@0 1738 * "plContext"
michael@0 1739 * Platform-specific context pointer.
michael@0 1740 * THREAD SAFETY:
michael@0 1741 * Conditionally Thread Safe
michael@0 1742 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1743 * RETURNS:
michael@0 1744 * Returns NULL if the function succeeds.
michael@0 1745 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1746 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1747 */
michael@0 1748 PKIX_Error *
michael@0 1749 PKIX_ResourceLimits_GetMaxNumberOfCRLs(
michael@0 1750 PKIX_ResourceLimits *resourceLimits,
michael@0 1751 PKIX_UInt32 *pMaxNumber,
michael@0 1752 void *plContext);
michael@0 1753
michael@0 1754 /*
michael@0 1755 * FUNCTION: PKIX_ResourceLimits_SetMaxNumberOfCRLs
michael@0 1756 * DESCRIPTION:
michael@0 1757 *
michael@0 1758 * Sets the maximum number of traversed CRLs of the ResourceLimits object
michael@0 1759 * pointed to by "resourceLimits" using the PKIX_UInt32 value of "maxNumber".
michael@0 1760 * This maximum number of traversed CRLs should not be exceeded by the function
michael@0 1761 * whose ProcessingParams contain this ResourceLimits object (typically ValidateChain
michael@0 1762 * or BuildChain). If the builder traverses more than this number of CRLs
michael@0 1763 * during the build process, it should abort and return an Error. This parameter
michael@0 1764 * is only relevant for ValidateChain if it needs to internally call BuildChain
michael@0 1765 * (e.g. in order to build the chain to a CRL's issuer).
michael@0 1766 *
michael@0 1767 * PARAMETERS:
michael@0 1768 * "resourceLimits"
michael@0 1769 * Address of ResourceLimits object whose maximum number of traversed CRLs
michael@0 1770 * is to be set. Must be non-NULL.
michael@0 1771 * "maxNumber"
michael@0 1772 * Value of PKIX_UInt32 representing the maximum number of traversed CRLs
michael@0 1773 * "plContext"
michael@0 1774 * Platform-specific context pointer.
michael@0 1775 * THREAD SAFETY:
michael@0 1776 * Not Thread Safe - assumes exclusive access to "params"
michael@0 1777 * (see Thread Safety Definitions in Programmer's Guide)
michael@0 1778 * RETURNS:
michael@0 1779 * Returns NULL if the function succeeds.
michael@0 1780 * Returns a ResourceLimits Error if the function fails in a non-fatal way.
michael@0 1781 * Returns a Fatal Error if the function fails in an unrecoverable way.
michael@0 1782 */
michael@0 1783 PKIX_Error *
michael@0 1784 PKIX_ResourceLimits_SetMaxNumberOfCRLs(
michael@0 1785 PKIX_ResourceLimits *resourceLimits,
michael@0 1786 PKIX_UInt32 maxNumber,
michael@0 1787 void *plContext);
michael@0 1788
michael@0 1789 #ifdef __cplusplus
michael@0 1790 }
michael@0 1791 #endif
michael@0 1792
michael@0 1793 #endif /* _PKIX_PARAMS_H */

mercurial