summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/OBJ_nid2obj.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_nid2obj.3')
-rw-r--r--src/lib/libcrypto/man/OBJ_nid2obj.367
1 files changed, 9 insertions, 58 deletions
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3
index db9cd05c26..a43fe962e1 100644
--- a/src/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/src/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,5 +1,6 @@
1.\" $OpenBSD: OBJ_nid2obj.3,v 1.15 2021/07/05 17:57:16 schwarze Exp $ 1.\" $OpenBSD: OBJ_nid2obj.3,v 1.16 2021/12/15 20:07:51 schwarze Exp $
2.\" OpenSSL c264592d May 14 11:28:00 2006 +0000 2.\" full merge up to: OpenSSL c264592d May 14 11:28:00 2006 +0000
3.\" selective merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200
3.\" 4.\"
4.\" This file is a derived work. 5.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license: 6.\" The changes are covered by the following Copyright and license:
@@ -19,7 +20,7 @@
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\" 21.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. 22.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
22.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project. 23.\" Copyright (c) 2002, 2006, 2016 The OpenSSL Project.
23.\" All rights reserved. 24.\" All rights reserved.
24.\" 25.\"
25.\" Redistribution and use in source and binary forms, with or without 26.\" Redistribution and use in source and binary forms, with or without
@@ -66,7 +67,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 68.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 69.\"
69.Dd $Mdocdate: July 5 2021 $ 70.Dd $Mdocdate: December 15 2021 $
70.Dt OBJ_NID2OBJ 3 71.Dt OBJ_NID2OBJ 3
71.Os 72.Os
72.Sh NAME 73.Sh NAME
@@ -81,8 +82,6 @@
81.Nm OBJ_obj2txt , 82.Nm OBJ_obj2txt ,
82.Nm OBJ_cmp , 83.Nm OBJ_cmp ,
83.Nm OBJ_dup , 84.Nm OBJ_dup ,
84.Nm OBJ_create ,
85.Nm OBJ_cleanup ,
86.Nm i2t_ASN1_OBJECT , 85.Nm i2t_ASN1_OBJECT ,
87.Nm i2a_ASN1_OBJECT 86.Nm i2a_ASN1_OBJECT
88.Nd inspect and create ASN.1 object identifiers 87.Nd inspect and create ASN.1 object identifiers
@@ -137,14 +136,6 @@
137.Fo OBJ_dup 136.Fo OBJ_dup
138.Fa "const ASN1_OBJECT *o" 137.Fa "const ASN1_OBJECT *o"
139.Fc 138.Fc
140.Ft int
141.Fo OBJ_create
142.Fa "const char *oid"
143.Fa "const char *sn"
144.Fa "const char *ln"
145.Fc
146.Ft void
147.Fn OBJ_cleanup void
148.In openssl/asn1.h 139.In openssl/asn1.h
149.Ft int 140.Ft int
150.Fo i2t_ASN1_OBJECT 141.Fo i2t_ASN1_OBJECT
@@ -286,29 +277,6 @@ just returns
286.Fa o 277.Fa o
287itself. 278itself.
288.Pp 279.Pp
289.Fn OBJ_create
290adds a new object to the internal table.
291.Fa oid
292is the numerical form of the object,
293.Fa sn
294the short name and
295.Fa ln
296the long name.
297A new NID is returned for the created object.
298.Pp
299The new object added to the internal table and all the data
300contained in it is marked as not dynamically allocated.
301Consequently, retrieving it with
302.Fn OBJ_nid2obj
303or a similar function and then calling
304.Xr ASN1_OBJECT_free 3
305on the returned pointer will have no effect.
306.Pp
307.Fn OBJ_cleanup
308cleans up the internal object table: this should be called before
309an application exits if any new objects were added using
310.Fn OBJ_create .
311.Pp
312Objects can have a short name, a long name, and a numerical 280Objects can have a short name, a long name, and a numerical
313identifier (NID) associated with them. 281identifier (NID) associated with them.
314A standard set of objects is represented in an internal table. 282A standard set of objects is represented in an internal table.
@@ -323,7 +291,7 @@ For example, the OID for commonName has the following definitions:
323.Ed 291.Ed
324.Pp 292.Pp
325New objects can be added by calling 293New objects can be added by calling
326.Fn OBJ_create . 294.Xr OBJ_create 3 .
327.Pp 295.Pp
328Table objects have certain advantages over other objects: for example 296Table objects have certain advantages over other objects: for example
329their NIDs can be used in a C language switch statement. 297their NIDs can be used in a C language switch statement.
@@ -385,11 +353,6 @@ and
385.Fa b 353.Fa b
386are identical, or non-zero otherwise. 354are identical, or non-zero otherwise.
387.Pp 355.Pp
388.Fn OBJ_create
389returns the new NID or
390.Dv NID_undef
391if an error occurs.
392.Pp
393In some cases of failure of 356In some cases of failure of
394.Fn OBJ_nid2obj , 357.Fn OBJ_nid2obj ,
395.Fn OBJ_nid2ln , 358.Fn OBJ_nid2ln ,
@@ -398,7 +361,6 @@ In some cases of failure of
398.Fn OBJ_txt2obj , 361.Fn OBJ_txt2obj ,
399.Fn OBJ_obj2txt , 362.Fn OBJ_obj2txt ,
400.Fn OBJ_dup , 363.Fn OBJ_dup ,
401.Fn OBJ_create ,
402.Fn i2t_ASN1_OBJECT , 364.Fn i2t_ASN1_OBJECT ,
403and 365and
404.Fn i2a_ASN1_OBJECT , 366.Fn i2a_ASN1_OBJECT ,
@@ -419,14 +381,6 @@ if (OBJ_obj2nid(obj) == NID_commonName)
419 /* Do something */ 381 /* Do something */
420.Ed 382.Ed
421.Pp 383.Pp
422Create a new NID and initialize an object from it:
423.Bd -literal -offset indent
424int new_nid;
425ASN1_OBJECT *obj;
426new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier");
427obj = OBJ_nid2obj(new_nid);
428.Ed
429.Pp
430Create a new object directly: 384Create a new object directly:
431.Bd -literal -offset indent 385.Bd -literal -offset indent
432obj = OBJ_txt2obj("1.2.3.4", 1); 386obj = OBJ_txt2obj("1.2.3.4", 1);
@@ -434,7 +388,8 @@ obj = OBJ_txt2obj("1.2.3.4", 1);
434.Sh SEE ALSO 388.Sh SEE ALSO
435.Xr ASN1_OBJECT_new 3 , 389.Xr ASN1_OBJECT_new 3 ,
436.Xr BIO_new 3 , 390.Xr BIO_new 3 ,
437.Xr d2i_ASN1_OBJECT 3 391.Xr d2i_ASN1_OBJECT 3 ,
392.Xr OBJ_create 3
438.Sh HISTORY 393.Sh HISTORY
439.Fn OBJ_nid2obj , 394.Fn OBJ_nid2obj ,
440.Fn OBJ_nid2ln , 395.Fn OBJ_nid2ln ,
@@ -448,11 +403,7 @@ and
448.Fn OBJ_dup 403.Fn OBJ_dup
449first appeared in SSLeay 0.5.1. 404first appeared in SSLeay 0.5.1.
450.Fn i2a_ASN1_OBJECT 405.Fn i2a_ASN1_OBJECT
451first appeared in SSLeay 0.6.0, 406first appeared in SSLeay 0.6.0, and
452.Fn OBJ_cleanup
453in SSLeay 0.8.0, and
454.Fn OBJ_create
455and
456.Fn i2t_ASN1_OBJECT 407.Fn i2t_ASN1_OBJECT
457in SSLeay 0.9.0. 408in SSLeay 0.9.0.
458All these functions have been available since 409All these functions have been available since