Previous: OIDs, Up: Utilities


7.3 Distinguished Name helpers

These are helper functions for the so called distinguished names. They are used for example as the issuer and subject name.

— Function: gpg_error_t ksba_dn_teststr (const char *string, int seq, size_t *rerroff, size_t *rerrlen)

Assuming that string contains an RFC-2253 encoded string, test whether this string may be passed as a valid DN to libksba. On success the functions returns 0. On error the function returns an error code and stores the offset of the erroneous part at rerroff. rerrlen will then receive the length of the erroneous part.

This function is mostly useful to test whether a certain component label is supported. seq should be passed as 0 for now. Any of rerroff and rerrlen may be passed as NULL if the caller is not interested at this value.

gpg_error_t ksba_dn_str2der (const char *string, void **rder, size_t *rderlen);

gpg_error_t ksba_dn_der2str (const void *der, size_t derlen, char **r_string);