help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnutls] gnutls_x509_crq_get_dn_by_oid


From: Nikos Mavrogiannopoulos
Subject: Re: [Help-gnutls] gnutls_x509_crq_get_dn_by_oid
Date: Fri, 22 Apr 2005 17:28:20 +0200
User-agent: KMail/1.7.2

On Friday 22 April 2005 14:22, Daniel Stenberg wrote:
> Hello!
>
> Can you please clarify what gnutls_x509_crq_get_dn_by_oid() stores in the
> area I point out to it with the 'buf' argument?
>
> The docs says it should be "a pointer to a structure to hold the name", but
> doesn't mention what structure or how such a struct should look like.
I changed it to:
a pointer where the DN part will be copied (may be null).


> I currently use it like this:
>
>    size=sizeof(certbuf);
>    rc = gnutls_x509_crt_get_dn_by_oid(x509_cert,
> GNUTLS_OID_X520_COMMON_NAME, 0, /* the first and only one */ TRUE, /* give
> to me raw please */ certbuf,
>                                       &size);
Why do you want the DER data and not a printable string?

A common use would be:
string[128];
size_t size=sizeof(string);
rc = gnutls_x509_crt_get_dn_by_oid(x509_cert,
     GNUTLS_OID_X520_COMMON_NAME, 0, 0, string, &size);

-- 
Nikos Mavrogiannopoulos




reply via email to

[Prev in Thread] Current Thread [Next in Thread]