diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/libcrypto/man/X509_new.3 | 74 |
1 files changed, 69 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3 index 705f4b2816..c451485f60 100644 --- a/src/lib/libcrypto/man/X509_new.3 +++ b/src/lib/libcrypto/man/X509_new.3 | |||
| @@ -1,6 +1,54 @@ | |||
| 1 | .\" $OpenBSD: X509_new.3,v 1.3 2016/12/03 13:36:03 jmc Exp $ | 1 | .\" $OpenBSD: X509_new.3,v 1.4 2016/12/05 18:26:16 schwarze Exp $ |
| 2 | .\" OpenSSL 3a59ad98 Dec 11 00:36:06 2015 +0000 | ||
| 2 | .\" | 3 | .\" |
| 3 | .Dd $Mdocdate: December 3 2016 $ | 4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. |
| 5 | .\" Copyright (c) 2002, 2006, 2015 The OpenSSL Project. All rights reserved. | ||
| 6 | .\" | ||
| 7 | .\" Redistribution and use in source and binary forms, with or without | ||
| 8 | .\" modification, are permitted provided that the following conditions | ||
| 9 | .\" are met: | ||
| 10 | .\" | ||
| 11 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 12 | .\" notice, this list of conditions and the following disclaimer. | ||
| 13 | .\" | ||
| 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 15 | .\" notice, this list of conditions and the following disclaimer in | ||
| 16 | .\" the documentation and/or other materials provided with the | ||
| 17 | .\" distribution. | ||
| 18 | .\" | ||
| 19 | .\" 3. All advertising materials mentioning features or use of this | ||
| 20 | .\" software must display the following acknowledgment: | ||
| 21 | .\" "This product includes software developed by the OpenSSL Project | ||
| 22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 23 | .\" | ||
| 24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 25 | .\" endorse or promote products derived from this software without | ||
| 26 | .\" prior written permission. For written permission, please contact | ||
| 27 | .\" openssl-core@openssl.org. | ||
| 28 | .\" | ||
| 29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 31 | .\" permission of the OpenSSL Project. | ||
| 32 | .\" | ||
| 33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 34 | .\" acknowledgment: | ||
| 35 | .\" "This product includes software developed by the OpenSSL Project | ||
| 36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 37 | .\" | ||
| 38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 50 | .\" | ||
| 51 | .Dd $Mdocdate: December 5 2016 $ | ||
| 4 | .Dt X509_NEW 3 | 52 | .Dt X509_NEW 3 |
| 5 | .Os | 53 | .Os |
| 6 | .Sh NAME | 54 | .Sh NAME |
| @@ -15,24 +63,37 @@ | |||
| 15 | .Fo X509_free | 63 | .Fo X509_free |
| 16 | .Fa "X509 *a" | 64 | .Fa "X509 *a" |
| 17 | .Fc | 65 | .Fc |
| 66 | .Ft int | ||
| 67 | .Fo X509_up_ref | ||
| 68 | .Fa "X509 *a" | ||
| 69 | .Fc | ||
| 18 | .Sh DESCRIPTION | 70 | .Sh DESCRIPTION |
| 19 | The X509 ASN.1 allocation routines allocate and free an | 71 | The X509 ASN.1 allocation routines allocate and free an |
| 20 | .Vt X509 | 72 | .Vt X509 |
| 21 | structure, which represents an X509 certificate. | 73 | structure, which represents an X509 certificate. |
| 22 | .Pp | 74 | .Pp |
| 23 | .Fn X509_new | 75 | .Fn X509_new |
| 24 | allocates and initializes a X509 structure. | 76 | allocates and initializes a X509 structure with reference count 1. |
| 25 | .Pp | 77 | .Pp |
| 26 | .Fn X509_free | 78 | .Fn X509_free |
| 27 | frees up the | 79 | decrements the reference count of the |
| 28 | .Vt X509 | 80 | .Vt X509 |
| 29 | structure | 81 | structure |
| 30 | .Fa a . | 82 | .Fa a |
| 83 | and frees it up if the reference count reaches 0. | ||
| 31 | If | 84 | If |
| 32 | .Fa a | 85 | .Fa a |
| 33 | is a | 86 | is a |
| 34 | .Dv NULL | 87 | .Dv NULL |
| 35 | pointer, no action occurs. | 88 | pointer, no action occurs. |
| 89 | .Pp | ||
| 90 | .Fn X509_up_ref | ||
| 91 | increments the reference count of | ||
| 92 | .Fa a . | ||
| 93 | This function is useful if a certificate structure is being used | ||
| 94 | by several different operations each of which will free it up after | ||
| 95 | use: this avoids the need to duplicate the entire certificate | ||
| 96 | structure. | ||
| 36 | .Sh RETURN VALUES | 97 | .Sh RETURN VALUES |
| 37 | If the allocation fails, | 98 | If the allocation fails, |
| 38 | .Fn X509_new | 99 | .Fn X509_new |
| @@ -41,6 +102,9 @@ returns | |||
| 41 | and sets an error code that can be obtained by | 102 | and sets an error code that can be obtained by |
| 42 | .Xr ERR_get_error 3 . | 103 | .Xr ERR_get_error 3 . |
| 43 | Otherwise it returns a pointer to the newly allocated structure. | 104 | Otherwise it returns a pointer to the newly allocated structure. |
| 105 | .Pp | ||
| 106 | .Fn X509_up_ref | ||
| 107 | returns 1 for success or 0 for failure. | ||
| 44 | .Sh SEE ALSO | 108 | .Sh SEE ALSO |
| 45 | .Xr d2i_X509 3 , | 109 | .Xr d2i_X509 3 , |
| 46 | .Xr ERR_get_error 3 | 110 | .Xr ERR_get_error 3 |
