hx509_name(3)

πŸ“¦
version 7.8.0 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, epel 10, epel 9, fedora 43, fedora 44

πŸ’– hx509_name β€” the hx509 name functions, bestie πŸ’–

okay so this is a page from the Heimdal x509 library manpages, and it's all about handling names in hx509. Names are literally the main character of certificates, so yeah, this matters. let's get into it 🫢


🌸 NAME 🌸

hx509_name β€” hx509 name functions. that's it, that's the vibe. ✨


✨ SYNOPSIS ✨

πŸŽ€ Functions πŸŽ€

here's the whole roster, no cap:

int hx509_name_to_string (const hx509_name name, char **str)
int hx509_name_cmp (hx509_name n1, hx509_name n2)
int hx509_parse_name (hx509_context context, const char *str, hx509_name
    *name)
int hx509_name_copy (hx509_context context, const hx509_name from,
    hx509_name *to)
int hx509_name_to_Name (const hx509_name from, Name *to)
int hx509_name_expand (hx509_context context, hx509_name name, hx509_env
    env)
void hx509_name_free (hx509_name *name)
int hx509_unparse_der_name (const void *data, size_t length, char **str)
int hx509_name_binary (const hx509_name name, heim_octet_string *os)
int hx509_name_is_null_p (const hx509_name name)
int hx509_general_name_unparse (GeneralName *name, char **str)

πŸ¦‹ Detailed Description πŸ¦‹

fr fr, if you want the actual description and examples, go read the PKIX/X.509 Names section. that's where the lore lives. πŸ“š


πŸ’… Function Documentation πŸ’…

int hx509_general_name_unparse (GeneralName * name, char ** str)

takes the hx509 name chilling in name and unparses it into a string. it's giving "make it readable." 🌈

Parameters

  • name β€” the name you wanna print
  • str β€” an allocated string; this hands you back the name in string form

Returns

An hx509 error code β€” peep hx509_get_error_string() if you need the deets. πŸ”


int hx509_name_binary (const hx509_name name, heim_octet_string * os)

converts an hx509_name object into a DER encoded name. glow-up but make it bytes. ⭐

Parameters

  • name β€” the name to convert
  • os β€” data to a DER encoded name. and bestie, you gotta free the resulting octet string with hx509_xfree(os->data). don't leave it hanging, that's not the move πŸ™ˆ

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”


int hx509_name_cmp (hx509_name n1, hx509_name n2)

compares two hx509 name objects. super useful for sorting, iykyk. πŸ‘‘

Parameters

  • n1 β€” an hx509 name object.
  • n2 β€” an hx509 name object.

Returns

0 means the objects are the same. it returns > 0 if n2 is 'larger', and < 0 if n1 is 'smaller' than n2. periodt. πŸ’€


int hx509_name_copy (hx509_context context, const hx509_name from, hx509_name * to)

copies an hx509 name object. dupe, but make it legal. ✨

Parameters

  • context β€” an hx509 context.
  • from β€” the name to copy from
  • to β€” the name to copy to

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”


int hx509_name_expand (hx509_context context, hx509_name name, hx509_env env)

expands variables in the name using env. the variables are on the form ${name}. this is lowkey the move when you're dealing with certificate templates. 🧚

Parameters

  • context β€” an hx509 context.
  • name β€” the name to expand.
  • env β€” environment variable to expand.

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”

⚠️ heads up: only UTF8String rdnSequence names are allowed. that's the rule, no exceptions. πŸ’…

void hx509_name_free (hx509_name * name)

frees an hx509 name object. and upon return, *name will be NULL β€” clean, iconic, no dangling anything. πŸŽ€

Parameters

  • name β€” an hx509 name object to be freed.

int hx509_name_is_null_p (const hx509_name name)

unparses the hx509 name in name into a string. (yes bestie, that's what the page says, we're not editing the lore 😭)

Parameters

  • name β€” the name to check if it's empty/null.

Returns

non-zero if the name is empty/null. so like, truthy means it's giving nothing. πŸ’€


int hx509_name_to_Name (const hx509_name from, Name * to)

converts an hx509_name into a Name. glow-up to a different type, slay. 🌟

Parameters

  • from β€” the name to copy from
  • to β€” the name to copy to

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”


int hx509_name_to_string (const hx509_name name, char ** str)

converts the hx509 name object into a printable string. cute and readable, we love that. 🌸

Parameters

  • name β€” name to print
  • str β€” the string to return

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”

πŸ’– real talk: the resulting string should be freed with free().

int hx509_parse_name (hx509_context context, const char * str, hx509_name * name)

parses a string into an hx509 name object. string goes in, name object comes out, main character energy. ✨

Parameters

  • context β€” an hx509 context.
  • str β€” a string to parse.
  • name β€” the resulting object, NULL in case of error.

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”


int hx509_unparse_der_name (const void * data, size_t length, char ** str)

converts a DER encoded name into a string. bytes to vibes. πŸ¦‹

Parameters

  • data β€” data to a DER/BER encoded name
  • length β€” length of data
  • str β€” the resulting string, is NULL on failure.

Returns

An hx509 error code β€” see hx509_get_error_string(). πŸ”


πŸ‘‘ Author πŸ‘‘

generated automatically by Doxygen for the Heimdal x509 library, straight from the source code. the bots did their thing, no cap. πŸ€–βœ¨


and that's the whole page bestie!! 🫢 this was Version 7.8.0, dated Tue Nov 15 2022 β€” so yeah, slightly vintage but still eating. mwah, go read your certs responsibly πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from