diff options
Diffstat (limited to 'secure/lib/libcrypto/man/d2i_X509.3')
-rw-r--r-- | secure/lib/libcrypto/man/d2i_X509.3 | 171 |
1 files changed, 55 insertions, 116 deletions
diff --git a/secure/lib/libcrypto/man/d2i_X509.3 b/secure/lib/libcrypto/man/d2i_X509.3 index 3945c98..e98e687 100644 --- a/secure/lib/libcrypto/man/d2i_X509.3 +++ b/secure/lib/libcrypto/man/d2i_X509.3 @@ -1,15 +1,7 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp @@ -25,11 +17,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -48,22 +40,25 @@ . ds R" '' 'br\} .\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" .\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.if \nF \{\ +.ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.if n .na +.el \{\ +. de IX +.. +.\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -129,7 +124,11 @@ .\" ======================================================================== .\" .IX Title "d2i_X509 3" -.TH d2i_X509 3 "2010-03-24" "0.9.8n" "OpenSSL" +.TH d2i_X509 3 "2010-11-16" "0.9.8p" "OpenSSL" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh .SH "NAME" d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio, i2d_X509_fp \- X509 encode and decode functions @@ -137,19 +136,13 @@ i2d_X509_fp \- X509 encode and decode functions .IX Header "SYNOPSIS" .Vb 1 \& #include <openssl/x509.h> -.Ve -.PP -.Vb 2 +\& \& X509 *d2i_X509(X509 **px, const unsigned char **in, int len); \& int i2d_X509(X509 *x, unsigned char **out); -.Ve -.PP -.Vb 2 +\& \& X509 *d2i_X509_bio(BIO *bp, X509 **x); \& X509 *d2i_X509_fp(FILE *fp, X509 **x); -.Ve -.PP -.Vb 2 +\& \& int i2d_X509_bio(BIO *bp, X509 *x); \& int i2d_X509_fp(FILE *fp, X509 *x); .Ve @@ -171,7 +164,7 @@ parsed data. If \fBout\fR is not \fB\s-1NULL\s0\fR is writes the \s-1DER\s0 encoded data to the buffer at \fB*out\fR, and increments it to point after the data just written. If the return value is negative an error occurred, otherwise it -returns the length of the encoded data. +returns the length of the encoded data. .PP For OpenSSL 0.9.7 and later if \fB*out\fR is \fB\s-1NULL\s0\fR memory will be allocated for a buffer and the encoded data written to it. In this @@ -222,26 +215,16 @@ Allocate and encode the \s-1DER\s0 encoding of an X509 structure: .Vb 2 \& int len; \& unsigned char *buf, *p; -.Ve -.PP -.Vb 1 +\& \& len = i2d_X509(x, NULL); -.Ve -.PP -.Vb 1 +\& \& buf = OPENSSL_malloc(len); -.Ve -.PP -.Vb 2 +\& \& if (buf == NULL) \& /* error */ -.Ve -.PP -.Vb 1 +\& \& p = buf; -.Ve -.PP -.Vb 1 +\& \& i2d_X509(x, &p); .Ve .PP @@ -251,17 +234,11 @@ simplified to: .Vb 2 \& int len; \& unsigned char *buf; -.Ve -.PP -.Vb 1 +\& \& buf = NULL; -.Ve -.PP -.Vb 1 +\& \& len = i2d_X509(x, &buf); -.Ve -.PP -.Vb 2 +\& \& if (len < 0) \& /* error */ .Ve @@ -270,29 +247,17 @@ Attempt to decode a buffer: .PP .Vb 1 \& X509 *x; -.Ve -.PP -.Vb 1 +\& \& unsigned char *buf, *p; -.Ve -.PP -.Vb 1 +\& \& int len; -.Ve -.PP -.Vb 1 +\& \& /* Something to setup buf and len */ -.Ve -.PP -.Vb 1 +\& \& p = buf; -.Ve -.PP -.Vb 1 +\& \& x = d2i_X509(NULL, &p, len); -.Ve -.PP -.Vb 2 +\& \& if (x == NULL) \& /* Some error */ .Ve @@ -301,29 +266,17 @@ Alternative technique: .PP .Vb 1 \& X509 *x; -.Ve -.PP -.Vb 1 +\& \& unsigned char *buf, *p; -.Ve -.PP -.Vb 1 +\& \& int len; -.Ve -.PP -.Vb 1 +\& \& /* Something to setup buf and len */ -.Ve -.PP -.Vb 1 +\& \& p = buf; -.Ve -.PP -.Vb 1 +\& \& x = NULL; -.Ve -.PP -.Vb 2 +\& \& if(!d2i_X509(&x, &p, len)) \& /* Some error */ .Ve @@ -335,30 +288,18 @@ mistake is to attempt to use a buffer directly as follows: .Vb 2 \& int len; \& unsigned char *buf; -.Ve -.PP -.Vb 1 +\& \& len = i2d_X509(x, NULL); -.Ve -.PP -.Vb 1 +\& \& buf = OPENSSL_malloc(len); -.Ve -.PP -.Vb 2 +\& \& if (buf == NULL) \& /* error */ -.Ve -.PP -.Vb 1 +\& \& i2d_X509(x, &buf); -.Ve -.PP -.Vb 1 +\& \& /* Other stuff ... */ -.Ve -.PP -.Vb 1 +\& \& OPENSSL_free(buf); .Ve .PP @@ -375,9 +316,7 @@ Another trap to avoid is misuse of the \fBxp\fR argument to \fB\f(BId2i_X509()\f .PP .Vb 1 \& X509 *x; -.Ve -.PP -.Vb 2 +\& \& if (!d2i_X509(&x, &p, len)) \& /* Some error */ .Ve @@ -404,14 +343,14 @@ always succeed. .IX Header "RETURN VALUES" \&\fId2i_X509()\fR, \fId2i_X509_bio()\fR and \fId2i_X509_fp()\fR return a valid \fBX509\fR structure or \fB\s-1NULL\s0\fR if an error occurs. The error code that can be obtained by -\&\fIERR_get_error\fR\|(3). +\&\fIERR_get_error\fR\|(3). .PP \&\fIi2d_X509()\fR returns the number of bytes successfully encoded or a negative value if an error occurs. The error code can be obtained by -\&\fIERR_get_error\fR\|(3). +\&\fIERR_get_error\fR\|(3). .PP \&\fIi2d_X509_bio()\fR and \fIi2d_X509_fp()\fR return 1 for success and 0 if an error -occurs The error code can be obtained by \fIERR_get_error\fR\|(3). +occurs The error code can be obtained by \fIERR_get_error\fR\|(3). .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIERR_get_error\fR\|(3) |