1gnutls_x509_crt_get_dn_by_oid(3) gnutls gnutls_x509_crt_get_dn_by_oid(3)
2
3
4
6 gnutls_x509_crt_get_dn_by_oid - API function
7
9 #include <gnutls/x509.h>
10
11 int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert, const char *
12 oid, unsigned indx, unsigned int raw_flag, void * buf, size_t *
13 buf_size);
14
16 gnutls_x509_crt_t cert
17 should contain a gnutls_x509_crt_t type
18
19 const char * oid
20 holds an Object Identified in null terminated string
21
22 unsigned indx
23 In case multiple same OIDs exist in the RDN, this specifies
24 which to send. Use (0) to get the first one.
25
26 unsigned int raw_flag
27 If non-zero returns the raw DER data of the DN part.
28
29 void * buf a pointer where the DN part will be copied (may be null).
30
31 size_t * buf_size
32 initially holds the size of buf
33
35 This function will extract the part of the name of the Certificate sub‐
36 ject specified by the given OID. The output, if the raw flag is not
37 used, will be encoded as described in RFC4514. Thus a string that is
38 ASCII or UTF-8 encoded, depending on the certificate data.
39
40 Some helper macros with popular OIDs can be found in gnutls/x509.h If
41 raw flag is (0), this function will only return known OIDs as text.
42 Other OIDs will be DER encoded, as described in RFC4514 -- in hex for‐
43 mat with a '#' prefix. You can check about known OIDs using
44 gnutls_x509_dn_oid_known().
45
46 If buf is null then only the size will be filled. If the raw_flag is
47 not specified the output is always null terminated, although the
48 buf_size will not include the null character.
49
51 GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough,
52 and in that case the buf_size will be updated with the required size.
53 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE if there are no data in the cur‐
54 rent index. On success 0 is returned.
55
57 Report bugs to <bugs@gnutls.org>.
58 Home page: https://www.gnutls.org
59
60
62 Copyright © 2001-2020 Free Software Foundation, Inc., and others.
63 Copying and distribution of this file, with or without modification,
64 are permitted in any medium without royalty provided the copyright
65 notice and this notice are preserved.
66
68 The full documentation for gnutls is maintained as a Texinfo manual.
69 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
70 visit
71
72 https://www.gnutls.org/manual/
73
74gnutls 3.6.13 gnutls_x509_crt_get_dn_by_oid(3)