ocsp_req_format.h
Go to the documentation of this file.
1 /**
2  * @file ocsp_req_format.h
3  * @brief OCSP request formatting
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _OCSP_REQ_FORMAT_H
32 #define _OCSP_REQ_FORMAT_H
33 
34 //Dependencies
35 #include "ocsp/ocsp_common.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //OCSP related functions
43 error_t ocspFormatRequest(const OcspRequest *request, uint8_t *output,
44  size_t *written);
45 
46 error_t ocspFormatTbsRequest(const OcspTbsRequest *tbsRequest, uint8_t *output,
47  size_t *written);
48 
50  size_t *written);
51 
53  uint_t numRequests, uint8_t *output, size_t *written);
54 
56  uint8_t *output, size_t *written);
57 
58 error_t ocspFormatCertId(const OcspCertId *certId, uint8_t *output,
59  size_t *written);
60 
61 error_t ocspFormatHashAlgo(const OcspCertId *certId, uint8_t *output,
62  size_t *written);
63 
65  uint8_t *output, size_t *written);
66 
68  size_t *written);
69 
70 //C++ guard
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
error_t ocspFormatHashAlgo(const OcspCertId *certId, uint8_t *output, size_t *written)
Format HashAlgorithm structure.
error_t ocspFormatRequestExtensions(const OcspExtensions *extensions, uint8_t *output, size_t *written)
Format RequestExtensions structure.
uint8_t extensions[]
Definition: ntp_common.h:207
OCSP common definitions.
uint8_t version
Definition: coap_common.h:177
error_t ocspFormatSingleRequest(const OcspSingleRequest *singleRequest, uint8_t *output, size_t *written)
Format Request structure.
error_t ocspFormatRequestList(const OcspSingleRequest *requestList, uint_t numRequests, uint8_t *output, size_t *written)
Format RequestList structure.
OCSPRequest structure.
Definition: ocsp_common.h:200
error_t ocspFormatRequest(const OcspRequest *request, uint8_t *output, size_t *written)
Format OCSPRequest structure.
error_t
Error codes.
Definition: error.h:43
OCSP extensions.
Definition: ocsp_common.h:176
TBSRequest structure.
Definition: ocsp_common.h:187
error_t ocspFormatVersion(OcspVersion version, uint8_t *output, size_t *written)
Format Version field.
error_t ocspFormatNonceExtension(const X509OctetString *nonce, uint8_t *output, size_t *written)
Format Nonce extension.
CertID structure.
Definition: ocsp_common.h:142
Octet string.
Definition: x509_common.h:653
unsigned int uint_t
Definition: compiler_port.h:50
SingleRequest structure.
Definition: ocsp_common.h:165
error_t ocspFormatCertId(const OcspCertId *certId, uint8_t *output, size_t *written)
Format CertID structure.
uint8_t nonce[]
Definition: ntp_common.h:233
error_t ocspFormatTbsRequest(const OcspTbsRequest *tbsRequest, uint8_t *output, size_t *written)
Format TBSRequest structure.
OcspVersion
OCSP versions.
Definition: ocsp_common.h:105