xref: /openbsd-src/lib/libcrypto/man/ASN1_OBJECT_new.3 (revision 0b7734b3d77bb9b21afec6f4621cae6c805dbd45)
1.Dd $Mdocdate: March 12 2016 $
2.Dt ASN1_OBJECT_NEW 3
3.Os
4.Sh NAME
5.Nm ASN1_OBJECT_new ,
6.Nm ASN1_OBJECT_free
7.Nd ASN1 object allocation functions
8.Sh SYNOPSIS
9.In openssl/asn1.h
10.Ft ASN1_OBJECT *
11.Fo ASN1_OBJECT_new
12.Fa void
13.Fc
14.Ft void
15.Fo ASN1_OBJECT_free
16.Fa "ASN1_OBJECT *a"
17.Fc
18.Sh DESCRIPTION
19The ASN1_OBJECT allocation routines allocate and free an
20.Vt ASN1_OBJECT
21structure, which represents an ASN1 OBJECT IDENTIFIER.
22.Pp
23.Fn ASN1_OBJECT_new
24allocates and initializes an
25.Vt ASN1_OBJECT
26structure.
27.Pp
28.Fn ASN1_OBJECT_free
29frees up the
30.Vt ASN1_OBJECT
31structure
32.Fa a .
33.Sh NOTES
34Although
35.Fn ASN1_OBJECT_new
36allocates a new
37.Vt ASN1_OBJECT
38structure, it is almost never used in applications.
39The ASN1 object utility functions such as
40.Xr OBJ_nid2obj 3
41are used instead.
42.Sh RETURN VALUES
43If the allocation fails,
44.Fn ASN1_OBJECT_new
45returns
46.Dv NULL
47and sets an error code that can be obtained by
48.Xr ERR_get_error 3 .
49Otherwise it returns a pointer to the newly allocated structure.
50.Sh SEE ALSO
51.Xr d2i_ASN1_OBJECT 3 ,
52.Xr ERR_get_error 3 ,
53.Xr OBJ_nid2obj 3
54.Sh HISTORY
55.Fn ASN1_OBJECT_new
56and
57.Fn ASN1_OBJECT_free
58are available in all versions of SSLeay and OpenSSL.
59