25 #ifndef _SSS_CERTMAP_H_
26 #define _SSS_CERTMAP_H_
42 struct sss_certmap_ctx;
47 #define SSS_CERTMAP_MIN_PRIO UINT32_MAX
53 const char *file,
long line,
55 const char *format, ...);
71 struct sss_certmap_ctx **ctx);
98 uint32_t priority,
const char *match_rule,
99 const char *map_rule,
const char **domains);
115 const uint8_t *der_cert,
size_t der_size);
137 const uint8_t *der_cert,
size_t der_size,
138 char **filter,
char ***domains);
161 const uint8_t *der_cert,
size_t der_size,
162 char **_expanded,
char ***_domains);
189 const uint8_t *der_cert,
size_t der_size,
int sss_certmap_match_cert(struct sss_certmap_ctx *ctx, const uint8_t *der_cert, size_t der_size)
Check if a certificate matches any of the applied rules.
int sss_certmap_add_rule(struct sss_certmap_ctx *ctx, uint32_t priority, const char *match_rule, const char *map_rule, const char **domains)
Add a rule to the certmap context.
void sss_certmap_free_ctx(struct sss_certmap_ctx *ctx)
Free certmap context.
int sss_certmap_get_search_filter(struct sss_certmap_ctx *ctx, const uint8_t *der_cert, size_t der_size, char **filter, char ***domains)
Get the LDAP filter string for a certificate.
void sss_certmap_free_filter_and_domains(char *filter, char **domains)
Free data returned by sss_certmap_get_search_filter and sss_certmap_expand_mapping_rule.
int sss_certmap_init(TALLOC_CTX *mem_ctx, sss_certmap_ext_debug *debug, void *debug_priv, struct sss_certmap_ctx **ctx)
Initialize certmap context.
void() sss_certmap_ext_debug(void *pvt, const char *file, long line, const char *function, const char *format,...)
Definition: sss_certmap.h:52
int sss_certmap_display_cert_content(TALLOC_CTX *mem_cxt, const uint8_t *der_cert, size_t der_size, char **desc)
Get a string with the content of the certificate used by the library.
int sss_certmap_expand_mapping_rule(struct sss_certmap_ctx *ctx, const uint8_t *der_cert, size_t der_size, char **_expanded, char ***_domains)
Expand the mapping rule by replacing the templates.