Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
Yeah, agreed, although I'd like the parser to work with the output of "openssl x509 ... -subject", i.e. RFC-4514 format, which is "CN=name, O=Acme Corporation, C=US" ... etc. > On Jul 23, 2021, at 12:57 AM, David von Oheimb wrote: > > What I use is > > X509_NAME *nname =

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
> On Jul 23, 2021, at 8:52 AM, Viktor Dukhovni > wrote: > >> On 23 Jul 2021, at 2:57 am, David von Oheimb wrote: >> >> What I use is >> >>X509_NAME *nname = parse_name(string, MBSTRING_ASC, 1, desc); >> >> which is not an official API function but defined in apps/lib/apps.c: >>

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Philip Prindeville
Yeah, agreed, although I'd like the parser to work with the output of "openssl x509 ... -subject", i.e. RFC-4514 format, which is "CN=name, O=Acme Corporation, C=US" ... etc. > On Jul 23, 2021, at 12:57 AM, David von Oheimb wrote: > > What I use is > > X509_NAME *nname =

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread Viktor Dukhovni
> On 23 Jul 2021, at 2:57 am, David von Oheimb wrote: > > What I use is > > X509_NAME *nname = parse_name(string, MBSTRING_ASC, 1, desc); > > which is not an official API function but defined in apps/lib/apps.c: > > /* > * name is expected to be in the format

Re: Parsing subject/issuer strings in X.509

2021-07-23 Thread David von Oheimb
What I use is     X509_NAME *nname = parse_name(string, MBSTRING_ASC, 1, desc); which is not an official API function but defined in apps/lib/apps.c: /*  * name is expected to be in the format /type0=value0/type1=value1/type2=...  * where + can be used instead of / to form multi-valued RDNs

Re: Parsing subject/issuer strings in X.509

2021-07-22 Thread Viktor Dukhovni
> On 22 Jul 2021, at 9:29 pm, Philip Prindeville > wrote: > > I'm wondering what the function is that takes a string and returns X509_NAME > with the attribute/value pairs of the parsed DN. There is no such function in general, since the are many potential string forms of X.509 names, not all