summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/OBJ_create.3
diff options
context:
space:
mode:
authorschwarze <>2021-12-15 20:07:51 +0000
committerschwarze <>2021-12-15 20:07:51 +0000
commit1959f03a0a5b06e7800a2876638580fa1f2a8713 (patch)
tree347cf4cc9928f5f06b7102ef9daf11dea451fac9 /src/lib/libcrypto/man/OBJ_create.3
parent32d18bff50d185454dd5f17af09dc363fc58a6d8 (diff)
downloadopenbsd-1959f03a0a5b06e7800a2876638580fa1f2a8713.tar.gz
openbsd-1959f03a0a5b06e7800a2876638580fa1f2a8713.tar.bz2
openbsd-1959f03a0a5b06e7800a2876638580fa1f2a8713.zip
Move OBJ_create(3) into its own manual page
because OBJ_nid2obj(3) is already long and more functions related to OBJ_create(3) have to be documented.
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_create.3')
-rw-r--r--src/lib/libcrypto/man/OBJ_create.3140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/OBJ_create.3 b/src/lib/libcrypto/man/OBJ_create.3
new file mode 100644
index 0000000000..37a3907193
--- /dev/null
+++ b/src/lib/libcrypto/man/OBJ_create.3
@@ -0,0 +1,140 @@
1.\" $OpenBSD: OBJ_create.3,v 1.1 2021/12/15 20:07:51 schwarze Exp $
2.\" full merge up to:
3.\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400
4.\" selective merge up to:
5.\" OpenSSL OBJ_nid2obj.pod 35fd9953 May 28 14:49:38 2019 +0200
6.\"
7.\" This file is a derived work.
8.\" The changes are covered by the following Copyright and license:
9.\"
10.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
11.\"
12.\" Permission to use, copy, modify, and distribute this software for any
13.\" purpose with or without fee is hereby granted, provided that the above
14.\" copyright notice and this permission notice appear in all copies.
15.\"
16.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
17.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
18.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
19.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
21.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
22.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23.\"
24.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
25.\" Copyright (c) 2002, 2006 The OpenSSL Project.
26.\" All rights reserved.
27.\"
28.\" Redistribution and use in source and binary forms, with or without
29.\" modification, are permitted provided that the following conditions
30.\" are met:
31.\"
32.\" 1. Redistributions of source code must retain the above copyright
33.\" notice, this list of conditions and the following disclaimer.
34.\"
35.\" 2. Redistributions in binary form must reproduce the above copyright
36.\" notice, this list of conditions and the following disclaimer in
37.\" the documentation and/or other materials provided with the
38.\" distribution.
39.\"
40.\" 3. All advertising materials mentioning features or use of this
41.\" software must display the following acknowledgment:
42.\" "This product includes software developed by the OpenSSL Project
43.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
44.\"
45.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
46.\" endorse or promote products derived from this software without
47.\" prior written permission. For written permission, please contact
48.\" openssl-core@openssl.org.
49.\"
50.\" 5. Products derived from this software may not be called "OpenSSL"
51.\" nor may "OpenSSL" appear in their names without prior written
52.\" permission of the OpenSSL Project.
53.\"
54.\" 6. Redistributions of any form whatsoever must retain the following
55.\" acknowledgment:
56.\" "This product includes software developed by the OpenSSL Project
57.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
58.\"
59.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
60.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
63.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
64.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
65.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
66.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
68.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\"
72.Dd $Mdocdate: December 15 2021 $
73.Dt OBJ_CREATE 3
74.Os
75.Sh NAME
76.Nm OBJ_create ,
77.Nm OBJ_cleanup
78.Nd modify the table of ASN.1 object identifiers
79.Sh SYNOPSIS
80.In openssl/objects.h
81.Ft int
82.Fo OBJ_create
83.Fa "const char *oid"
84.Fa "const char *sn"
85.Fa "const char *ln"
86.Fc
87.Ft void
88.Fn OBJ_cleanup void
89.Sh DESCRIPTION
90.Fn OBJ_create
91adds a new object to the internal table.
92.Fa oid
93is the numerical form of the object,
94.Fa sn
95the short name and
96.Fa ln
97the long name.
98A new NID is returned for the created object.
99.Pp
100The new object added to the internal table and all the data
101contained in it is marked as not dynamically allocated.
102Consequently, retrieving it with
103.Xr OBJ_nid2obj 3
104or a similar function and then calling
105.Xr ASN1_OBJECT_free 3
106on the returned pointer will have no effect.
107.Pp
108.Fn OBJ_cleanup
109cleans up the internal object table: this should be called before
110an application exits if any new objects were added using
111.Fn OBJ_create .
112.Sh RETURN VALUES
113.Fn OBJ_create
114returns the new NID or
115.Dv NID_undef
116if an error occurs.
117.Pp
118In some cases of failure of
119.Fn OBJ_create ,
120the reason can be determined with
121.Xr ERR_get_error 3 .
122.Sh EXAMPLES
123Create a new NID and initialize an object from it:
124.Bd -literal -offset indent
125int new_nid;
126
127ASN1_OBJECT *obj;
128new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier");
129obj = OBJ_nid2obj(new_nid);
130.Ed
131.Sh SEE ALSO
132.Xr ASN1_OBJECT_new 3 ,
133.Xr OBJ_nid2obj 3
134.Sh HISTORY
135.Fn OBJ_cleanup
136first appeared in SSLeay 0.8.0 and
137.Fn OBJ_create
138in SSLeay 0.9.0.
139These functions have been available since
140.Ox 2.4 .