1.\" $OpenBSD: d2i_X509_REQ.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ 2.\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 3.\" 4.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 5.\" 6.\" Permission to use, copy, modify, and distribute this software for any 7.\" purpose with or without fee is hereby granted, provided that the above 8.\" copyright notice and this permission notice appear in all copies. 9.\" 10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17.\" 18.Dd $Mdocdate: March 27 2018 $ 19.Dt D2I_X509_REQ 3 20.Os 21.Sh NAME 22.Nm d2i_X509_REQ , 23.Nm i2d_X509_REQ , 24.Nm d2i_X509_REQ_bio , 25.Nm d2i_X509_REQ_fp , 26.Nm i2d_X509_REQ_bio , 27.Nm i2d_X509_REQ_fp , 28.Nm d2i_X509_REQ_INFO , 29.Nm i2d_X509_REQ_INFO 30.Nd decode and encode PKCS#10 certification requests 31.Sh SYNOPSIS 32.In openssl/x509.h 33.Ft X509_REQ * 34.Fo d2i_X509_REQ 35.Fa "X509_REQ **val_out" 36.Fa "const unsigned char **der_in" 37.Fa "long length" 38.Fc 39.Ft int 40.Fo i2d_X509_REQ 41.Fa "X509_REQ *val_in" 42.Fa "unsigned char **der_out" 43.Fc 44.Ft X509_REQ * 45.Fo d2i_X509_REQ_bio 46.Fa "BIO *in_bio" 47.Fa "X509_REQ **val_out" 48.Fc 49.Ft X509_REQ * 50.Fo d2i_X509_REQ_fp 51.Fa "FILE *in_fp" 52.Fa "X509_REQ **val_out" 53.Fc 54.Ft int 55.Fo i2d_X509_REQ_bio 56.Fa "BIO *out_bio" 57.Fa "X509_REQ *val_in" 58.Fc 59.Ft int 60.Fo i2d_X509_REQ_fp 61.Fa "FILE *out_fp" 62.Fa "X509_REQ *val_in" 63.Fc 64.Ft X509_REQ_INFO * 65.Fo d2i_X509_REQ_INFO 66.Fa "X509_REQ_INFO **val_out" 67.Fa "const unsigned char **der_in" 68.Fa "long length" 69.Fc 70.Ft int 71.Fo i2d_X509_REQ_INFO 72.Fa "X509_REQ_INFO *val_in" 73.Fa "unsigned char **der_out" 74.Fc 75.Sh DESCRIPTION 76These functions decode and encode PKCS#10 certification requests. 77For details about the semantics, examples, caveats, and bugs, see 78.Xr ASN1_item_d2i 3 . 79.Pp 80.Fn d2i_X509_REQ 81and 82.Fn i2d_X509_REQ 83decode and encode an ASN.1 84.Vt CertificationRequest 85structure defined in RFC 2986 section 4.2. 86.Fn d2i_X509_REQ_bio , 87.Fn d2i_X509_REQ_fp , 88.Fn i2d_X509_REQ_bio , 89and 90.Fn i2d_X509_REQ_fp 91are similar except that they decode or encode using a 92.Vt BIO 93or 94.Vt FILE 95pointer. 96.Pp 97.Fn d2i_X509_REQ_INFO 98and 99.Fn i2d_X509_REQ_INFO 100decode and encode an ASN.1 101.Vt CertificationRequestInfo 102structure defined in RFC 2986 section 4.1. 103.Sh RETURN VALUES 104.Fn d2i_X509_REQ , 105.Fn d2i_X509_REQ_bio , 106and 107.Fn d2i_X509_REQ_fp 108return an 109.Vt X509_REQ 110object or 111.Dv NULL 112if an error occurs. 113.Pp 114.Fn d2i_X509_REQ_INFO 115returns an 116.Vt X509_REQ_INFO 117object or 118.Dv NULL 119if an error occurs. 120.Pp 121.Fn i2d_X509_REQ 122and 123.Fn i2d_X509_REQ_INFO 124return the number of bytes successfully encoded or a negative value 125if an error occurs. 126.Pp 127.Fn i2d_X509_REQ_bio 128and 129.Fn i2d_X509_REQ_fp 130return 1 for success or 0 if an error occurs. 131.Sh SEE ALSO 132.Xr ASN1_item_d2i 3 , 133.Xr PEM_read_X509_REQ 3 , 134.Xr X509_REQ_new 3 135.Sh STANDARDS 136RFC 2986: PKCS #10: Certification Request Syntax Specification 137.Sh HISTORY 138.Fn d2i_X509_REQ , 139.Fn i2d_X509_REQ , 140.Fn d2i_X509_REQ_fp , 141.Fn i2d_X509_REQ_fp , 142.Fn d2i_X509_REQ_INFO , 143and 144.Fn i2d_X509_REQ_INFO 145first appeared in SSLeay 0.5.1. 146.Fn d2i_X509_REQ_bio 147and 148.Fn i2d_X509_REQ_bio 149first appeared in SSLeay 0.6.0. 150These functions have been available since 151.Ox 2.4 . 152