tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pkix_revocationmethod.h (3083B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 /*
      5 * pkix_revocationmethod.h
      6 *
      7 * RevocationMethod Object
      8 *
      9 */
     10 
     11 #ifndef _PKIX_REVOCATIONMETHOD_H
     12 #define _PKIX_REVOCATIONMETHOD_H
     13 
     14 #include "pkixt.h"
     15 #include "pkix_revocationchecker.h"
     16 
     17 #ifdef __cplusplus
     18 extern "C" {
     19 #endif
     20 
     21 typedef struct pkix_RevocationMethodStruct pkix_RevocationMethod;
     22 
     23 /* Local revocation check function prototype definition.
     24 * Revocation methods capable of checking revocation though local
     25 * means(cache) should implement this prototype. */
     26 typedef PKIX_Error *
     27 pkix_LocalRevocationCheckFn(PKIX_PL_Cert *cert, PKIX_PL_Cert *issuer,
     28                            PKIX_PL_Date *date, 
     29                            pkix_RevocationMethod *checkerObject,
     30                            PKIX_ProcessingParams *procParams,
     31                            PKIX_UInt32 methodFlags,
     32                            PKIX_Boolean chainVerificationState,
     33                            PKIX_RevocationStatus *pRevStatus,
     34                            CERTCRLEntryReasonCode *reasonCode,
     35                            void *plContext);
     36 
     37 /* External revocation check function prototype definition.
     38 * Revocation methods that required external communications(crldp
     39 * ocsp) shoult implement this prototype. */
     40 typedef PKIX_Error *
     41 pkix_ExternalRevocationCheckFn(PKIX_PL_Cert *cert, PKIX_PL_Cert *issuer,
     42                               PKIX_PL_Date *date,
     43                               pkix_RevocationMethod *checkerObject,
     44                               PKIX_ProcessingParams *procParams,
     45                               PKIX_UInt32 methodFlags,
     46                               PKIX_RevocationStatus *pRevStatus,
     47                               CERTCRLEntryReasonCode *reasonCode,
     48                               void **pNBIOContext, void *plContext);
     49 
     50 /* Revocation method structure assosiates revocation types with
     51 * a set of flags on the method, a priority of the method (0
     52 * corresponds to the highest priority), and method local/external
     53 * checker functions. */
     54 struct pkix_RevocationMethodStruct {
     55    PKIX_RevocationMethodType methodType;
     56    PKIX_UInt32 flags;
     57    PKIX_UInt32 priority;
     58    pkix_LocalRevocationCheckFn (*localRevChecker);
     59    pkix_ExternalRevocationCheckFn (*externalRevChecker);
     60 };
     61 
     62 PKIX_Error *
     63 pkix_RevocationMethod_Duplicate(PKIX_PL_Object *object,
     64                                PKIX_PL_Object *newObject,
     65                                void *plContext);
     66 
     67 PKIX_Error *
     68 pkix_RevocationMethod_Init(pkix_RevocationMethod *method,
     69                           PKIX_RevocationMethodType methodType,
     70                           PKIX_UInt32 flags,
     71                           PKIX_UInt32 priority,
     72                           pkix_LocalRevocationCheckFn localRevChecker,
     73                           pkix_ExternalRevocationCheckFn externalRevChecker,
     74                           void *plContext);
     75 
     76 
     77 #ifdef __cplusplus
     78 }
     79 #endif
     80 
     81 #endif /* _PKIX_REVOCATIONMETHOD_H */