Thu, 22 Jan 2015 13:21:57 +0100
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_CertSelector and the |
michael@0 | 6 | * PKIX_ComCertSelParams types. |
michael@0 | 7 | * |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | #ifndef _PKIX_CERTSEL_H |
michael@0 | 11 | #define _PKIX_CERTSEL_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_CertSelector |
michael@0 | 45 | * |
michael@0 | 46 | * PKIX_CertSelectors provide a standard way for the caller to select |
michael@0 | 47 | * certificates based on particular criteria. A CertSelector is typically used |
michael@0 | 48 | * by the caller to specify the constraints they wish to impose on the target |
michael@0 | 49 | * certificate in a chain. (see pkix_params.h) A CertSelector is also often |
michael@0 | 50 | * used to retrieve certificates from a CertStore that match the selector's |
michael@0 | 51 | * criteria. (See pkix_certstore.h) For example, the caller may wish to only |
michael@0 | 52 | * select those certificates that have a particular Subject Distinguished Name |
michael@0 | 53 | * and a particular value for a private certificate extension. The |
michael@0 | 54 | * MatchCallback allows the caller to specify the custom matching logic to be |
michael@0 | 55 | * used by a CertSelector. |
michael@0 | 56 | * |
michael@0 | 57 | * By default, the MatchCallback is set to point to the default implementation |
michael@0 | 58 | * provided by libpkix, which understands how to process the most common |
michael@0 | 59 | * parameters. If the default implementation is used, the caller should set |
michael@0 | 60 | * these common parameters using PKIX_CertSelector_SetCommonCertSelectorParams. |
michael@0 | 61 | * Any common parameter that is not set is assumed to be disabled, which means |
michael@0 | 62 | * the default MatchCallback implementation will select all certificates |
michael@0 | 63 | * without regard to that particular disabled parameter. For example, if the |
michael@0 | 64 | * SerialNumber parameter is not set, MatchCallback will not filter out any |
michael@0 | 65 | * certificate based on its serial number. As such, if no parameters are set, |
michael@0 | 66 | * all are disabled and any certificate will match. If a parameter is |
michael@0 | 67 | * disabled, its associated PKIX_ComCertSelParams_Get* function returns a |
michael@0 | 68 | * default value of NULL, or -1 for PKIX_ComCertSelParams_GetBasicConstraints |
michael@0 | 69 | * and PKIX_ComCertSelParams_GetVersion, or 0 for |
michael@0 | 70 | * PKIX_ComCertSelParams_GetKeyUsage. |
michael@0 | 71 | * |
michael@0 | 72 | * If a custom implementation is desired, the default implementation can be |
michael@0 | 73 | * overridden by calling PKIX_CertSelector_SetMatchCallback. In this case, the |
michael@0 | 74 | * CertSelector can be initialized with a certSelectorContext, which is where |
michael@0 | 75 | * the caller can specify the desired parameters the caller wishes to match |
michael@0 | 76 | * against. Note that this certSelectorContext must be an Object (although any |
michael@0 | 77 | * object type), allowing it to be reference-counted and allowing it to |
michael@0 | 78 | * provide the standard Object functions (Equals, Hashcode, ToString, Compare, |
michael@0 | 79 | * Duplicate). |
michael@0 | 80 | * |
michael@0 | 81 | */ |
michael@0 | 82 | |
michael@0 | 83 | /* |
michael@0 | 84 | * FUNCTION: PKIX_CertSelector_MatchCallback |
michael@0 | 85 | * DESCRIPTION: |
michael@0 | 86 | * |
michael@0 | 87 | * This callback function determines whether the specified Cert pointed to by |
michael@0 | 88 | * "cert" matches the criteria of the CertSelector pointed to by "selector". |
michael@0 | 89 | * If the Cert does not matches the CertSelector's criteria, an exception will |
michael@0 | 90 | * be thrown. |
michael@0 | 91 | * |
michael@0 | 92 | * PARAMETERS: |
michael@0 | 93 | * "selector" |
michael@0 | 94 | * Address of CertSelector whose MatchCallback logic and parameters are |
michael@0 | 95 | * to be used. Must be non-NULL. |
michael@0 | 96 | * "cert" |
michael@0 | 97 | * Address of Cert that is to be matched using "selector". |
michael@0 | 98 | * Must be non-NULL. |
michael@0 | 99 | * "plContext" |
michael@0 | 100 | * Platform-specific context pointer. |
michael@0 | 101 | * THREAD SAFETY: |
michael@0 | 102 | * Thread Safe |
michael@0 | 103 | * |
michael@0 | 104 | * Multiple threads must be able to safely call this function without |
michael@0 | 105 | * worrying about conflicts, even if they're operating on the same object. |
michael@0 | 106 | * RETURNS: |
michael@0 | 107 | * Returns NULL if the function succeeds. |
michael@0 | 108 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 109 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 110 | */ |
michael@0 | 111 | typedef PKIX_Error * |
michael@0 | 112 | (*PKIX_CertSelector_MatchCallback)( |
michael@0 | 113 | PKIX_CertSelector *selector, |
michael@0 | 114 | PKIX_PL_Cert *cert, |
michael@0 | 115 | void *plContext); |
michael@0 | 116 | |
michael@0 | 117 | /* |
michael@0 | 118 | * FUNCTION: PKIX_CertSelector_Create |
michael@0 | 119 | * DESCRIPTION: |
michael@0 | 120 | * |
michael@0 | 121 | * Creates a new CertSelector using the Object pointed to by |
michael@0 | 122 | * "certSelectorContext" (if any) and stores it at "pSelector". As noted |
michael@0 | 123 | * above, by default, the MatchCallback is set to point to the default |
michael@0 | 124 | * implementation provided by libpkix, which understands how to process |
michael@0 | 125 | * ComCertSelParams objects. This is overridden if the MatchCallback pointed |
michael@0 | 126 | * to by "callback" is not NULL, in which case the parameters are specified |
michael@0 | 127 | * using the certSelectorContext. |
michael@0 | 128 | * |
michael@0 | 129 | * PARAMETERS: |
michael@0 | 130 | * "callback" |
michael@0 | 131 | * The MatchCallback function to be used. |
michael@0 | 132 | * "certSelectorContext" |
michael@0 | 133 | * Address of Object representing the CertSelector's context (if any). |
michael@0 | 134 | * "pSelector" |
michael@0 | 135 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 136 | * "plContext" |
michael@0 | 137 | * Platform-specific context pointer. |
michael@0 | 138 | * THREAD SAFETY: |
michael@0 | 139 | * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 140 | * RETURNS: |
michael@0 | 141 | * Returns NULL if the function succeeds. |
michael@0 | 142 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 143 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 144 | */ |
michael@0 | 145 | PKIX_Error * |
michael@0 | 146 | PKIX_CertSelector_Create( |
michael@0 | 147 | PKIX_CertSelector_MatchCallback callback, |
michael@0 | 148 | PKIX_PL_Object *certSelectorContext, |
michael@0 | 149 | PKIX_CertSelector **pSelector, |
michael@0 | 150 | void *plContext); |
michael@0 | 151 | |
michael@0 | 152 | /* |
michael@0 | 153 | * FUNCTION: PKIX_CertSelector_GetMatchCallback |
michael@0 | 154 | * DESCRIPTION: |
michael@0 | 155 | * |
michael@0 | 156 | * Retrieves a pointer to "selector's" Match callback function and puts it in |
michael@0 | 157 | * "pCallback". |
michael@0 | 158 | * |
michael@0 | 159 | * PARAMETERS: |
michael@0 | 160 | * "selector" |
michael@0 | 161 | * The CertSelector whose Match callback is desired. Must be non-NULL. |
michael@0 | 162 | * "pCallback" |
michael@0 | 163 | * Address where Match callback function pointer will be stored. |
michael@0 | 164 | * Must be non-NULL. |
michael@0 | 165 | * "plContext" |
michael@0 | 166 | * Platform-specific context pointer. |
michael@0 | 167 | * THREAD SAFETY: |
michael@0 | 168 | * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 169 | * RETURNS: |
michael@0 | 170 | * Returns NULL if the function succeeds. |
michael@0 | 171 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 172 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 173 | */ |
michael@0 | 174 | PKIX_Error * |
michael@0 | 175 | PKIX_CertSelector_GetMatchCallback( |
michael@0 | 176 | PKIX_CertSelector *selector, |
michael@0 | 177 | PKIX_CertSelector_MatchCallback *pCallback, |
michael@0 | 178 | void *plContext); |
michael@0 | 179 | |
michael@0 | 180 | /* |
michael@0 | 181 | * FUNCTION: PKIX_CertSelector_GetCertSelectorContext |
michael@0 | 182 | * DESCRIPTION: |
michael@0 | 183 | * |
michael@0 | 184 | * Retrieves a pointer to a PKIX_PL_Object representing the context (if any) |
michael@0 | 185 | * of the CertSelector pointed to by "selector" and stores it at |
michael@0 | 186 | * "pCertSelectorContext". |
michael@0 | 187 | * |
michael@0 | 188 | * PARAMETERS: |
michael@0 | 189 | * "selector" |
michael@0 | 190 | * Address of CertSelector whose context is to be stored. |
michael@0 | 191 | * Must be non-NULL. |
michael@0 | 192 | * "pCertSelectorContext" |
michael@0 | 193 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 194 | * "plContext" |
michael@0 | 195 | * Platform-specific context pointer. |
michael@0 | 196 | * THREAD SAFETY: |
michael@0 | 197 | * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 198 | * RETURNS: |
michael@0 | 199 | * Returns NULL if the function succeeds. |
michael@0 | 200 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 201 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 202 | */ |
michael@0 | 203 | PKIX_Error * |
michael@0 | 204 | PKIX_CertSelector_GetCertSelectorContext( |
michael@0 | 205 | PKIX_CertSelector *selector, |
michael@0 | 206 | PKIX_PL_Object **pCertSelectorContext, |
michael@0 | 207 | void *plContext); |
michael@0 | 208 | |
michael@0 | 209 | /* |
michael@0 | 210 | * FUNCTION: PKIX_CertSelector_GetCommonCertSelectorParams |
michael@0 | 211 | * DESCRIPTION: |
michael@0 | 212 | * |
michael@0 | 213 | * Retrieves a pointer to the ComCertSelParams object that represent the |
michael@0 | 214 | * common parameters of the CertSelector pointed to by "selector" and stores |
michael@0 | 215 | * it at "pCommonCertSelectorParams". If there are no common parameters |
michael@0 | 216 | * stored with the CertSelector, this function stores NULL at |
michael@0 | 217 | * "pCommonCertSelectorParams". |
michael@0 | 218 | * |
michael@0 | 219 | * PARAMETERS: |
michael@0 | 220 | * "selector" |
michael@0 | 221 | * Address of CertSelector whose ComCertSelParams object is to be stored. |
michael@0 | 222 | * Must be non-NULL. |
michael@0 | 223 | * "pCommonCertSelectorParams" |
michael@0 | 224 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 225 | * "plContext" |
michael@0 | 226 | * Platform-specific context pointer. |
michael@0 | 227 | * THREAD SAFETY: |
michael@0 | 228 | * Conditionally Thread Safe |
michael@0 | 229 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 230 | * RETURNS: |
michael@0 | 231 | * Returns NULL if the function succeeds. |
michael@0 | 232 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 233 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 234 | */ |
michael@0 | 235 | PKIX_Error * |
michael@0 | 236 | PKIX_CertSelector_GetCommonCertSelectorParams( |
michael@0 | 237 | PKIX_CertSelector *selector, |
michael@0 | 238 | PKIX_ComCertSelParams **pCommonCertSelectorParams, |
michael@0 | 239 | void *plContext); |
michael@0 | 240 | |
michael@0 | 241 | /* |
michael@0 | 242 | * FUNCTION: PKIX_CertSelector_SetCommonCertSelectorParams |
michael@0 | 243 | * DESCRIPTION: |
michael@0 | 244 | * |
michael@0 | 245 | * Sets the common parameters for the CertSelector pointed to by "selector" |
michael@0 | 246 | * using the ComCertSelParams object pointed to by "commonCertSelectorParams". |
michael@0 | 247 | * |
michael@0 | 248 | * PARAMETERS: |
michael@0 | 249 | * "selector" |
michael@0 | 250 | * Address of CertSelector whose common parameters are to be set. |
michael@0 | 251 | * Must be non-NULL. |
michael@0 | 252 | * "commonCertSelectorParams" |
michael@0 | 253 | * Address of ComCertSelParams object representing the common parameters. |
michael@0 | 254 | * "plContext" |
michael@0 | 255 | * Platform-specific context pointer. |
michael@0 | 256 | * THREAD SAFETY: |
michael@0 | 257 | * Not Thread Safe - assumes exclusive access to "selector" |
michael@0 | 258 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 259 | * RETURNS: |
michael@0 | 260 | * Returns NULL if the function succeeds. |
michael@0 | 261 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 262 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 263 | */ |
michael@0 | 264 | PKIX_Error * |
michael@0 | 265 | PKIX_CertSelector_SetCommonCertSelectorParams( |
michael@0 | 266 | PKIX_CertSelector *selector, |
michael@0 | 267 | PKIX_ComCertSelParams *commonCertSelectorParams, |
michael@0 | 268 | void *plContext); |
michael@0 | 269 | |
michael@0 | 270 | /* PKIX_ComCertSelParams |
michael@0 | 271 | * |
michael@0 | 272 | * PKIX_ComCertSelParams objects are X.509 parameters commonly used with |
michael@0 | 273 | * CertSelectors, especially when enforcing constraints on a target |
michael@0 | 274 | * certificate or determining which certificates to retrieve from a CertStore. |
michael@0 | 275 | * ComCertSelParams objects are typically used with those CertSelectors that |
michael@0 | 276 | * use the default implementation of MatchCallback, which understands how to |
michael@0 | 277 | * process ComCertSelParams objects. |
michael@0 | 278 | */ |
michael@0 | 279 | |
michael@0 | 280 | /* |
michael@0 | 281 | * FUNCTION: PKIX_ComCertSelParams_Create |
michael@0 | 282 | * DESCRIPTION: |
michael@0 | 283 | * |
michael@0 | 284 | * Creates a new ComCertSelParams object and stores it at "pParams". |
michael@0 | 285 | * |
michael@0 | 286 | * PARAMETERS: |
michael@0 | 287 | * "pParams" |
michael@0 | 288 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 289 | * "plContext" |
michael@0 | 290 | * Platform-specific context pointer. |
michael@0 | 291 | * THREAD SAFETY: |
michael@0 | 292 | * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 293 | * RETURNS: |
michael@0 | 294 | * Returns NULL if the function succeeds. |
michael@0 | 295 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 296 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 297 | */ |
michael@0 | 298 | PKIX_Error * |
michael@0 | 299 | PKIX_ComCertSelParams_Create( |
michael@0 | 300 | PKIX_ComCertSelParams **pParams, |
michael@0 | 301 | void *plContext); |
michael@0 | 302 | |
michael@0 | 303 | /* |
michael@0 | 304 | * FUNCTION: PKIX_ComCertSelParams_GetSubjAltNames |
michael@0 | 305 | * DESCRIPTION: |
michael@0 | 306 | * |
michael@0 | 307 | * Retrieves a pointer to the List of GeneralNames (if any) representing the |
michael@0 | 308 | * subject alternative names criterion that is set in the ComCertSelParams |
michael@0 | 309 | * object pointed to by "params" and stores it at "pNames". In order to match |
michael@0 | 310 | * against this criterion, a certificate must contain all or at least one of |
michael@0 | 311 | * the criterion's subject alternative names (depending on the result of |
michael@0 | 312 | * PKIX_ComCertSelParams_GetMatchAllSubjAltNames). The default behavior |
michael@0 | 313 | * requires a certificate to contain all of the criterion's subject |
michael@0 | 314 | * alternative names in order to match. |
michael@0 | 315 | * |
michael@0 | 316 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 317 | * "pNames", in which case all certificates are considered to match this |
michael@0 | 318 | * criterion. |
michael@0 | 319 | * |
michael@0 | 320 | * Note that the List returned by this function is immutable. |
michael@0 | 321 | * |
michael@0 | 322 | * PARAMETERS: |
michael@0 | 323 | * "params" |
michael@0 | 324 | * Address of ComCertSelParams object whose subject alternative names |
michael@0 | 325 | * criterion (if any) is to be stored. Must be non-NULL. |
michael@0 | 326 | * "pNames" |
michael@0 | 327 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 328 | * "plContext" |
michael@0 | 329 | * Platform-specific context pointer. |
michael@0 | 330 | * THREAD SAFETY: |
michael@0 | 331 | * Conditionally Thread Safe |
michael@0 | 332 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 333 | * RETURNS: |
michael@0 | 334 | * Returns NULL if the function succeeds. |
michael@0 | 335 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 336 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 337 | */ |
michael@0 | 338 | PKIX_Error * |
michael@0 | 339 | PKIX_ComCertSelParams_GetSubjAltNames( |
michael@0 | 340 | PKIX_ComCertSelParams *params, |
michael@0 | 341 | PKIX_List **pNames, /* list of PKIX_PL_GeneralName */ |
michael@0 | 342 | void *plContext); |
michael@0 | 343 | |
michael@0 | 344 | /* |
michael@0 | 345 | * FUNCTION: PKIX_ComCertSelParams_SetSubjAltNames |
michael@0 | 346 | * DESCRIPTION: |
michael@0 | 347 | * |
michael@0 | 348 | * Sets the subject alternative names criterion of the ComCertSelParams object |
michael@0 | 349 | * pointed to by "params" using a List of GeneralNames pointed to by "names". |
michael@0 | 350 | * In order to match against this criterion, a certificate must contain all or |
michael@0 | 351 | * at least one of the criterion's subject alternative names (depending on the |
michael@0 | 352 | * result of PKIX_ComCertSelParams_GetMatchAllSubjAltNames). The default |
michael@0 | 353 | * behavior requires a certificate to contain all of the criterion's subject |
michael@0 | 354 | * alternative names in order to match. |
michael@0 | 355 | * |
michael@0 | 356 | * If "names" is NULL, all certificates are considered to match this |
michael@0 | 357 | * criterion. |
michael@0 | 358 | * |
michael@0 | 359 | * PARAMETERS: |
michael@0 | 360 | * "params" |
michael@0 | 361 | * Address of ComCertSelParams object whose subject alternative |
michael@0 | 362 | * names criterion is to be set. Must be non-NULL. |
michael@0 | 363 | * "names" |
michael@0 | 364 | * Address of List of GeneralNames used to set the criterion |
michael@0 | 365 | * (or NULL to disable the criterion). |
michael@0 | 366 | * "plContext" |
michael@0 | 367 | * Platform-specific context pointer. |
michael@0 | 368 | * THREAD SAFETY: |
michael@0 | 369 | * Not Thread Safe - assumes exclusive access to "params" |
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 CertSelector 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_ComCertSelParams_SetSubjAltNames( |
michael@0 | 378 | PKIX_ComCertSelParams *params, |
michael@0 | 379 | PKIX_List *names, /* list of PKIX_PL_GeneralName */ |
michael@0 | 380 | void *plContext); |
michael@0 | 381 | |
michael@0 | 382 | /* |
michael@0 | 383 | * FUNCTION: PKIX_ComCertSelParams_AddSubjAltName |
michael@0 | 384 | * DESCRIPTION: |
michael@0 | 385 | * |
michael@0 | 386 | * Adds to the subject alternative names criterion of the ComCertSelParams |
michael@0 | 387 | * object pointed to by "params" using the GeneralName pointed to by "name". |
michael@0 | 388 | * In order to match against this criterion, a certificate must contain all |
michael@0 | 389 | * or at least one of the criterion's subject alternative names (depending on |
michael@0 | 390 | * the result of PKIX_ComCertSelParams_GetMatchAllSubjAltNames). The default |
michael@0 | 391 | * behavior requires a certificate to contain all of the criterion's subject |
michael@0 | 392 | * alternative names in order to match. |
michael@0 | 393 | * |
michael@0 | 394 | * PARAMETERS: |
michael@0 | 395 | * "params" |
michael@0 | 396 | * Address of ComCertSelParams object whose subject alternative names |
michael@0 | 397 | * criterion is to be added to. Must be non-NULL. |
michael@0 | 398 | * "name" |
michael@0 | 399 | * Address of GeneralName to be added. |
michael@0 | 400 | * "plContext" |
michael@0 | 401 | * Platform-specific context pointer. |
michael@0 | 402 | * THREAD SAFETY: |
michael@0 | 403 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 404 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 405 | * RETURNS: |
michael@0 | 406 | * Returns NULL if the function succeeds. |
michael@0 | 407 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 408 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 409 | */ |
michael@0 | 410 | PKIX_Error * |
michael@0 | 411 | PKIX_ComCertSelParams_AddSubjAltName( |
michael@0 | 412 | PKIX_ComCertSelParams *params, |
michael@0 | 413 | PKIX_PL_GeneralName *name, |
michael@0 | 414 | void *plContext); |
michael@0 | 415 | |
michael@0 | 416 | /* |
michael@0 | 417 | * FUNCTION: PKIX_ComCertSelParams_GetPathToNames |
michael@0 | 418 | * DESCRIPTION: |
michael@0 | 419 | * |
michael@0 | 420 | * Retrieves a pointer to the List of GeneralNames (if any) representing the |
michael@0 | 421 | * path to names criterion that is set in the ComCertSelParams object pointed |
michael@0 | 422 | * to by "params" and stores it at "pNames". In order to match against this |
michael@0 | 423 | * criterion, a certificate must not include name constraints that would |
michael@0 | 424 | * prohibit building a path to the criterion's specified names. |
michael@0 | 425 | * |
michael@0 | 426 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 427 | * "pNames", in which case all certificates are considered to match this |
michael@0 | 428 | * criterion. |
michael@0 | 429 | * |
michael@0 | 430 | * Note that the List returned by this function is immutable. |
michael@0 | 431 | * |
michael@0 | 432 | * PARAMETERS: |
michael@0 | 433 | * "params" |
michael@0 | 434 | * Address of ComCertSelParams object whose path to names criterion |
michael@0 | 435 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 436 | * "pNames" |
michael@0 | 437 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 438 | * "plContext" |
michael@0 | 439 | * Platform-specific context pointer. |
michael@0 | 440 | * THREAD SAFETY: |
michael@0 | 441 | * Conditionally Thread Safe |
michael@0 | 442 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 443 | * RETURNS: |
michael@0 | 444 | * Returns NULL if the function succeeds. |
michael@0 | 445 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 446 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 447 | */ |
michael@0 | 448 | PKIX_Error * |
michael@0 | 449 | PKIX_ComCertSelParams_GetPathToNames( |
michael@0 | 450 | PKIX_ComCertSelParams *params, |
michael@0 | 451 | PKIX_List **pNames, /* list of PKIX_PL_GeneralName */ |
michael@0 | 452 | void *plContext); |
michael@0 | 453 | |
michael@0 | 454 | /* |
michael@0 | 455 | * FUNCTION: PKIX_ComCertSelParams_SetPathToNames |
michael@0 | 456 | * DESCRIPTION: |
michael@0 | 457 | * |
michael@0 | 458 | * Sets the path to names criterion of the ComCertSelParams object pointed to |
michael@0 | 459 | * by "params" using a List of GeneralNames pointed to by "names". In order to |
michael@0 | 460 | * match against this criterion, a certificate must not include name |
michael@0 | 461 | * constraints that would prohibit building a path to the criterion's |
michael@0 | 462 | * specified names. |
michael@0 | 463 | * |
michael@0 | 464 | * If "names" is NULL, all certificates are considered to match this |
michael@0 | 465 | * criterion. |
michael@0 | 466 | * |
michael@0 | 467 | * PARAMETERS: |
michael@0 | 468 | * "params" |
michael@0 | 469 | * Address of ComCertSelParams object whose path to names criterion |
michael@0 | 470 | * is to be set. Must be non-NULL. |
michael@0 | 471 | * "names" |
michael@0 | 472 | * Address of List of GeneralNames used to set the criterion |
michael@0 | 473 | * (or NULL to disable the criterion). |
michael@0 | 474 | * "plContext" |
michael@0 | 475 | * Platform-specific context pointer. |
michael@0 | 476 | * THREAD SAFETY: |
michael@0 | 477 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 478 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 479 | * RETURNS: |
michael@0 | 480 | * Returns NULL if the function succeeds. |
michael@0 | 481 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 482 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 483 | */ |
michael@0 | 484 | PKIX_Error * |
michael@0 | 485 | PKIX_ComCertSelParams_SetPathToNames( |
michael@0 | 486 | PKIX_ComCertSelParams *params, |
michael@0 | 487 | PKIX_List *names, /* list of PKIX_PL_GeneralName */ |
michael@0 | 488 | void *plContext); |
michael@0 | 489 | |
michael@0 | 490 | /* |
michael@0 | 491 | * FUNCTION: PKIX_ComCertSelParams_AddPathToName |
michael@0 | 492 | * DESCRIPTION: |
michael@0 | 493 | * |
michael@0 | 494 | * Adds to the path to names criterion of the ComCertSelParams object pointed |
michael@0 | 495 | * to by "params" using the GeneralName pointed to by "pathToName". In order |
michael@0 | 496 | * to match against this criterion, a certificate must not include name |
michael@0 | 497 | * constraints that would prohibit building a path to the criterion's |
michael@0 | 498 | * specified names. |
michael@0 | 499 | * |
michael@0 | 500 | * PARAMETERS: |
michael@0 | 501 | * "params" |
michael@0 | 502 | * Address of ComCertSelParams object whose path to names criterion is to |
michael@0 | 503 | * be added to. Must be non-NULL. |
michael@0 | 504 | * "pathToName" |
michael@0 | 505 | * Address of GeneralName to be added. |
michael@0 | 506 | * "plContext" |
michael@0 | 507 | * Platform-specific context pointer. |
michael@0 | 508 | * THREAD SAFETY: |
michael@0 | 509 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 510 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 511 | * RETURNS: |
michael@0 | 512 | * Returns NULL if the function succeeds. |
michael@0 | 513 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 514 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 515 | */ |
michael@0 | 516 | PKIX_Error * |
michael@0 | 517 | PKIX_ComCertSelParams_AddPathToName( |
michael@0 | 518 | PKIX_ComCertSelParams *params, |
michael@0 | 519 | PKIX_PL_GeneralName *pathToName, |
michael@0 | 520 | void *plContext); |
michael@0 | 521 | |
michael@0 | 522 | /* |
michael@0 | 523 | * FUNCTION: PKIX_ComCertSelParams_GetAuthorityKeyIdentifier |
michael@0 | 524 | * DESCRIPTION: |
michael@0 | 525 | * |
michael@0 | 526 | * Retrieves a pointer to the ByteArray (if any) representing the authority |
michael@0 | 527 | * key identifier criterion that is set in the ComCertSelParams object |
michael@0 | 528 | * pointed to by "params" and stores it at "pAuthKeyId". In order to match |
michael@0 | 529 | * against this criterion, a certificate must contain an |
michael@0 | 530 | * AuthorityKeyIdentifier extension whose value matches the criterion's |
michael@0 | 531 | * authority key identifier value. |
michael@0 | 532 | * |
michael@0 | 533 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 534 | * "pAuthKeyId", in which case all certificates are considered to match this |
michael@0 | 535 | * criterion. |
michael@0 | 536 | * |
michael@0 | 537 | * PARAMETERS: |
michael@0 | 538 | * "params" |
michael@0 | 539 | * Address of ComCertSelParams object whose authority key identifier |
michael@0 | 540 | * criterion (if any) is to be stored. Must be non-NULL. |
michael@0 | 541 | * "pAuthKeyId" |
michael@0 | 542 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 543 | * "plContext" |
michael@0 | 544 | * Platform-specific context pointer. |
michael@0 | 545 | * THREAD SAFETY: |
michael@0 | 546 | * Conditionally Thread Safe |
michael@0 | 547 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 548 | * RETURNS: |
michael@0 | 549 | * Returns NULL if the function succeeds. |
michael@0 | 550 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 551 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 552 | */ |
michael@0 | 553 | PKIX_Error * |
michael@0 | 554 | PKIX_ComCertSelParams_GetAuthorityKeyIdentifier( |
michael@0 | 555 | PKIX_ComCertSelParams *params, |
michael@0 | 556 | PKIX_PL_ByteArray **pAuthKeyId, |
michael@0 | 557 | void *plContext); |
michael@0 | 558 | |
michael@0 | 559 | /* |
michael@0 | 560 | * FUNCTION: PKIX_ComCertSelParams_SetAuthorityKeyIdentifier |
michael@0 | 561 | * DESCRIPTION: |
michael@0 | 562 | * |
michael@0 | 563 | * Sets the authority key identifier criterion of the ComCertSelParams object |
michael@0 | 564 | * pointed to by "params" to the ByteArray pointed to by "authKeyId". In |
michael@0 | 565 | * order to match against this criterion, a certificate must contain an |
michael@0 | 566 | * AuthorityKeyIdentifier extension whose value matches the criterion's |
michael@0 | 567 | * authority key identifier value. |
michael@0 | 568 | * |
michael@0 | 569 | * PARAMETERS: |
michael@0 | 570 | * "params" |
michael@0 | 571 | * Address of ComCertSelParams object whose authority key identifier |
michael@0 | 572 | * criterion is to be set. Must be non-NULL. |
michael@0 | 573 | * "authKeyId" |
michael@0 | 574 | * Address of ByteArray used to set the criterion |
michael@0 | 575 | * "plContext" |
michael@0 | 576 | * Platform-specific context pointer. |
michael@0 | 577 | * THREAD SAFETY: |
michael@0 | 578 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 579 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 580 | * RETURNS: |
michael@0 | 581 | * Returns NULL if the function succeeds. |
michael@0 | 582 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 583 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 584 | */ |
michael@0 | 585 | PKIX_Error * |
michael@0 | 586 | PKIX_ComCertSelParams_SetAuthorityKeyIdentifier( |
michael@0 | 587 | PKIX_ComCertSelParams *params, |
michael@0 | 588 | PKIX_PL_ByteArray *authKeyId, |
michael@0 | 589 | void *plContext); |
michael@0 | 590 | |
michael@0 | 591 | /* |
michael@0 | 592 | * FUNCTION: PKIX_ComCertSelParams_GetSubjKeyIdentifier |
michael@0 | 593 | * DESCRIPTION: |
michael@0 | 594 | * |
michael@0 | 595 | * Retrieves a pointer to the ByteArray (if any) representing the subject key |
michael@0 | 596 | * identifier criterion that is set in the ComCertSelParams object pointed to |
michael@0 | 597 | * by "params" and stores it at "pSubjKeyId". In order to match against this |
michael@0 | 598 | * criterion, a certificate must contain a SubjectKeyIdentifier extension |
michael@0 | 599 | * whose value matches the criterion's subject key identifier value. |
michael@0 | 600 | * |
michael@0 | 601 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 602 | * "pSubjKeyId", in which case all certificates are considered to match this |
michael@0 | 603 | * criterion. |
michael@0 | 604 | * |
michael@0 | 605 | * PARAMETERS: |
michael@0 | 606 | * "params" |
michael@0 | 607 | * Address of ComCertSelParams object whose subject key identifier |
michael@0 | 608 | * criterion (if any) is to be stored. Must be non-NULL. |
michael@0 | 609 | * "pSubjKeyId" |
michael@0 | 610 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 611 | * "plContext" |
michael@0 | 612 | * Platform-specific context pointer. |
michael@0 | 613 | * THREAD SAFETY: |
michael@0 | 614 | * Conditionally Thread Safe |
michael@0 | 615 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 616 | * RETURNS: |
michael@0 | 617 | * Returns NULL if the function succeeds. |
michael@0 | 618 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 619 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 620 | */ |
michael@0 | 621 | PKIX_Error * |
michael@0 | 622 | PKIX_ComCertSelParams_GetSubjKeyIdentifier( |
michael@0 | 623 | PKIX_ComCertSelParams *params, |
michael@0 | 624 | PKIX_PL_ByteArray **pSubjKeyId, |
michael@0 | 625 | void *plContext); |
michael@0 | 626 | |
michael@0 | 627 | /* |
michael@0 | 628 | * FUNCTION: PKIX_ComCertSelParams_SetSubjKeyIdentifier |
michael@0 | 629 | * DESCRIPTION: |
michael@0 | 630 | * |
michael@0 | 631 | * Sets the subject key identifier criterion of the ComCertSelParams object |
michael@0 | 632 | * pointed to by "params" using a ByteArray pointed to by "subjKeyId". In |
michael@0 | 633 | * order to match against this criterion, a certificate must contain an |
michael@0 | 634 | * SubjectKeyIdentifier extension whose value matches the criterion's subject |
michael@0 | 635 | * key identifier value. |
michael@0 | 636 | * |
michael@0 | 637 | * PARAMETERS: |
michael@0 | 638 | * "params" |
michael@0 | 639 | * Address of ComCertSelParams object whose subject key identifier |
michael@0 | 640 | * criterion is to be set. Must be non-NULL. |
michael@0 | 641 | * "subjKeyId" |
michael@0 | 642 | * Address of ByteArray used to set the criterion |
michael@0 | 643 | * "plContext" |
michael@0 | 644 | * Platform-specific context pointer. |
michael@0 | 645 | * THREAD SAFETY: |
michael@0 | 646 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 647 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 648 | * RETURNS: |
michael@0 | 649 | * Returns NULL if the function succeeds. |
michael@0 | 650 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 651 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 652 | */ |
michael@0 | 653 | PKIX_Error * |
michael@0 | 654 | PKIX_ComCertSelParams_SetSubjKeyIdentifier( |
michael@0 | 655 | PKIX_ComCertSelParams *params, |
michael@0 | 656 | PKIX_PL_ByteArray *subKeyId, |
michael@0 | 657 | void *plContext); |
michael@0 | 658 | |
michael@0 | 659 | /* |
michael@0 | 660 | * FUNCTION: PKIX_ComCertSelParams_GetSubjPubKey |
michael@0 | 661 | * DESCRIPTION: |
michael@0 | 662 | * |
michael@0 | 663 | * Retrieves a pointer to the PublicKey (if any) representing the subject |
michael@0 | 664 | * public key criterion that is set in the ComCertSelParams object pointed to |
michael@0 | 665 | * by "params" and stores it at "pPubKey". In order to match against this |
michael@0 | 666 | * criterion, a certificate must contain a SubjectPublicKey that matches the |
michael@0 | 667 | * criterion's public key. |
michael@0 | 668 | * |
michael@0 | 669 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 670 | * "pPubKey", in which case all certificates are considered to match this |
michael@0 | 671 | * criterion. |
michael@0 | 672 | * |
michael@0 | 673 | * PARAMETERS: |
michael@0 | 674 | * "params" |
michael@0 | 675 | * Address of ComCertSelParams object whose subject public key criterion |
michael@0 | 676 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 677 | * "pPubKey" |
michael@0 | 678 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 679 | * "plContext" |
michael@0 | 680 | * Platform-specific context pointer. |
michael@0 | 681 | * THREAD SAFETY: |
michael@0 | 682 | * Conditionally Thread Safe |
michael@0 | 683 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 684 | * RETURNS: |
michael@0 | 685 | * Returns NULL if the function succeeds. |
michael@0 | 686 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 687 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 688 | */ |
michael@0 | 689 | PKIX_Error * |
michael@0 | 690 | PKIX_ComCertSelParams_GetSubjPubKey( |
michael@0 | 691 | PKIX_ComCertSelParams *params, |
michael@0 | 692 | PKIX_PL_PublicKey **pPubKey, |
michael@0 | 693 | void *plContext); |
michael@0 | 694 | |
michael@0 | 695 | /* |
michael@0 | 696 | * FUNCTION: PKIX_ComCertSelParams_SetSubjPubKey |
michael@0 | 697 | * DESCRIPTION: |
michael@0 | 698 | * |
michael@0 | 699 | * Sets the subject public key criterion of the ComCertSelParams object |
michael@0 | 700 | * pointed to by "params" using a PublicKey pointed to by "pubKey". In order |
michael@0 | 701 | * to match against this criterion, a certificate must contain a |
michael@0 | 702 | * SubjectPublicKey that matches the criterion's public key. |
michael@0 | 703 | * |
michael@0 | 704 | * PARAMETERS: |
michael@0 | 705 | * "params" |
michael@0 | 706 | * Address of ComCertSelParams object whose subject public key |
michael@0 | 707 | * criterion is to be set. Must be non-NULL. |
michael@0 | 708 | * "pubKey" |
michael@0 | 709 | * Address of PublicKey used to set the criterion |
michael@0 | 710 | * "plContext" |
michael@0 | 711 | * Platform-specific context pointer. |
michael@0 | 712 | * THREAD SAFETY: |
michael@0 | 713 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 714 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 715 | * RETURNS: |
michael@0 | 716 | * Returns NULL if the function succeeds. |
michael@0 | 717 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 718 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 719 | */ |
michael@0 | 720 | PKIX_Error * |
michael@0 | 721 | PKIX_ComCertSelParams_SetSubjPubKey( |
michael@0 | 722 | PKIX_ComCertSelParams *params, |
michael@0 | 723 | PKIX_PL_PublicKey *pubKey, |
michael@0 | 724 | void *plContext); |
michael@0 | 725 | |
michael@0 | 726 | /* |
michael@0 | 727 | * FUNCTION: PKIX_ComCertSelParams_GetSubjPKAlgId |
michael@0 | 728 | * DESCRIPTION: |
michael@0 | 729 | * |
michael@0 | 730 | * Retrieves a pointer to the OID (if any) representing the subject public key |
michael@0 | 731 | * algorithm identifier criterion that is set in the ComCertSelParams object |
michael@0 | 732 | * pointed to by "params" and stores it at "pPubKey". In order to match |
michael@0 | 733 | * against this criterion, a certificate must contain a SubjectPublicKey with |
michael@0 | 734 | * an algorithm that matches the criterion's algorithm. |
michael@0 | 735 | * |
michael@0 | 736 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 737 | * "pAlgId", in which case all certificates are considered to match this |
michael@0 | 738 | * criterion. |
michael@0 | 739 | * |
michael@0 | 740 | * PARAMETERS: |
michael@0 | 741 | * "params" |
michael@0 | 742 | * Address of ComCertSelParams object whose subject public key algorithm |
michael@0 | 743 | * identifier (if any) is to be stored. Must be non-NULL. |
michael@0 | 744 | * "pAlgId" |
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 CertSelector 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_ComCertSelParams_GetSubjPKAlgId( |
michael@0 | 758 | PKIX_ComCertSelParams *params, |
michael@0 | 759 | PKIX_PL_OID **pAlgId, |
michael@0 | 760 | void *plContext); |
michael@0 | 761 | |
michael@0 | 762 | /* |
michael@0 | 763 | * FUNCTION: PKIX_ComCertSelParams_SetSubjPKAlgId |
michael@0 | 764 | * DESCRIPTION: |
michael@0 | 765 | * |
michael@0 | 766 | * Sets the subject public key algorithm identifier criterion of the |
michael@0 | 767 | * ComCertSelParams object pointed to by "params" using an OID pointed to by |
michael@0 | 768 | * "algId". In order to match against this criterion, a certificate must |
michael@0 | 769 | * contain a SubjectPublicKey with an algorithm that matches the criterion's |
michael@0 | 770 | * algorithm. |
michael@0 | 771 | * |
michael@0 | 772 | * If "algId" is NULL, all certificates are considered to match this |
michael@0 | 773 | * criterion. |
michael@0 | 774 | * |
michael@0 | 775 | * PARAMETERS: |
michael@0 | 776 | * "params" |
michael@0 | 777 | * Address of ComCertSelParams object whose subject public key |
michael@0 | 778 | * algorithm identifier criterion is to be set. Must be non-NULL. |
michael@0 | 779 | * "algId" |
michael@0 | 780 | * Address of OID used to set criterion |
michael@0 | 781 | * (or NULL to disable the criterion). |
michael@0 | 782 | * "plContext" |
michael@0 | 783 | * Platform-specific context pointer. |
michael@0 | 784 | * THREAD SAFETY: |
michael@0 | 785 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 786 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 787 | * RETURNS: |
michael@0 | 788 | * Returns NULL if the function succeeds. |
michael@0 | 789 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 790 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 791 | */ |
michael@0 | 792 | PKIX_Error * |
michael@0 | 793 | PKIX_ComCertSelParams_SetSubjPKAlgId( |
michael@0 | 794 | PKIX_ComCertSelParams *params, |
michael@0 | 795 | PKIX_PL_OID *algId, |
michael@0 | 796 | void *plContext); |
michael@0 | 797 | |
michael@0 | 798 | /* |
michael@0 | 799 | * FUNCTION: PKIX_ComCertSelParams_GetBasicConstraints |
michael@0 | 800 | * DESCRIPTION: |
michael@0 | 801 | * |
michael@0 | 802 | * Retrieves a pointer to the minimum path length (if any) representing the |
michael@0 | 803 | * basic constraints criterion that is set in the ComCertSelParams object |
michael@0 | 804 | * pointed to by "params" and stores it at "pMinPathLength". In order to |
michael@0 | 805 | * match against this criterion, there are several possibilities. |
michael@0 | 806 | * |
michael@0 | 807 | * 1) If the criterion's minimum path length is greater than or equal to zero, |
michael@0 | 808 | * a certificate must include a BasicConstraints extension with a pathLen of |
michael@0 | 809 | * at least this value. |
michael@0 | 810 | * |
michael@0 | 811 | * 2) If the criterion's minimum path length is -2, a certificate must be an |
michael@0 | 812 | * end-entity certificate. |
michael@0 | 813 | * |
michael@0 | 814 | * 3) If the criterion's minimum path length is -1, no basic constraints check |
michael@0 | 815 | * is done and all certificates are considered to match this criterion. |
michael@0 | 816 | * |
michael@0 | 817 | * The semantics of other values of the criterion's minimum path length are |
michael@0 | 818 | * undefined but may be defined in future versions of the API. |
michael@0 | 819 | * |
michael@0 | 820 | * If "params" does not have this criterion set, this function stores -1 at |
michael@0 | 821 | * "pMinPathLength", in which case all certificates are considered to match |
michael@0 | 822 | * this criterion. |
michael@0 | 823 | * |
michael@0 | 824 | * PARAMETERS: |
michael@0 | 825 | * "params" |
michael@0 | 826 | * Address of ComCertSelParams object whose basic constraints criterion |
michael@0 | 827 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 828 | * "pMinPathLength" |
michael@0 | 829 | * Address where PKIX_Int32 will be stored. Must be non-NULL. |
michael@0 | 830 | * "plContext" |
michael@0 | 831 | * Platform-specific context pointer. |
michael@0 | 832 | * THREAD SAFETY: |
michael@0 | 833 | * Conditionally Thread Safe |
michael@0 | 834 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 835 | * RETURNS: |
michael@0 | 836 | * Returns NULL if the function succeeds. |
michael@0 | 837 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 838 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 839 | */ |
michael@0 | 840 | PKIX_Error * |
michael@0 | 841 | PKIX_ComCertSelParams_GetBasicConstraints( |
michael@0 | 842 | PKIX_ComCertSelParams *params, |
michael@0 | 843 | PKIX_Int32 *pMinPathLength, |
michael@0 | 844 | void *plContext); |
michael@0 | 845 | |
michael@0 | 846 | /* |
michael@0 | 847 | * FUNCTION: PKIX_ComCertSelParams_SetBasicConstraints |
michael@0 | 848 | * DESCRIPTION: |
michael@0 | 849 | * |
michael@0 | 850 | * Sets the basic constraints criterion of the ComCertSelParams object |
michael@0 | 851 | * pointed to by "params" using the integer value of "minPathLength". In |
michael@0 | 852 | * order to match against this criterion, there are several possibilities. |
michael@0 | 853 | * |
michael@0 | 854 | * 1) If the criterion's minimum path length is greater than or equal to zero, |
michael@0 | 855 | * a certificate must include a BasicConstraints extension with a pathLen of |
michael@0 | 856 | * at least this value. |
michael@0 | 857 | * |
michael@0 | 858 | * 2) If the criterion's minimum path length is -2, a certificate must be an |
michael@0 | 859 | * end-entity certificate. |
michael@0 | 860 | * |
michael@0 | 861 | * 3) If the criterion's minimum path length is -1, no basic constraints check |
michael@0 | 862 | * is done and all certificates are considered to match this criterion. |
michael@0 | 863 | * |
michael@0 | 864 | * The semantics of other values of the criterion's minimum path length are |
michael@0 | 865 | * undefined but may be defined in future versions of the API. |
michael@0 | 866 | * |
michael@0 | 867 | * PARAMETERS: |
michael@0 | 868 | * "params" |
michael@0 | 869 | * Address of ComCertSelParams object whose basic constraints |
michael@0 | 870 | * criterion is to be set. Must be non-NULL. |
michael@0 | 871 | * "minPathLength" |
michael@0 | 872 | * Value of PKIX_Int32 used to set the criterion |
michael@0 | 873 | * (or -1 to disable the criterion). |
michael@0 | 874 | * "plContext" |
michael@0 | 875 | * Platform-specific context pointer. |
michael@0 | 876 | * THREAD SAFETY: |
michael@0 | 877 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 878 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 879 | * RETURNS: |
michael@0 | 880 | * Returns NULL if the function succeeds. |
michael@0 | 881 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 882 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 883 | */ |
michael@0 | 884 | PKIX_Error * |
michael@0 | 885 | PKIX_ComCertSelParams_SetBasicConstraints( |
michael@0 | 886 | PKIX_ComCertSelParams *params, |
michael@0 | 887 | PKIX_Int32 minPathLength, |
michael@0 | 888 | void *plContext); |
michael@0 | 889 | |
michael@0 | 890 | /* |
michael@0 | 891 | * FUNCTION: PKIX_ComCertSelParams_GetCertificate |
michael@0 | 892 | * DESCRIPTION: |
michael@0 | 893 | * |
michael@0 | 894 | * Retrieves a pointer to the Cert (if any) representing the certificate |
michael@0 | 895 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 896 | * "params" and stores it at "pCert". In order to match against this |
michael@0 | 897 | * criterion, a certificate must be equal to the criterion's certificate. If |
michael@0 | 898 | * this criterion is specified, it is usually not necessary to specify any |
michael@0 | 899 | * other criteria, since this criterion requires an exact certificate match. |
michael@0 | 900 | * |
michael@0 | 901 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 902 | * "pCert", in which case all certificates are considered to match this |
michael@0 | 903 | * criterion. |
michael@0 | 904 | * |
michael@0 | 905 | * PARAMETERS: |
michael@0 | 906 | * "params" |
michael@0 | 907 | * Address of ComCertSelParams object whose certificate criterion |
michael@0 | 908 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 909 | * "pCert" |
michael@0 | 910 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 911 | * "plContext" |
michael@0 | 912 | * Platform-specific context pointer. |
michael@0 | 913 | * THREAD SAFETY: |
michael@0 | 914 | * Conditionally Thread Safe |
michael@0 | 915 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 916 | * RETURNS: |
michael@0 | 917 | * Returns NULL if the function succeeds. |
michael@0 | 918 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 919 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 920 | */ |
michael@0 | 921 | PKIX_Error * |
michael@0 | 922 | PKIX_ComCertSelParams_GetCertificate( |
michael@0 | 923 | PKIX_ComCertSelParams *params, |
michael@0 | 924 | PKIX_PL_Cert **pCert, |
michael@0 | 925 | void *plContext); |
michael@0 | 926 | |
michael@0 | 927 | /* |
michael@0 | 928 | * FUNCTION: PKIX_ComCertSelParams_SetCertificate |
michael@0 | 929 | * DESCRIPTION: |
michael@0 | 930 | * |
michael@0 | 931 | * Sets the certificate criterion of the ComCertSelParams object pointed to by |
michael@0 | 932 | * "params" using a Cert pointed to by "cert". In order to match against this |
michael@0 | 933 | * criterion, a certificate must be equal to the criterion's certificate. |
michael@0 | 934 | * If this criterion is specified, it is usually not necessary to specify |
michael@0 | 935 | * any other criteria, since this criterion requires an exact certificate |
michael@0 | 936 | * match. |
michael@0 | 937 | * |
michael@0 | 938 | * If "cert" is NULL, all certificates are considered to match this criterion. |
michael@0 | 939 | * |
michael@0 | 940 | * PARAMETERS: |
michael@0 | 941 | * "params" |
michael@0 | 942 | * Address of ComCertSelParams object whose certificate criterion is to be |
michael@0 | 943 | * set. Must be non-NULL. |
michael@0 | 944 | * "cert" |
michael@0 | 945 | * Address of Cert used to set the criterion |
michael@0 | 946 | * (or NULL to disable the criterion). |
michael@0 | 947 | * "plContext" |
michael@0 | 948 | * Platform-specific context pointer. |
michael@0 | 949 | * THREAD SAFETY: |
michael@0 | 950 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 951 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 952 | * RETURNS: |
michael@0 | 953 | * Returns NULL if the function succeeds. |
michael@0 | 954 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 955 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 956 | */ |
michael@0 | 957 | PKIX_Error * |
michael@0 | 958 | PKIX_ComCertSelParams_SetCertificate( |
michael@0 | 959 | PKIX_ComCertSelParams *params, |
michael@0 | 960 | PKIX_PL_Cert *cert, |
michael@0 | 961 | void *plContext); |
michael@0 | 962 | |
michael@0 | 963 | /* |
michael@0 | 964 | * FUNCTION: PKIX_ComCertSelParams_GetCertificateValid |
michael@0 | 965 | * DESCRIPTION: |
michael@0 | 966 | * |
michael@0 | 967 | * Retrieves a pointer to the Date (if any) representing the certificate |
michael@0 | 968 | * validity criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 969 | * "params" and stores it at "pDate". In order to match against this |
michael@0 | 970 | * criterion, a certificate's validity period must include the criterion's |
michael@0 | 971 | * Date. |
michael@0 | 972 | * |
michael@0 | 973 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 974 | * "pDate", in which case all certificates are considered to match this |
michael@0 | 975 | * criterion. |
michael@0 | 976 | * |
michael@0 | 977 | * PARAMETERS: |
michael@0 | 978 | * "params" |
michael@0 | 979 | * Address of ComCertSelParams object whose certificate validity criterion |
michael@0 | 980 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 981 | * "pDate" |
michael@0 | 982 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 983 | * "plContext" |
michael@0 | 984 | * Platform-specific context pointer. |
michael@0 | 985 | * THREAD SAFETY: |
michael@0 | 986 | * Conditionally Thread Safe |
michael@0 | 987 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 988 | * RETURNS: |
michael@0 | 989 | * Returns NULL if the function succeeds. |
michael@0 | 990 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 991 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 992 | */ |
michael@0 | 993 | PKIX_Error * |
michael@0 | 994 | PKIX_ComCertSelParams_GetCertificateValid( |
michael@0 | 995 | PKIX_ComCertSelParams *params, |
michael@0 | 996 | PKIX_PL_Date **pDate, |
michael@0 | 997 | void *plContext); |
michael@0 | 998 | |
michael@0 | 999 | /* |
michael@0 | 1000 | * FUNCTION: PKIX_ComCertSelParams_SetCertificateValid |
michael@0 | 1001 | * DESCRIPTION: |
michael@0 | 1002 | * |
michael@0 | 1003 | * Sets the certificate validity criterion of the ComCertSelParams object |
michael@0 | 1004 | * pointed to by "params" using a Date pointed to by "date". In order to |
michael@0 | 1005 | * match against this criterion, a certificate's validity period must include |
michael@0 | 1006 | * the criterion's Date. |
michael@0 | 1007 | * |
michael@0 | 1008 | * If "date" is NULL, all certificates are considered to match this criterion. |
michael@0 | 1009 | * |
michael@0 | 1010 | * PARAMETERS: |
michael@0 | 1011 | * "params" |
michael@0 | 1012 | * Address of ComCertSelParams object whose certificate validity criterion |
michael@0 | 1013 | * is to be set. Must be non-NULL. |
michael@0 | 1014 | * "date" |
michael@0 | 1015 | * Address of Date used to set the criterion |
michael@0 | 1016 | * (or NULL to disable the criterion). |
michael@0 | 1017 | * "plContext" |
michael@0 | 1018 | * Platform-specific context pointer. |
michael@0 | 1019 | * THREAD SAFETY: |
michael@0 | 1020 | * Not Thread Safe - assumes exclusive access to "params" |
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 CertSelector 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_ComCertSelParams_SetCertificateValid( |
michael@0 | 1029 | PKIX_ComCertSelParams *params, |
michael@0 | 1030 | PKIX_PL_Date *date, |
michael@0 | 1031 | void *plContext); |
michael@0 | 1032 | |
michael@0 | 1033 | /* |
michael@0 | 1034 | * FUNCTION: PKIX_ComCertSelParams_GetSerialNumber |
michael@0 | 1035 | * DESCRIPTION: |
michael@0 | 1036 | * |
michael@0 | 1037 | * Retrieves a pointer to the BigInt (if any) representing the serial number |
michael@0 | 1038 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 1039 | * "params" and stores it at "pSerialNumber". In order to match against this |
michael@0 | 1040 | * criterion, a certificate must have a serial number equal to the |
michael@0 | 1041 | * criterion's serial number. |
michael@0 | 1042 | * |
michael@0 | 1043 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1044 | * "pSerialNumber", in which case all certificates are considered to match |
michael@0 | 1045 | * this criterion. |
michael@0 | 1046 | * |
michael@0 | 1047 | * PARAMETERS: |
michael@0 | 1048 | * "params" |
michael@0 | 1049 | * Address of ComCertSelParams object whose serial number criterion |
michael@0 | 1050 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 1051 | * "pSerialNumber" |
michael@0 | 1052 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1053 | * "plContext" |
michael@0 | 1054 | * Platform-specific context pointer. |
michael@0 | 1055 | * THREAD SAFETY: |
michael@0 | 1056 | * Conditionally Thread Safe |
michael@0 | 1057 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1058 | * RETURNS: |
michael@0 | 1059 | * Returns NULL if the function succeeds. |
michael@0 | 1060 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1061 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1062 | */ |
michael@0 | 1063 | PKIX_Error * |
michael@0 | 1064 | PKIX_ComCertSelParams_GetSerialNumber( |
michael@0 | 1065 | PKIX_ComCertSelParams *params, |
michael@0 | 1066 | PKIX_PL_BigInt **pSerialNumber, |
michael@0 | 1067 | void *plContext); |
michael@0 | 1068 | |
michael@0 | 1069 | /* |
michael@0 | 1070 | * FUNCTION: PKIX_ComCertSelParams_SetSerialNumber |
michael@0 | 1071 | * DESCRIPTION: |
michael@0 | 1072 | * |
michael@0 | 1073 | * Sets the serial number criterion of the ComCertSelParams object pointed to |
michael@0 | 1074 | * by "params" using a BigInt pointed to by "serialNumber". In order to match |
michael@0 | 1075 | * against this criterion, a certificate must have a serial number equal to |
michael@0 | 1076 | * the criterion's serial number. |
michael@0 | 1077 | * |
michael@0 | 1078 | * If "serialNumber" is NULL, all certificates are considered to match this |
michael@0 | 1079 | * criterion. |
michael@0 | 1080 | * |
michael@0 | 1081 | * PARAMETERS: |
michael@0 | 1082 | * "params" |
michael@0 | 1083 | * Address of ComCertSelParams object whose serial number criterion is to |
michael@0 | 1084 | * be set. Must be non-NULL. |
michael@0 | 1085 | * "serialNumber" |
michael@0 | 1086 | * Address of BigInt used to set the criterion |
michael@0 | 1087 | * (or NULL to disable the criterion). |
michael@0 | 1088 | * "plContext" |
michael@0 | 1089 | * Platform-specific context pointer. |
michael@0 | 1090 | * THREAD SAFETY: |
michael@0 | 1091 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1092 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1093 | * RETURNS: |
michael@0 | 1094 | * Returns NULL if the function succeeds. |
michael@0 | 1095 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1096 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1097 | */ |
michael@0 | 1098 | PKIX_Error * |
michael@0 | 1099 | PKIX_ComCertSelParams_SetSerialNumber( |
michael@0 | 1100 | PKIX_ComCertSelParams *params, |
michael@0 | 1101 | PKIX_PL_BigInt *serialNumber, |
michael@0 | 1102 | void *plContext); |
michael@0 | 1103 | |
michael@0 | 1104 | /* |
michael@0 | 1105 | * FUNCTION: PKIX_ComCertSelParams_GetVersion |
michael@0 | 1106 | * DESCRIPTION: |
michael@0 | 1107 | * |
michael@0 | 1108 | * Retrieves a PKIX_UInt32 (if any) representing the version criterion that is |
michael@0 | 1109 | * set in the ComCertSelParams object pointed to by "params" and stores it at |
michael@0 | 1110 | * "pVersion". In order to match against this criterion, a certificate's |
michael@0 | 1111 | * version must be equal to the criterion's version. |
michael@0 | 1112 | * |
michael@0 | 1113 | * The version number will either be 0, 1, or 2 (corresponding to |
michael@0 | 1114 | * v1, v2, or v3, respectively). |
michael@0 | 1115 | * |
michael@0 | 1116 | * If "params" does not have this criterion set, this function stores |
michael@0 | 1117 | * 0xFFFFFFFF at "pVersion", in which case all certificates are considered |
michael@0 | 1118 | * to match this criterion. |
michael@0 | 1119 | * |
michael@0 | 1120 | * PARAMETERS: |
michael@0 | 1121 | * "params" |
michael@0 | 1122 | * Address of ComCertSelParams object whose version criterion (if any) is |
michael@0 | 1123 | * to be stored. Must be non-NULL. |
michael@0 | 1124 | * "pVersion" |
michael@0 | 1125 | * Address where PKIX_Int32 will be stored. Must be non-NULL. |
michael@0 | 1126 | * "plContext" |
michael@0 | 1127 | * Platform-specific context pointer. |
michael@0 | 1128 | * THREAD SAFETY: |
michael@0 | 1129 | * Conditionally Thread Safe |
michael@0 | 1130 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1131 | * RETURNS: |
michael@0 | 1132 | * Returns NULL if the function succeeds. |
michael@0 | 1133 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1134 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1135 | */ |
michael@0 | 1136 | PKIX_Error * |
michael@0 | 1137 | PKIX_ComCertSelParams_GetVersion( |
michael@0 | 1138 | PKIX_ComCertSelParams *params, |
michael@0 | 1139 | PKIX_UInt32 *pVersion, |
michael@0 | 1140 | void *plContext); |
michael@0 | 1141 | |
michael@0 | 1142 | /* |
michael@0 | 1143 | * FUNCTION: PKIX_ComCertSelParams_SetVersion |
michael@0 | 1144 | * DESCRIPTION: |
michael@0 | 1145 | * |
michael@0 | 1146 | * Sets the version criterion of the ComCertSelParams object pointed to by |
michael@0 | 1147 | * "params" using the integer value of "version". In order to match against |
michael@0 | 1148 | * this criterion, a certificate's version must be equal to the criterion's |
michael@0 | 1149 | * version. If the criterion's version is -1, no version check is done and |
michael@0 | 1150 | * all certificates are considered to match this criterion. |
michael@0 | 1151 | * |
michael@0 | 1152 | * PARAMETERS: |
michael@0 | 1153 | * "params" |
michael@0 | 1154 | * Address of ComCertSelParams object whose version criterion is to be |
michael@0 | 1155 | * set. Must be non-NULL. |
michael@0 | 1156 | * "version" |
michael@0 | 1157 | * Value of PKIX_Int32 used to set the criterion |
michael@0 | 1158 | * (or -1 to disable the criterion). |
michael@0 | 1159 | * "plContext" |
michael@0 | 1160 | * Platform-specific context pointer. |
michael@0 | 1161 | * THREAD SAFETY: |
michael@0 | 1162 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1163 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1164 | * RETURNS: |
michael@0 | 1165 | * Returns NULL if the function succeeds. |
michael@0 | 1166 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1167 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1168 | */ |
michael@0 | 1169 | PKIX_Error * |
michael@0 | 1170 | PKIX_ComCertSelParams_SetVersion( |
michael@0 | 1171 | PKIX_ComCertSelParams *params, |
michael@0 | 1172 | PKIX_Int32 version, |
michael@0 | 1173 | void *plContext); |
michael@0 | 1174 | |
michael@0 | 1175 | |
michael@0 | 1176 | /* |
michael@0 | 1177 | * FUNCTION: PKIX_ComCertSelParams_GetKeyUsage |
michael@0 | 1178 | * DESCRIPTION: |
michael@0 | 1179 | * |
michael@0 | 1180 | * Retrieves a PKIX_UInt32 (if any) representing the key usage criterion that |
michael@0 | 1181 | * is set in the ComCertSelParams object pointed to by "params" and stores it |
michael@0 | 1182 | * at "pKeyUsage". In order to match against this criterion, a certificate |
michael@0 | 1183 | * must allow the criterion's key usage values. Note that a certificate that |
michael@0 | 1184 | * has no KeyUsage extension implicity allows all key usages. Note also that |
michael@0 | 1185 | * this functions supports a maximum of 32 key usage bits. |
michael@0 | 1186 | * |
michael@0 | 1187 | * If "params" does not have this criterion set, this function stores zero at |
michael@0 | 1188 | * "pKeyUsage", in which case all certificates are considered to match this |
michael@0 | 1189 | * criterion. |
michael@0 | 1190 | * |
michael@0 | 1191 | * PARAMETERS: |
michael@0 | 1192 | * "params" |
michael@0 | 1193 | * Address of ComCertSelParams object whose key usage criterion (if any) |
michael@0 | 1194 | * is to be stored. Must be non-NULL. |
michael@0 | 1195 | * "pKeyUsage" |
michael@0 | 1196 | * Address where PKIX_UInt32 will be stored. Must not be non-NULL. |
michael@0 | 1197 | * "plContext" |
michael@0 | 1198 | * Platform-specific context pointer. |
michael@0 | 1199 | * THREAD SAFETY: |
michael@0 | 1200 | * Conditionally Thread Safe |
michael@0 | 1201 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1202 | * RETURNS: |
michael@0 | 1203 | * Returns NULL if the function succeeds. |
michael@0 | 1204 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1205 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1206 | */ |
michael@0 | 1207 | PKIX_Error * |
michael@0 | 1208 | PKIX_ComCertSelParams_GetKeyUsage( |
michael@0 | 1209 | PKIX_ComCertSelParams *params, |
michael@0 | 1210 | PKIX_UInt32 *pKeyUsage, |
michael@0 | 1211 | void *plContext); |
michael@0 | 1212 | |
michael@0 | 1213 | /* |
michael@0 | 1214 | * FUNCTION: PKIX_ComCertSelParams_SetKeyUsage |
michael@0 | 1215 | * DESCRIPTION: |
michael@0 | 1216 | * |
michael@0 | 1217 | * Sets the key usage criterion of the ComCertSelParams object pointed to by |
michael@0 | 1218 | * "params" using the integer value of "keyUsage". In order to match against |
michael@0 | 1219 | * this criterion, a certificate must allow the criterion's key usage values. |
michael@0 | 1220 | * Note that a certificate that has no KeyUsage extension implicity allows |
michael@0 | 1221 | * all key usages. Note also that this functions supports a maximum of 32 key |
michael@0 | 1222 | * usage bits. |
michael@0 | 1223 | * |
michael@0 | 1224 | * If the criterion's key usage value is zero, no key usage check is done and |
michael@0 | 1225 | * all certificates are considered to match this criterion. |
michael@0 | 1226 | * |
michael@0 | 1227 | * PARAMETERS: |
michael@0 | 1228 | * "params" |
michael@0 | 1229 | * Address of ComCertSelParams object whose key usage criterion is to be |
michael@0 | 1230 | * set. Must be non-NULL. |
michael@0 | 1231 | * "keyUsage" |
michael@0 | 1232 | * Value of PKIX_Int32 used to set the criterion |
michael@0 | 1233 | * (or zero to disable the criterion). |
michael@0 | 1234 | * "plContext" |
michael@0 | 1235 | * Platform-specific context pointer. |
michael@0 | 1236 | * THREAD SAFETY: |
michael@0 | 1237 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1238 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1239 | * RETURNS: |
michael@0 | 1240 | * Returns NULL if the function succeeds. |
michael@0 | 1241 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1242 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1243 | */ |
michael@0 | 1244 | PKIX_Error * |
michael@0 | 1245 | PKIX_ComCertSelParams_SetKeyUsage( |
michael@0 | 1246 | PKIX_ComCertSelParams *params, |
michael@0 | 1247 | PKIX_UInt32 keyUsage, |
michael@0 | 1248 | void *plContext); |
michael@0 | 1249 | |
michael@0 | 1250 | /* |
michael@0 | 1251 | * FUNCTION: PKIX_ComCertSelParams_GetExtendedKeyUsage |
michael@0 | 1252 | * DESCRIPTION: |
michael@0 | 1253 | * |
michael@0 | 1254 | * Retrieves a pointer to the List of OIDs (if any) representing the extended |
michael@0 | 1255 | * key usage criterion that is set in the ComCertSelParams object pointed to |
michael@0 | 1256 | * by "params" and stores it at "pExtKeyUsage". In order to match against this |
michael@0 | 1257 | * criterion, a certificate's ExtendedKeyUsage extension must allow the |
michael@0 | 1258 | * criterion's extended key usages. Note that a certificate that has no |
michael@0 | 1259 | * ExtendedKeyUsage extension implicity allows all key purposes. |
michael@0 | 1260 | * |
michael@0 | 1261 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1262 | * "pExtKeyUsage", in which case all certificates are considered to match |
michael@0 | 1263 | * this criterion. |
michael@0 | 1264 | * |
michael@0 | 1265 | * Note that the List returned by this function is immutable. |
michael@0 | 1266 | * |
michael@0 | 1267 | * PARAMETERS: |
michael@0 | 1268 | * "params" |
michael@0 | 1269 | * Address of ComCertSelParams object whose extended key usage criterion |
michael@0 | 1270 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 1271 | * "pExtKeyUsage" |
michael@0 | 1272 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1273 | * "plContext" |
michael@0 | 1274 | * Platform-specific context pointer. |
michael@0 | 1275 | * THREAD SAFETY: |
michael@0 | 1276 | * Conditionally Thread Safe |
michael@0 | 1277 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1278 | * RETURNS: |
michael@0 | 1279 | * Returns NULL if the function succeeds. |
michael@0 | 1280 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1281 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1282 | */ |
michael@0 | 1283 | PKIX_Error * |
michael@0 | 1284 | PKIX_ComCertSelParams_GetExtendedKeyUsage( |
michael@0 | 1285 | PKIX_ComCertSelParams *params, |
michael@0 | 1286 | PKIX_List **pExtKeyUsage, /* list of PKIX_PL_OID */ |
michael@0 | 1287 | void *plContext); |
michael@0 | 1288 | |
michael@0 | 1289 | /* |
michael@0 | 1290 | * FUNCTION: PKIX_ComCertSelParams_SetExtendedKeyUsage |
michael@0 | 1291 | * DESCRIPTION: |
michael@0 | 1292 | * |
michael@0 | 1293 | * Sets the extended key usage criterion of the ComCertSelParams object |
michael@0 | 1294 | * pointed to by "params" using a List of OIDs pointed to by "extKeyUsage". |
michael@0 | 1295 | * In order to match against this criterion, a certificate's ExtendedKeyUsage |
michael@0 | 1296 | * extension must allow the criterion's extended key usages. Note that a |
michael@0 | 1297 | * certificate that has no ExtendedKeyUsage extension implicitly allows all |
michael@0 | 1298 | * key purposes. |
michael@0 | 1299 | * |
michael@0 | 1300 | * If "extKeyUsage" is NULL, all certificates are considered to match this |
michael@0 | 1301 | * criterion. |
michael@0 | 1302 | * |
michael@0 | 1303 | * PARAMETERS: |
michael@0 | 1304 | * "params" |
michael@0 | 1305 | * Address of ComCertSelParams object whose extended key usage criterion |
michael@0 | 1306 | * is to be set. Must be non-NULL. |
michael@0 | 1307 | * "extKeyUsage" |
michael@0 | 1308 | * Address of List of OIDs used to set the criterion |
michael@0 | 1309 | * (or NULL to disable the criterion). |
michael@0 | 1310 | * "plContext" |
michael@0 | 1311 | * Platform-specific context pointer. |
michael@0 | 1312 | * THREAD SAFETY: |
michael@0 | 1313 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1314 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1315 | * RETURNS: |
michael@0 | 1316 | * Returns NULL if the function succeeds. |
michael@0 | 1317 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1318 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1319 | */ |
michael@0 | 1320 | PKIX_Error * |
michael@0 | 1321 | PKIX_ComCertSelParams_SetExtendedKeyUsage( |
michael@0 | 1322 | PKIX_ComCertSelParams *params, |
michael@0 | 1323 | PKIX_List *extKeyUsage, /* list of PKIX_PL_OID */ |
michael@0 | 1324 | void *plContext); |
michael@0 | 1325 | |
michael@0 | 1326 | /* |
michael@0 | 1327 | * FUNCTION: PKIX_ComCertSelParams_GetPolicy |
michael@0 | 1328 | * DESCRIPTION: |
michael@0 | 1329 | * |
michael@0 | 1330 | * Retrieves a pointer to the List of OIDs (if any) representing the policy |
michael@0 | 1331 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 1332 | * "params" and stores it at "pPolicy". In order to match against this |
michael@0 | 1333 | * criterion, a certificate's CertificatePolicies extension must include at |
michael@0 | 1334 | * least one of the criterion's policies. If "params" has this criterion set, |
michael@0 | 1335 | * but the List of OIDs is empty, then a certificate's CertificatePolicies |
michael@0 | 1336 | * extension must include at least some policy. |
michael@0 | 1337 | * |
michael@0 | 1338 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1339 | * "pPolicy", in which case all certificates are considered to match this |
michael@0 | 1340 | * criterion. |
michael@0 | 1341 | * |
michael@0 | 1342 | * Note that the List returned by this function is immutable. |
michael@0 | 1343 | * |
michael@0 | 1344 | * PARAMETERS: |
michael@0 | 1345 | * "params" |
michael@0 | 1346 | * Address of ComCertSelParams object whose policy criterion (if any) is |
michael@0 | 1347 | * to be stored. Must be non-NULL. |
michael@0 | 1348 | * "pPolicy" |
michael@0 | 1349 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1350 | * "plContext" |
michael@0 | 1351 | * Platform-specific context pointer. |
michael@0 | 1352 | * THREAD SAFETY: |
michael@0 | 1353 | * Conditionally Thread Safe |
michael@0 | 1354 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1355 | * RETURNS: |
michael@0 | 1356 | * Returns NULL if the function succeeds. |
michael@0 | 1357 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1358 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1359 | */ |
michael@0 | 1360 | PKIX_Error * |
michael@0 | 1361 | PKIX_ComCertSelParams_GetPolicy( |
michael@0 | 1362 | PKIX_ComCertSelParams *params, |
michael@0 | 1363 | PKIX_List **pPolicy, /* list of PKIX_PL_OID */ |
michael@0 | 1364 | void *plContext); |
michael@0 | 1365 | |
michael@0 | 1366 | /* |
michael@0 | 1367 | * FUNCTION: PKIX_ComCertSelParams_SetPolicy |
michael@0 | 1368 | * DESCRIPTION: |
michael@0 | 1369 | * |
michael@0 | 1370 | * Sets the policy criterion of the ComCertSelParams object pointed to by |
michael@0 | 1371 | * "params" using a List of OIDs pointed to by "policy". In order to match |
michael@0 | 1372 | * against this criterion, a certificate's CertificatePolicies extension must |
michael@0 | 1373 | * include at least one of the criterion's policies. If "params" has this |
michael@0 | 1374 | * criterion set, but the List of OIDs is empty, then a certificate's |
michael@0 | 1375 | * CertificatePolicies extension must include at least some policy. |
michael@0 | 1376 | * |
michael@0 | 1377 | * If "policy" is NULL, all certificates are considered to match this |
michael@0 | 1378 | * criterion. |
michael@0 | 1379 | * |
michael@0 | 1380 | * PARAMETERS: |
michael@0 | 1381 | * "params" |
michael@0 | 1382 | * Address of ComCertSelParams object whose policy criterion is to be set. |
michael@0 | 1383 | * Must be non-NULL. |
michael@0 | 1384 | * "policy" |
michael@0 | 1385 | * Address of List of OIDs used to set the criterion |
michael@0 | 1386 | * (or NULL to disable the criterion). |
michael@0 | 1387 | * "plContext" |
michael@0 | 1388 | * Platform-specific context pointer. |
michael@0 | 1389 | * THREAD SAFETY: |
michael@0 | 1390 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1391 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1392 | * RETURNS: |
michael@0 | 1393 | * Returns NULL if the function succeeds. |
michael@0 | 1394 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1395 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1396 | */ |
michael@0 | 1397 | PKIX_Error * |
michael@0 | 1398 | PKIX_ComCertSelParams_SetPolicy( |
michael@0 | 1399 | PKIX_ComCertSelParams *params, |
michael@0 | 1400 | PKIX_List *policy, /* list of PKIX_PL_OID */ |
michael@0 | 1401 | void *plContext); |
michael@0 | 1402 | |
michael@0 | 1403 | /* |
michael@0 | 1404 | * FUNCTION: PKIX_ComCertSelParams_GetIssuer |
michael@0 | 1405 | * DESCRIPTION: |
michael@0 | 1406 | * |
michael@0 | 1407 | * Retrieves a pointer to the X500Name (if any) representing the issuer |
michael@0 | 1408 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 1409 | * "params" and stores it at "pIssuer". In order to match against this |
michael@0 | 1410 | * criterion, a certificate's IssuerName must match the criterion's issuer |
michael@0 | 1411 | * name. |
michael@0 | 1412 | * |
michael@0 | 1413 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1414 | * "pIssuer", in which case all certificates are considered to match this |
michael@0 | 1415 | * criterion. |
michael@0 | 1416 | * |
michael@0 | 1417 | * PARAMETERS: |
michael@0 | 1418 | * "params" |
michael@0 | 1419 | * Address of ComCertSelParams object whose issuer criterion (if any) is |
michael@0 | 1420 | * to be stored. Must be non-NULL. |
michael@0 | 1421 | * "pIssuer" |
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 | * Conditionally Thread Safe |
michael@0 | 1427 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1428 | * RETURNS: |
michael@0 | 1429 | * Returns NULL if the function succeeds. |
michael@0 | 1430 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1431 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1432 | */ |
michael@0 | 1433 | PKIX_Error * |
michael@0 | 1434 | PKIX_ComCertSelParams_GetIssuer( |
michael@0 | 1435 | PKIX_ComCertSelParams *params, |
michael@0 | 1436 | PKIX_PL_X500Name **pIssuer, |
michael@0 | 1437 | void *plContext); |
michael@0 | 1438 | |
michael@0 | 1439 | /* |
michael@0 | 1440 | * FUNCTION: PKIX_ComCertSelParams_SetIssuer |
michael@0 | 1441 | * DESCRIPTION: |
michael@0 | 1442 | * |
michael@0 | 1443 | * Sets the issuer criterion of the ComCertSelParams object pointed to by |
michael@0 | 1444 | * "params" using an X500Name pointed to by "issuer". In order to match |
michael@0 | 1445 | * against this criterion, a certificate's IssuerName must match the |
michael@0 | 1446 | * criterion's issuer name. |
michael@0 | 1447 | * |
michael@0 | 1448 | * If "issuer" is NULL, all certificates are considered to match this |
michael@0 | 1449 | * criterion. |
michael@0 | 1450 | * |
michael@0 | 1451 | * PARAMETERS: |
michael@0 | 1452 | * "params" |
michael@0 | 1453 | * Address of ComCertSelParams object whose issuer criterion is to be set. |
michael@0 | 1454 | * Must be non-NULL. |
michael@0 | 1455 | * "issuer" |
michael@0 | 1456 | * Address of X500Name used to set the criterion |
michael@0 | 1457 | * (or NULL to disable the criterion). |
michael@0 | 1458 | * "plContext" |
michael@0 | 1459 | * Platform-specific context pointer. |
michael@0 | 1460 | * THREAD SAFETY: |
michael@0 | 1461 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1462 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1463 | * RETURNS: |
michael@0 | 1464 | * Returns NULL if the function succeeds. |
michael@0 | 1465 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1466 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1467 | */ |
michael@0 | 1468 | PKIX_Error * |
michael@0 | 1469 | PKIX_ComCertSelParams_SetIssuer( |
michael@0 | 1470 | PKIX_ComCertSelParams *params, |
michael@0 | 1471 | PKIX_PL_X500Name *issuer, |
michael@0 | 1472 | void *plContext); |
michael@0 | 1473 | |
michael@0 | 1474 | /* |
michael@0 | 1475 | * FUNCTION: PKIX_ComCertSelParams_GetSubject |
michael@0 | 1476 | * DESCRIPTION: |
michael@0 | 1477 | * |
michael@0 | 1478 | * Retrieves a pointer to the X500Name (if any) representing the subject |
michael@0 | 1479 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 1480 | * "params" and stores it at "pSubject". In order to match against this |
michael@0 | 1481 | * criterion, a certificate's SubjectName must match the criterion's subject |
michael@0 | 1482 | * name. |
michael@0 | 1483 | * |
michael@0 | 1484 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1485 | * "pSubject", in which case all certificates are considered to match this |
michael@0 | 1486 | * criterion. |
michael@0 | 1487 | * |
michael@0 | 1488 | * PARAMETERS: |
michael@0 | 1489 | * "params" |
michael@0 | 1490 | * Address of ComCertSelParams object whose subject criterion (if any) is |
michael@0 | 1491 | * to be stored. Must be non-NULL. |
michael@0 | 1492 | * "pSubject" |
michael@0 | 1493 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1494 | * "plContext" |
michael@0 | 1495 | * Platform-specific context pointer. |
michael@0 | 1496 | * THREAD SAFETY: |
michael@0 | 1497 | * Conditionally Thread Safe |
michael@0 | 1498 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1499 | * RETURNS: |
michael@0 | 1500 | * Returns NULL if the function succeeds. |
michael@0 | 1501 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1502 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1503 | */ |
michael@0 | 1504 | PKIX_Error * |
michael@0 | 1505 | PKIX_ComCertSelParams_GetSubject( |
michael@0 | 1506 | PKIX_ComCertSelParams *params, |
michael@0 | 1507 | PKIX_PL_X500Name **pSubject, |
michael@0 | 1508 | void *plContext); |
michael@0 | 1509 | |
michael@0 | 1510 | /* |
michael@0 | 1511 | * FUNCTION: PKIX_ComCertSelParams_SetSubject |
michael@0 | 1512 | * DESCRIPTION: |
michael@0 | 1513 | * |
michael@0 | 1514 | * Sets the subject criterion of the ComCertSelParams object pointed to by |
michael@0 | 1515 | * "params" using an X500Name pointed to by "subject". In order to match |
michael@0 | 1516 | * against this criterion, a certificate's SubjectName must match the |
michael@0 | 1517 | * criterion's subject name. |
michael@0 | 1518 | * |
michael@0 | 1519 | * If "subject" is NULL, all certificates are considered to match this |
michael@0 | 1520 | * criterion. |
michael@0 | 1521 | * |
michael@0 | 1522 | * PARAMETERS: |
michael@0 | 1523 | * "params" |
michael@0 | 1524 | * Address of ComCertSelParams object whose subject criterion is to be |
michael@0 | 1525 | * set. Must be non-NULL. |
michael@0 | 1526 | * "subject" |
michael@0 | 1527 | * Address of X500Name used to set the criterion |
michael@0 | 1528 | * (or NULL to disable the criterion). |
michael@0 | 1529 | * "plContext" |
michael@0 | 1530 | * Platform-specific context pointer. |
michael@0 | 1531 | * THREAD SAFETY: |
michael@0 | 1532 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1533 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1534 | * RETURNS: |
michael@0 | 1535 | * Returns NULL if the function succeeds. |
michael@0 | 1536 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1537 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1538 | */ |
michael@0 | 1539 | PKIX_Error * |
michael@0 | 1540 | PKIX_ComCertSelParams_SetSubject( |
michael@0 | 1541 | PKIX_ComCertSelParams *params, |
michael@0 | 1542 | PKIX_PL_X500Name *subject, |
michael@0 | 1543 | void *plContext); |
michael@0 | 1544 | |
michael@0 | 1545 | /* |
michael@0 | 1546 | * FUNCTION: PKIX_ComCertSelParams_GetSubjectAsByteArray |
michael@0 | 1547 | * DESCRIPTION: |
michael@0 | 1548 | * |
michael@0 | 1549 | * Retrieves a pointer to the ByteArray (if any) representing the subject |
michael@0 | 1550 | * criterion that is set in the ComCertSelParams object pointed to by |
michael@0 | 1551 | * "params" and stores it at "pSubject". In order to match against this |
michael@0 | 1552 | * criterion, a certificate's SubjectName must match the criterion's subject |
michael@0 | 1553 | * name. |
michael@0 | 1554 | * |
michael@0 | 1555 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1556 | * "pSubject", in which case all certificates are considered to match this |
michael@0 | 1557 | * criterion. |
michael@0 | 1558 | * |
michael@0 | 1559 | * PARAMETERS: |
michael@0 | 1560 | * "params" |
michael@0 | 1561 | * Address of ComCertSelParams object whose subject criterion (if any) is |
michael@0 | 1562 | * to be stored. Must be non-NULL. |
michael@0 | 1563 | * "pSubject" |
michael@0 | 1564 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1565 | * "plContext" |
michael@0 | 1566 | * Platform-specific context pointer. |
michael@0 | 1567 | * THREAD SAFETY: |
michael@0 | 1568 | * Conditionally Thread Safe |
michael@0 | 1569 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1570 | * RETURNS: |
michael@0 | 1571 | * Returns NULL if the function succeeds. |
michael@0 | 1572 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1573 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1574 | */ |
michael@0 | 1575 | PKIX_Error * |
michael@0 | 1576 | PKIX_ComCertSelParams_GetSubjectAsByteArray( |
michael@0 | 1577 | PKIX_ComCertSelParams *params, |
michael@0 | 1578 | PKIX_PL_ByteArray **pSubject, |
michael@0 | 1579 | void *plContext); |
michael@0 | 1580 | |
michael@0 | 1581 | /* |
michael@0 | 1582 | * FUNCTION: PKIX_ComCertSelParams_SetSubjectAsByteArray |
michael@0 | 1583 | * DESCRIPTION: |
michael@0 | 1584 | * |
michael@0 | 1585 | * Sets the subject criterion of the ComCertSelParams object pointed to by |
michael@0 | 1586 | * "params" using a ByteArray pointed to by "subject". In order to match |
michael@0 | 1587 | * against this criterion, a certificate's SubjectName must match the |
michael@0 | 1588 | * criterion's subject name. |
michael@0 | 1589 | * |
michael@0 | 1590 | * If "subject" is NULL, all certificates are considered to match this |
michael@0 | 1591 | * criterion. |
michael@0 | 1592 | * |
michael@0 | 1593 | * PARAMETERS: |
michael@0 | 1594 | * "params" |
michael@0 | 1595 | * Address of ComCertSelParams object whose subject criterion is to be |
michael@0 | 1596 | * set. Must be non-NULL. |
michael@0 | 1597 | * "subject" |
michael@0 | 1598 | * Address of ByteArray used to set the criterion |
michael@0 | 1599 | * (or NULL to disable the criterion). |
michael@0 | 1600 | * "plContext" |
michael@0 | 1601 | * Platform-specific context pointer. |
michael@0 | 1602 | * THREAD SAFETY: |
michael@0 | 1603 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1604 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1605 | * RETURNS: |
michael@0 | 1606 | * Returns NULL if the function succeeds. |
michael@0 | 1607 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1608 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1609 | */ |
michael@0 | 1610 | PKIX_Error * |
michael@0 | 1611 | PKIX_ComCertSelParams_SetSubjectAsByteArray( |
michael@0 | 1612 | PKIX_ComCertSelParams *params, |
michael@0 | 1613 | PKIX_PL_ByteArray *subject, |
michael@0 | 1614 | void *plContext); |
michael@0 | 1615 | |
michael@0 | 1616 | /* |
michael@0 | 1617 | * FUNCTION: PKIX_ComCertSelParams_GetNameConstraints |
michael@0 | 1618 | * DESCRIPTION: |
michael@0 | 1619 | * |
michael@0 | 1620 | * Retrieves a pointer to the X500Name (if any) representing the name |
michael@0 | 1621 | * constraints criterion that is set in the ComCertSelParams object pointed |
michael@0 | 1622 | * to by "params" and stores it at "pConstraints". In order to match against |
michael@0 | 1623 | * this criterion, a certificate's subject and subject alternative names must |
michael@0 | 1624 | * be allowed by the criterion's name constraints. |
michael@0 | 1625 | * |
michael@0 | 1626 | * If "params" does not have this criterion set, this function stores NULL at |
michael@0 | 1627 | * "pConstraints", in which case all certificates are considered to match |
michael@0 | 1628 | * this criterion. |
michael@0 | 1629 | * |
michael@0 | 1630 | * PARAMETERS: |
michael@0 | 1631 | * "params" |
michael@0 | 1632 | * Address of ComCertSelParams object whose name constraints criterion |
michael@0 | 1633 | * (if any) is to be stored. Must be non-NULL. |
michael@0 | 1634 | * "pConstraints" |
michael@0 | 1635 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1636 | * "plContext" |
michael@0 | 1637 | * Platform-specific context pointer. |
michael@0 | 1638 | * THREAD SAFETY: |
michael@0 | 1639 | * Conditionally Thread Safe |
michael@0 | 1640 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1641 | * RETURNS: |
michael@0 | 1642 | * Returns NULL if the function succeeds. |
michael@0 | 1643 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1644 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1645 | */ |
michael@0 | 1646 | PKIX_Error * |
michael@0 | 1647 | PKIX_ComCertSelParams_GetNameConstraints( |
michael@0 | 1648 | PKIX_ComCertSelParams *params, |
michael@0 | 1649 | PKIX_PL_CertNameConstraints **pConstraints, |
michael@0 | 1650 | void *plContext); |
michael@0 | 1651 | |
michael@0 | 1652 | /* |
michael@0 | 1653 | * FUNCTION: PKIX_ComCertSelParams_SetNameConstraints |
michael@0 | 1654 | * DESCRIPTION: |
michael@0 | 1655 | * |
michael@0 | 1656 | * Sets the name constraints criterion of the ComCertSelParams object pointed |
michael@0 | 1657 | * to by "params" using the CertNameConstraints pointed to by "constraints". |
michael@0 | 1658 | * In order to match against this criterion, a certificate's subject and |
michael@0 | 1659 | * subject alternative names must be allowed by the criterion's name |
michael@0 | 1660 | * constraints. |
michael@0 | 1661 | * |
michael@0 | 1662 | * If "constraints" is NULL, all certificates are considered to match this |
michael@0 | 1663 | * criterion. |
michael@0 | 1664 | * |
michael@0 | 1665 | * PARAMETERS: |
michael@0 | 1666 | * "params" |
michael@0 | 1667 | * Address of ComCertSelParams object whose name constraints criterion is |
michael@0 | 1668 | * to be set. Must be non-NULL. |
michael@0 | 1669 | * "constraints" |
michael@0 | 1670 | * Address of CertNameConstraints used to set the criterion |
michael@0 | 1671 | * (or NULL to disable the criterion). |
michael@0 | 1672 | * "plContext" |
michael@0 | 1673 | * Platform-specific context pointer. |
michael@0 | 1674 | * THREAD SAFETY: |
michael@0 | 1675 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1676 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1677 | * RETURNS: |
michael@0 | 1678 | * Returns NULL if the function succeeds. |
michael@0 | 1679 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1680 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1681 | */ |
michael@0 | 1682 | PKIX_Error * |
michael@0 | 1683 | PKIX_ComCertSelParams_SetNameConstraints( |
michael@0 | 1684 | PKIX_ComCertSelParams *params, |
michael@0 | 1685 | PKIX_PL_CertNameConstraints *constraints, |
michael@0 | 1686 | void *plContext); |
michael@0 | 1687 | |
michael@0 | 1688 | /* |
michael@0 | 1689 | * FUNCTION: PKIX_ComCertSelParams_GetMatchAllSubjAltNames |
michael@0 | 1690 | * DESCRIPTION: |
michael@0 | 1691 | * |
michael@0 | 1692 | * Checks whether the ComCertSelParams object pointed to by "params" indicate |
michael@0 | 1693 | * that all subject alternative names are to be matched and stores the Boolean |
michael@0 | 1694 | * result at "pMatch". This Boolean value determines the behavior of the |
michael@0 | 1695 | * subject alternative names criterion. |
michael@0 | 1696 | * |
michael@0 | 1697 | * In order to match against the subject alternative names criterion, if the |
michael@0 | 1698 | * Boolean value at "pMatch" is PKIX_TRUE, a certificate must contain all of |
michael@0 | 1699 | * the criterion's subject alternative names. If the Boolean value at |
michael@0 | 1700 | * "pMatch" is PKIX_FALSE, a certificate must contain at least one of the |
michael@0 | 1701 | * criterion's subject alternative names. The default behavior is as if the |
michael@0 | 1702 | * Boolean value at "pMatch" is PKIX_TRUE. |
michael@0 | 1703 | * |
michael@0 | 1704 | * PARAMETERS: |
michael@0 | 1705 | * "params" |
michael@0 | 1706 | * Address of ComCertSelParams object used to determine whether all |
michael@0 | 1707 | * subject alternative names must be matched. Must be non-NULL. |
michael@0 | 1708 | * "pMatch" |
michael@0 | 1709 | * Address where object pointer will be stored. Must be non-NULL. |
michael@0 | 1710 | * "plContext" |
michael@0 | 1711 | * Platform-specific context pointer. |
michael@0 | 1712 | * THREAD SAFETY: |
michael@0 | 1713 | * Conditionally Thread Safe |
michael@0 | 1714 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1715 | * RETURNS: |
michael@0 | 1716 | * Returns NULL if the function succeeds. |
michael@0 | 1717 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1718 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1719 | */ |
michael@0 | 1720 | PKIX_Error * |
michael@0 | 1721 | PKIX_ComCertSelParams_GetMatchAllSubjAltNames( |
michael@0 | 1722 | PKIX_ComCertSelParams *params, |
michael@0 | 1723 | PKIX_Boolean *pMatch, |
michael@0 | 1724 | void *plContext); |
michael@0 | 1725 | |
michael@0 | 1726 | /* |
michael@0 | 1727 | * FUNCTION: PKIX_ComCertSelParams_SetMatchAllSubjAltNames |
michael@0 | 1728 | * DESCRIPTION: |
michael@0 | 1729 | * |
michael@0 | 1730 | * Sets the match flag of the ComCertSelParams object pointed to by "params" |
michael@0 | 1731 | * using the Boolean value of "match". This Boolean value determines the |
michael@0 | 1732 | * behavior of the subject alternative names criterion. |
michael@0 | 1733 | * |
michael@0 | 1734 | * In order to match against the subject alternative names criterion, if the |
michael@0 | 1735 | * "match" is PKIX_TRUE, a certificate must contain all of the criterion's |
michael@0 | 1736 | * subject alternative names. If the "match" is PKIX_FALSE, a certificate |
michael@0 | 1737 | * must contain at least one of the criterion's subject alternative names. |
michael@0 | 1738 | * The default behavior is as if "match" is PKIX_TRUE. |
michael@0 | 1739 | * |
michael@0 | 1740 | * PARAMETERS: |
michael@0 | 1741 | * "params" |
michael@0 | 1742 | * Address of ComCertSelParams object whose match flag is to be set. |
michael@0 | 1743 | * Must be non-NULL. |
michael@0 | 1744 | * "match" |
michael@0 | 1745 | * Boolean value used to set the match flag. |
michael@0 | 1746 | * "plContext" |
michael@0 | 1747 | * Platform-specific context pointer. |
michael@0 | 1748 | * THREAD SAFETY: |
michael@0 | 1749 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1750 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1751 | * RETURNS: |
michael@0 | 1752 | * Returns NULL if the function succeeds. |
michael@0 | 1753 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1754 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1755 | */ |
michael@0 | 1756 | PKIX_Error * |
michael@0 | 1757 | PKIX_ComCertSelParams_SetMatchAllSubjAltNames( |
michael@0 | 1758 | PKIX_ComCertSelParams *params, |
michael@0 | 1759 | PKIX_Boolean match, |
michael@0 | 1760 | void *plContext); |
michael@0 | 1761 | |
michael@0 | 1762 | /* |
michael@0 | 1763 | * FUNCTION: PKIX_ComCertSelParams_GetLeafCertFlag |
michael@0 | 1764 | * DESCRIPTION: |
michael@0 | 1765 | * |
michael@0 | 1766 | * Return "leafCert" flag of the ComCertSelParams structure. If set to true, |
michael@0 | 1767 | * the flag indicates that a selector should filter out all cert that are not |
michael@0 | 1768 | * qualified to be a leaf cert according to the specified key/ekey usages. |
michael@0 | 1769 | * |
michael@0 | 1770 | * PARAMETERS: |
michael@0 | 1771 | * "params" |
michael@0 | 1772 | * Address of ComCertSelParams object used to determine whether all |
michael@0 | 1773 | * subject alternative names must be matched. Must be non-NULL. |
michael@0 | 1774 | * "pLeafFlag" |
michael@0 | 1775 | * Address of returned value. |
michael@0 | 1776 | * "plContext" |
michael@0 | 1777 | * Platform-specific context pointer. |
michael@0 | 1778 | * THREAD SAFETY: |
michael@0 | 1779 | * Conditionally Thread Safe |
michael@0 | 1780 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1781 | * RETURNS: |
michael@0 | 1782 | * Returns NULL if the function succeeds. |
michael@0 | 1783 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1784 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1785 | */ |
michael@0 | 1786 | PKIX_Error* |
michael@0 | 1787 | PKIX_ComCertSelParams_GetLeafCertFlag( |
michael@0 | 1788 | PKIX_ComCertSelParams *params, |
michael@0 | 1789 | PKIX_Boolean *pLeafFlag, |
michael@0 | 1790 | void *plContext); |
michael@0 | 1791 | |
michael@0 | 1792 | /* |
michael@0 | 1793 | * FUNCTION: PKIX_ComCertSelParams_SetLeafCertFlag |
michael@0 | 1794 | * DESCRIPTION: |
michael@0 | 1795 | * |
michael@0 | 1796 | * Sets a flag that if its value is true, indicates that the selector |
michael@0 | 1797 | * should only pick certs that qualifies to be leaf for this cert path |
michael@0 | 1798 | * validation. |
michael@0 | 1799 | * |
michael@0 | 1800 | * PARAMETERS: |
michael@0 | 1801 | * "params" |
michael@0 | 1802 | * Address of ComCertSelParams object whose match flag is to be set. |
michael@0 | 1803 | * Must be non-NULL. |
michael@0 | 1804 | * "leafFlag" |
michael@0 | 1805 | * Boolean value used to set the leaf flag. |
michael@0 | 1806 | * "plContext" |
michael@0 | 1807 | * Platform-specific context pointer. |
michael@0 | 1808 | * THREAD SAFETY: |
michael@0 | 1809 | * Not Thread Safe - assumes exclusive access to "params" |
michael@0 | 1810 | * (see Thread Safety Definitions in Programmer's Guide) |
michael@0 | 1811 | * RETURNS: |
michael@0 | 1812 | * Returns NULL if the function succeeds. |
michael@0 | 1813 | * Returns a CertSelector Error if the function fails in a non-fatal way. |
michael@0 | 1814 | * Returns a Fatal Error if the function fails in an unrecoverable way. |
michael@0 | 1815 | */ |
michael@0 | 1816 | PKIX_Error * |
michael@0 | 1817 | PKIX_ComCertSelParams_SetLeafCertFlag( |
michael@0 | 1818 | PKIX_ComCertSelParams *params, |
michael@0 | 1819 | PKIX_Boolean leafFlag, |
michael@0 | 1820 | void *plContext); |
michael@0 | 1821 | |
michael@0 | 1822 | #ifdef __cplusplus |
michael@0 | 1823 | } |
michael@0 | 1824 | #endif |
michael@0 | 1825 | |
michael@0 | 1826 | #endif /* _PKIX_CERTSEL_H */ |