pkix_pl_ocspresponse.h (2798B)
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_pl_ocspresponse.h 6 * 7 * OcspResponse Object Definitions 8 * 9 */ 10 11 #ifndef _PKIX_PL_OCSPRESPONSE_H 12 #define _PKIX_PL_OCSPRESPONSE_H 13 14 #include "pkix_pl_common.h" 15 #include "pkix_pl_ocspcertid.h" 16 #include "hasht.h" 17 #include "cryptohi.h" 18 #include "ocspti.h" 19 #include "ocspi.h" 20 #include "plbase64.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 #define MAX_OCSP_RESPONSE_LEN (64*1024) 27 28 struct PKIX_PL_OcspResponseStruct{ 29 PLArenaPool *arena; 30 const PKIX_PL_OcspRequest *request; 31 const SEC_HttpClientFcn *httpClient; 32 SEC_HTTP_SERVER_SESSION serverSession; 33 SEC_HTTP_REQUEST_SESSION sessionRequest; 34 PKIX_PL_VerifyCallback verifyFcn; 35 SECItem *encodedResponse; 36 CERTCertDBHandle *handle; 37 PRTime producedAt; 38 PKIX_PL_Date *producedAtDate; 39 PKIX_PL_Cert *pkixSignerCert; 40 CERTOCSPResponse *nssOCSPResponse; 41 CERTCertificate *signerCert; 42 }; 43 44 /* see source file for function documentation */ 45 46 PKIX_Error *pkix_pl_OcspResponse_RegisterSelf(void *plContext); 47 48 PKIX_Error * 49 pkix_pl_OcspResponse_Create( 50 PKIX_PL_OcspRequest *request, 51 const char *httpMechanism, 52 void *responder, 53 PKIX_PL_VerifyCallback verifyFcn, 54 void **pNBIOContext, 55 PKIX_PL_OcspResponse **pResponse, 56 void *plContext); 57 58 PKIX_Error * 59 pkix_pl_OcspResponse_Decode( 60 PKIX_PL_OcspResponse *response, 61 PKIX_Boolean *passed, 62 SECErrorCodes *pReturnCode, 63 void *plContext); 64 65 PKIX_Error * 66 pkix_pl_OcspResponse_GetStatus( 67 PKIX_PL_OcspResponse *response, 68 PKIX_Boolean *passed, 69 SECErrorCodes *pReturnCode, 70 void *plContext); 71 72 PKIX_Error * 73 pkix_pl_OcspResponse_VerifySignature( 74 PKIX_PL_OcspResponse *response, 75 PKIX_PL_Cert *cert, 76 PKIX_ProcessingParams *procParams, 77 PKIX_Boolean *pPassed, 78 void **pNBIOContext, 79 void *plContext); 80 81 PKIX_Error * 82 pkix_pl_OcspResponse_GetStatusForCert( 83 PKIX_PL_OcspCertID *cid, 84 PKIX_PL_OcspResponse *response, 85 PKIX_Boolean allowCachingOfFailures, 86 PKIX_PL_Date *validity, 87 PKIX_Boolean *pPassed, 88 SECErrorCodes *pReturnCode, 89 void *plContext); 90 91 PKIX_Error * 92 PKIX_PL_OcspResponse_UseBuildChain( 93 PKIX_PL_Cert *signerCert, 94 PKIX_PL_Date *producedAt, 95 PKIX_ProcessingParams *procParams, 96 void **pNBIOContext, 97 void **pState, 98 PKIX_BuildResult **pBuildResult, 99 PKIX_VerifyNode **pVerifyTree, 100 void *plContext); 101 102 #ifdef __cplusplus 103 } 104 #endif 105 106 #endif /* _PKIX_PL_OCSPRESPONSE_H */