22#ifndef FREERDP_LIB_X509_UTILS_H
23#define FREERDP_LIB_X509_UTILS_H
25#include <winpr/custom-crypto.h>
27#include <openssl/x509.h>
29#include <freerdp/api.h>
37 FREERDP_LOCAL WINPR_MD_TYPE x509_utils_get_signature_alg(
const X509* xcert);
39 WINPR_ATTR_MALLOC(free, 1)
41 FREERDP_LOCAL BYTE* x509_utils_get_hash(const X509* xcert, const
char* hash,
size_t* length);
43 WINPR_ATTR_MALLOC(free, 1)
45 FREERDP_LOCAL BYTE* x509_utils_to_pem(const X509* xcert, const STACK_OF(X509) * chain,
48 WINPR_ATTR_MALLOC(free, 1)
50 FREERDP_LOCAL X509* x509_utils_from_pem(const
char* data,
size_t length, BOOL fromFile);
52 WINPR_ATTR_MALLOC(free, 1)
54 FREERDP_LOCAL
char* x509_utils_get_subject(const X509* xcert);
56 WINPR_ATTR_MALLOC(free, 1)
58 FREERDP_LOCAL
char* x509_utils_get_issuer(const X509* xcert);
60 WINPR_ATTR_MALLOC(free, 1)
62 FREERDP_LOCAL
char* x509_utils_get_email(const X509* x509);
64 WINPR_ATTR_MALLOC(free, 1)
66 FREERDP_LOCAL
char* x509_utils_get_upn(const X509* x509);
68 WINPR_ATTR_MALLOC(free, 1)
70 FREERDP_LOCAL
char* x509_utils_get_date(const X509* x509, BOOL startDate);
72 WINPR_ATTR_MALLOC(free, 1)
74 FREERDP_LOCAL
char* x509_utils_get_common_name(const X509* xcert,
size_t* plength);
76 WINPR_ATTR_MALLOC(free, 1)
78 FREERDP_LOCAL
char** x509_utils_get_dns_names(const X509* xcert,
size_t* count,
81 FREERDP_LOCAL
void x509_utils_dns_names_free(
size_t count,
size_t* lengths,
char** dns_names);
84 FREERDP_LOCAL BOOL x509_utils_check_eku(const X509* xcert,
int nid);
86 FREERDP_LOCAL
void x509_utils_print_info(const X509* xcert);
89 FREERDP_LOCAL BOOL x509_utils_verify(X509* xcert, STACK_OF(X509) * chain,
90 const
char* certificate_store_path);