1.\" $OpenBSD: d2i_OCSP_REQUEST.3,v 1.3 2021/03/12 05:18:00 jsg Exp $ 2.\" 3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: March 12 2021 $ 18.Dt D2I_OCSP_REQUEST 3 19.Os 20.Sh NAME 21.Nm d2i_OCSP_REQUEST , 22.Nm i2d_OCSP_REQUEST , 23.Nm d2i_OCSP_SIGNATURE , 24.Nm i2d_OCSP_SIGNATURE , 25.Nm d2i_OCSP_REQINFO , 26.Nm i2d_OCSP_REQINFO , 27.Nm d2i_OCSP_ONEREQ , 28.Nm i2d_OCSP_ONEREQ , 29.Nm d2i_OCSP_CERTID , 30.Nm i2d_OCSP_CERTID , 31.Nm d2i_OCSP_SERVICELOC , 32.Nm i2d_OCSP_SERVICELOC 33.Nd decode and encode OCSP requests 34.Sh SYNOPSIS 35.In openssl/ocsp.h 36.Ft OCSP_REQUEST * 37.Fo d2i_OCSP_REQUEST 38.Fa "OCSP_REQUEST **val_out" 39.Fa "const unsigned char **der_in" 40.Fa "long length" 41.Fc 42.Ft int 43.Fo i2d_OCSP_REQUEST 44.Fa "OCSP_REQUEST *val_in" 45.Fa "unsigned char **der_out" 46.Fc 47.Ft OCSP_SIGNATURE * 48.Fo d2i_OCSP_SIGNATURE 49.Fa "OCSP_SIGNATURE **val_out" 50.Fa "const unsigned char **der_in" 51.Fa "long length" 52.Fc 53.Ft int 54.Fo i2d_OCSP_SIGNATURE 55.Fa "OCSP_SIGNATURE *val_in" 56.Fa "unsigned char **der_out" 57.Fc 58.Ft OCSP_REQINFO * 59.Fo d2i_OCSP_REQINFO 60.Fa "OCSP_REQINFO **val_out" 61.Fa "const unsigned char **der_in" 62.Fa "long length" 63.Fc 64.Ft int 65.Fo i2d_OCSP_REQINFO 66.Fa "OCSP_REQINFO *val_in" 67.Fa "unsigned char **der_out" 68.Fc 69.Ft OCSP_ONEREQ * 70.Fo d2i_OCSP_ONEREQ 71.Fa "OCSP_ONEREQ **val_out" 72.Fa "const unsigned char **der_in" 73.Fa "long length" 74.Fc 75.Ft int 76.Fo i2d_OCSP_ONEREQ 77.Fa "OCSP_ONEREQ *val_in" 78.Fa "unsigned char **der_out" 79.Fc 80.Ft OCSP_CERTID * 81.Fo d2i_OCSP_CERTID 82.Fa "OCSP_CERTID **val_out" 83.Fa "const unsigned char **der_in" 84.Fa "long length" 85.Fc 86.Ft int 87.Fo i2d_OCSP_CERTID 88.Fa "OCSP_CERTID *val_in" 89.Fa "unsigned char **der_out" 90.Fc 91.Ft OCSP_SERVICELOC * 92.Fo d2i_OCSP_SERVICELOC 93.Fa "OCSP_SERVICELOC **val_out" 94.Fa "const unsigned char **der_in" 95.Fa "long length" 96.Fc 97.Ft int 98.Fo i2d_OCSP_SERVICELOC 99.Fa "OCSP_SERVICELOC *val_in" 100.Fa "unsigned char **der_out" 101.Fc 102.Sh DESCRIPTION 103These functions decode and encode ASN.1 structures used for OCSP 104requests. 105For details about the semantics, examples, caveats, and bugs, see 106.Xr ASN1_item_d2i 3 . 107.Pp 108.Fn d2i_OCSP_REQUEST 109and 110.Fn i2d_OCSP_REQUEST 111decode and encode an ASN.1 112.Vt OCSPRequest 113structure defined in RFC 6960 section 4.1.1. 114.Pp 115.Fn d2i_OCSP_SIGNATURE 116and 117.Fn i2d_OCSP_SIGNATURE 118decode and encode an ASN.1 119.Vt Signature 120structure defined in RFC 6960 section 4.1.1. 121.Pp 122.Fn d2i_OCSP_REQINFO 123and 124.Fn i2d_OCSP_REQINFO 125decode and encode an ASN.1 126.Vt TBSRequest 127structure defined in RFC 6960 section 4.1.1. 128.Pp 129.Fn d2i_OCSP_ONEREQ 130and 131.Fn i2d_OCSP_ONEREQ 132decode and encode an ASN.1 133.Vt Request 134structure defined in RFC 6960 section 4.1.1. 135.Pp 136.Fn d2i_OCSP_CERTID 137and 138.Fn i2d_OCSP_CERTID 139decode and encode an ASN.1 140.Vt CertID 141structure defined in RFC 6960 section 4.1.1. 142.Pp 143.Fn d2i_OCSP_SERVICELOC 144and 145.Fn i2d_OCSP_SERVICELOC 146decode and encode an ASN.1 147.Vt ServiceLocator 148structure defined in RFC 6960 section 4.4.6. 149.Sh RETURN VALUES 150.Fn d2i_OCSP_REQUEST , 151.Fn d2i_OCSP_SIGNATURE , 152.Fn d2i_OCSP_REQINFO , 153.Fn d2i_OCSP_ONEREQ , 154.Fn d2i_OCSP_CERTID , 155and 156.Fn d2i_OCSP_SERVICELOC 157return an object of the respective type or 158.Dv NULL 159if an error occurs. 160.Pp 161.Fn i2d_OCSP_REQUEST , 162.Fn i2d_OCSP_SIGNATURE , 163.Fn i2d_OCSP_REQINFO , 164.Fn i2d_OCSP_ONEREQ , 165.Fn i2d_OCSP_CERTID , 166and 167.Fn i2d_OCSP_SERVICELOC 168return the number of bytes successfully encoded or a negative value 169if an error occurs. 170.Sh SEE ALSO 171.Xr ASN1_item_d2i 3 , 172.Xr OCSP_CERTID_new 3 , 173.Xr OCSP_REQUEST_new 3 , 174.Xr OCSP_SERVICELOC_new 3 175.Sh STANDARDS 176RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate 177Status Protocol, section 4.1: Request Syntax 178.Sh HISTORY 179These functions first appeared in OpenSSL 0.9.7 180and have been available since 181.Ox 3.2 . 182