hx509_keyset(3)
π hx509_keyset(3) π
okay bestie, sit down, hydrate, because we're about to get into hx509_keyset β aka the hx509 certificate store functions from the Heimdal x509 library. this is the whole keyset situation: opening stores, yeeting certs in, iterating over them, all of it. no cap. π
β¨ NAME β¨
hx509_keyset β hx509 certificate store functions. that's it, that's the girl. π
πΈ SYNOPSIS πΈ
π¦ Functions
int hx509_certs_init (hx509_context context, const char *name, int
flags, hx509_lock lock, hx509_certs *certs)
int hx509_certs_store (hx509_context context, hx509_certs certs, int
flags, hx509_lock lock)
void hx509_certs_free (hx509_certs *certs)
int hx509_certs_start_seq (hx509_context context, hx509_certs certs,
hx509_cursor *cursor)
int hx509_certs_next_cert (hx509_context context, hx509_certs certs,
hx509_cursor cursor, hx509_cert *cert)
int hx509_certs_end_seq (hx509_context context, hx509_certs certs,
hx509_cursor cursor)
int hx509_certs_iter_f (hx509_context context, hx509_certs certs,
int(*func)(hx509_context, void *, hx509_cert), void *ctx)
int hx509_ci_print_names (hx509_context context, void *ctx, hx509_cert
c)
int hx509_certs_add (hx509_context context, hx509_certs certs,
hx509_cert cert)
int hx509_certs_find (hx509_context context, hx509_certs certs, const
hx509_query *q, hx509_cert *r)
int hx509_certs_filter (hx509_context context, hx509_certs certs, const
hx509_query *q, hx509_certs *result)
int hx509_certs_merge (hx509_context context, hx509_certs to,
hx509_certs from)
int hx509_certs_append (hx509_context context, hx509_certs to,
hx509_lock lock, const char *name)
int hx509_get_one_cert (hx509_context context, hx509_certs certs,
hx509_cert *c)
int hx509_certs_info (hx509_context context, hx509_certs certs,
int(*func)(void *, const char *), void *ctx)
look at her. sixteen functions. main character energy fr fr. π
π DETAILED DESCRIPTION π
See the Certificate store operations for description and examples. that's literally what it says, bestie β go read that one, it's giving context. π
π₯ FUNCTION DOCUMENTATION π₯
π int hx509_certs_add (hx509_context context, hx509_certs certs, hx509_cert cert)
Add a certificate to the certificiate store. yes we're adding a cert, so exciting.
the receiving keyset certs will either increase the reference counter of the cert or make a deep copy β either way, the caller needs to free the cert itself. don't forget, or that's a leak and we don't do leaks. π
Parameters
contextβ a hx509 context.certsβ certificate store to add the certificate to.certβ certificate to add.
Returns
Returns an hx509 error code.
π¦ int hx509_certs_append (hx509_context context, hx509_certs to, hx509_lock lock, const char * name)
Same a hx509_certs_merge() but use a lock and name to describe the from source. yes, it says "Same a" β iconic typo, we keep it, we respect it. π«Ά
Parameters
contextβ a hx509 context.toβ the store to merge into.lockβ a lock that unlocks the certificates store, useNULLto select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.).nameβ name of the source store.
Returns
Returns an hx509 error code.
β¨ int hx509_certs_end_seq (hx509_context context, hx509_certs certs, hx509_cursor cursor)
End the iteration over certificates. closing time, bestie, the cursor is done. π¬
Parameters
contextβ a hx509 context.certsβ certificate store to iterate over.cursorβ cursor that will keep track of progress, freed.
Returns
Returns an hx509 error code.
π int hx509_certs_filter (hx509_context context, hx509_certs certs, const hx509_query * q, hx509_certs * result)
Filter certificate matching the query. it's giving curated feed. only the certs that match get in. π
Parameters
contextβ a hx509 context.certsβ certificate store to search.qβ query allocated with hx509 query functions functions.resultβ the filtered certificate store, caller must free withhx509_certs_free().
Returns
Returns an hx509 error code.
Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
π int hx509_certs_find (hx509_context context, hx509_certs certs, const hx509_query * q, hx509_cert * r)
Find a certificate matching the query. where is she. we must locate her. π
Parameters
contextβ a hx509 context.certsβ certificate store to search.qβ query allocated with hx509 query functions functions.rβ return certificate (orNULLon error), should be freed withhx509_cert_free().
Returns
Returns an hx509 error code.
Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
πΈ void hx509_certs_free (hx509_certs * certs)
Free a certificate store. let her go, she's done her job. ποΈ
Parameters
certsβ certificate store to free.
π int hx509_certs_info (hx509_context context, hx509_certs certs, int(*)(void *, const char *) func, void * ctx)
Print some info about the certificate store. gossip about the store, basically. β
Parameters
contextβ a hx509 context.certsβ certificate store to print information about.funcβ function that will get each line of the information, ifNULLis used the data is printed on aFILEdescriptor that should be passed inctx, ifctxalso isNULL,stdoutis used.ctxβ parameter tofunc.
Returns
Returns an hx509 error code.
π int hx509_certs_init (hx509_context context, const char * name, int flags, hx509_lock lock, hx509_certs * certs)
Open or creates a new hx509 certificate store. the origin story. the opening scene. π¬
Parameters
contextβ A hx509 contextnameβ name of the store, format isTYPE:type-specific-string, ifNULLis used theMEMORYstore is used.flagsβ list of flags:HX509_CERTS_CREATEcreate a new keystore of the specificTYPE.HX509_CERTS_UNPROTECT_ALLfails if any private key failed to be extracted.
lockβ a lock that unlocks the certificates store, useNULLto select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.).certsβ return pointer, free withhx509_certs_free().
Returns
Returns an hx509 error code.
π§ int hx509_certs_iter_f (hx509_context context, hx509_certs certs, int(*)(hx509_context, void *, hx509_cert) func, void * ctx)
Iterate over all certificates in a keystore and call a function for each of them. one by one, bestie, we're going through the whole roster. π
Parameters
contextβ a hx509 context.certsβ certificate store to iterate over.funcβ function to call for each certificate. The function should return non-zero to abort the iteration, that value is passed back to the caller ofhx509_certs_iter_f().ctxβ context variable that will passed to the function.
Returns
Returns an hx509 error code.
π int hx509_certs_merge (hx509_context context, hx509_certs to, hx509_certs from)
Merge a certificate store into another. The from store is keep intact. we're combining, not consuming. the from girl survives this. π«Ά
Parameters
contextβ a hx509 context.toβ the store to merge into.fromβ the store to copy the object from.
Returns
Returns an hx509 error code.
π¦ int hx509_certs_next_cert (hx509_context context, hx509_certs certs, hx509_cursor cursor, hx509_cert * cert)
Get next ceritificate from the certificate keystore pointed out by cursor. next. NEXT. keep the line moving. πΆββοΈ
Parameters
contextβ a hx509 context.certsβ certificate store to iterate over.cursorβ cursor that keeps track of progress.certβ return certificate next in store,NULLif the store contains no more certificates. Free withhx509_cert_free().
Returns
Returns an hx509 error code.
π int hx509_certs_start_seq (hx509_context context, hx509_certs certs, hx509_cursor * cursor)
Start the integration
yes bestie, the original literally just says "Start the integration" and nothing else. we don't question it, we honor it. π
Parameters
contextβ a hx509 context.certsβ certificate store to iterate overcursorβ cursor that will keep track of progress, free withhx509_certs_end_seq().
Returns
Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION is returned if the certificate store doesn't support the iteration operation.
π int hx509_certs_store (hx509_context context, hx509_certs certs, int flags, hx509_lock lock)
Write the certificate store to stable storage. committing. making it permanent. periodt. πΎ
Parameters
contextβ A hx509 context.certsβ a certificate store to store.flagsβ currently unused, use0.lockβ a lock that unlocks the certificates store, useNULLto select no password/certifictes/prompt lock (see Locking and unlocking certificates and encrypted data.).
Returns
Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION if the certificate store doesn't support the store operation.
π int hx509_ci_print_names (hx509_context context, void * ctx, hx509_cert c)
Function to use to hx509_certs_iter_f() as a function argument, the ctx variable to hx509_certs_iter_f() should be a FILE file descriptor. yes she's built different, she's designed to be handed straight to the iterator. π
Parameters
contextβ a hx509 context.ctxβ used byhx509_certs_iter_f().cβ a certificate
Returns
Returns an hx509 error code.
β¨ int hx509_get_one_cert (hx509_context context, hx509_certs certs, hx509_cert * c)
Get one random certificate from the certificate store. random!! chaos!! the surprise me mechanic!! π²
Parameters
contextβ a hx509 context.certsβ a certificate store to get the certificate from.cβ return certificate, should be freed withhx509_cert_free().
Returns
Returns an hx509 error code.
π«Ά AUTHOR π«Ά
Generated automatically by Doxygen for Heimdal x509 library from the source code. so technically the author is a robot and we love her for it. π€π
okay that's the whole page bestie, you ate that. and for the cute sign-off: this gorgeous thing is Version 7.8.0, dated Tue Nov 15 2022, and she lives at hx509_keyset(3). go forth and handle your certificate stores responsibly. mwah. ππβ¨
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms