X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=doc%2Fman3%2Fd2i_X509.pod;h=cad78773964a5b3ad1a8e60da3ef912a5e0a3498;hp=f50194868b5471a1632a8a535f89319467e41601;hb=c54492ecf8331fd87f6ac163f9fc5b576af128e8;hpb=00606b06d5209368d1bd2fcab70bf6d9e2fe875f diff --git a/doc/man3/d2i_X509.pod b/doc/man3/d2i_X509.pod index f50194868b..cad7877396 100644 --- a/doc/man3/d2i_X509.pod +++ b/doc/man3/d2i_X509.pod @@ -3,6 +3,8 @@ =head1 NAME d2i_ACCESS_DESCRIPTION, +d2i_ADMISSIONS, +d2i_ADMISSION_SYNTAX, d2i_ASIdOrRange, d2i_ASIdentifierChoice, d2i_ASIdentifiers, @@ -46,6 +48,7 @@ d2i_DSAPrivateKey, d2i_DSAPrivateKey_bio, d2i_DSAPrivateKey_fp, d2i_DSAPublicKey, +d2i_DSA_PUBKEY, d2i_DSA_PUBKEY_bio, d2i_DSA_PUBKEY_fp, d2i_DSA_SIG, @@ -70,6 +73,7 @@ d2i_IPAddressFamily, d2i_IPAddressOrRange, d2i_IPAddressRange, d2i_ISSUING_DIST_POINT, +d2i_NAMING_AUTHORITY, d2i_NETSCAPE_CERT_SEQUENCE, d2i_NETSCAPE_SPKAC, d2i_NETSCAPE_SPKI, @@ -119,9 +123,9 @@ d2i_PKCS8_fp, d2i_PKEY_USAGE_PERIOD, d2i_POLICYINFO, d2i_POLICYQUALINFO, +d2i_PROFESSION_INFO, d2i_PROXY_CERT_INFO_EXTENSION, d2i_PROXY_POLICY, -d2i_PublicKey, d2i_RSAPrivateKey, d2i_RSAPrivateKey_bio, d2i_RSAPrivateKey_fp, @@ -175,6 +179,8 @@ d2i_X509_REVOKED, d2i_X509_SIG, d2i_X509_VAL, i2d_ACCESS_DESCRIPTION, +i2d_ADMISSIONS, +i2d_ADMISSION_SYNTAX, i2d_ASIdOrRange, i2d_ASIdentifierChoice, i2d_ASIdentifiers, @@ -218,6 +224,7 @@ i2d_DSAPrivateKey, i2d_DSAPrivateKey_bio, i2d_DSAPrivateKey_fp, i2d_DSAPublicKey, +i2d_DSA_PUBKEY, i2d_DSA_PUBKEY_bio, i2d_DSA_PUBKEY_fp, i2d_DSA_SIG, @@ -242,6 +249,7 @@ i2d_IPAddressFamily, i2d_IPAddressOrRange, i2d_IPAddressRange, i2d_ISSUING_DIST_POINT, +i2d_NAMING_AUTHORITY, i2d_NETSCAPE_CERT_SEQUENCE, i2d_NETSCAPE_SPKAC, i2d_NETSCAPE_SPKI, @@ -294,6 +302,7 @@ i2d_PKCS8_fp, i2d_PKEY_USAGE_PERIOD, i2d_POLICYINFO, i2d_POLICYQUALINFO, +i2d_PROFESSION_INFO, i2d_PROXY_CERT_INFO_EXTENSION, i2d_PROXY_POLICY, i2d_PublicKey, @@ -355,26 +364,31 @@ i2d_X509_VAL, =for comment generic - TYPE *d2i_TYPE(TYPE **a, unsigned char **pp, long length); + TYPE *d2i_TYPE(TYPE **a, unsigned char **ppin, long length); TYPE *d2i_TYPE_bio(BIO *bp, TYPE **a); TYPE *d2i_TYPE_fp(FILE *fp, TYPE **a); - int i2d_TYPE(TYPE *a, unsigned char **pp); + int i2d_TYPE(const TYPE *a, unsigned char **ppout); + int i2d_TYPE(TYPE *a, unsigned char **ppout); + int i2d_TYPE_fp(FILE *fp, const TYPE *a); int i2d_TYPE_fp(FILE *fp, TYPE *a); + int i2d_TYPE_bio(BIO *bp, const TYPE *a); int i2d_TYPE_bio(BIO *bp, TYPE *a); =head1 DESCRIPTION In the description here, I is used a placeholder for any of the OpenSSL datatypes, such as I. +The function parameters I and I are generally +either both named I in the headers, or I and I. These functions convert OpenSSL objects to and from their ASN.1/DER encoding. Unlike the C structures which can have pointers to sub-objects within, the DER is a serialized encoding, suitable for sending over the network, writing to a file, and so on. -d2i_TYPE() attempts to decode B bytes at B<*in>. If successful a -pointer to the B structure is returned and B<*in> is incremented to +d2i_TYPE() attempts to decode B bytes at B<*ppin>. If successful a +pointer to the B structure is returned and B<*ppin> is incremented to the byte following the parsed data. If B is not B then a pointer to the returned structure is also written to B<*a>. If an error occurred then B is returned. @@ -392,13 +406,13 @@ d2i_TYPE_fp() is similar to d2i_TYPE() except it attempts to parse data from FILE pointer B. i2d_TYPE() encodes the structure pointed to by B into DER format. -If B is not B, it writes the DER encoded data to the buffer -at B<*out>, and increments it to point after the data just written. +If B is not B, it writes the DER encoded data to the buffer +at B<*ppout>, 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. -If B<*out> is B memory will be allocated for a buffer and the encoded -data written to it. In this case B<*out> is not incremented and it points +If B<*ppout> is B memory will be allocated for a buffer and the encoded +data written to it. In this case B<*ppout> is not incremented and it points to the start of the data just written. i2d_TYPE_bio() is similar to i2d_TYPE() except it writes @@ -429,7 +443,7 @@ Therefore any FILE pointers or BIOs should be opened in binary mode. Functions such as strlen() will B return the correct length of the encoded structure. -The ways that B<*in> and B<*out> are incremented after the operation +The ways that B<*ppin> and B<*ppout> are incremented after the operation can trap the unwary. See the B section for some common errors. The reason for this-auto increment behaviour is to reflect a typical @@ -450,7 +464,7 @@ Represents a PKCS#3 DH parameters structure. =item B -Represents a ANSI X9.42 DH parameters structure. +Represents an ANSI X9.42 DH parameters structure. =item B @@ -485,6 +499,19 @@ Represents the B structure defined in PKCS#1 and PKCS#7. =back +=head1 RETURN VALUES + +d2i_TYPE(), d2i_TYPE_bio() and d2i_TYPE_fp() return a valid B structure +or B if an error occurs. If the "reuse" capability has been used with +a valid structure being passed in via B, then the object is not freed in +the event of error but may be in a potentially invalid or inconsistent state. + +i2d_TYPE() returns the number of bytes successfully encoded or a negative +value if an error occurs. + +i2d_TYPE_bio() and i2d_TYPE_fp() return 1 for success and 0 if an error +occurs. + =head1 EXAMPLES Allocate and encode the DER encoding of an X509 structure: @@ -575,24 +602,11 @@ structure has been modified after deserialization or previous serialization. This is because some objects cache the encoding for efficiency reasons. -=head1 RETURN VALUES - -d2i_TYPE(), d2i_TYPE_bio() and d2i_TYPE_fp() return a valid B structure -or B if an error occurs. If the "reuse" capability has been used with -a valid structure being passed in via B, then the object is not freed in -the event of error but may be in a potentially invalid or inconsistent state. - -i2d_TYPE() returns the number of bytes successfully encoded or a negative -value if an error occurs. - -i2d_TYPE_bio() and i2d_TYPE_fp() return 1 for success and 0 if an error -occurs. - =head1 COPYRIGHT -Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. -Licensed under the OpenSSL license (the "License"). You may not use +Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L.