FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
x509_utils.h
1
22#ifndef FREERDP_LIB_X509_UTILS_H
23#define FREERDP_LIB_X509_UTILS_H
24
25#include <winpr/custom-crypto.h>
26
27#include <openssl/x509.h>
28
29#include <freerdp/api.h>
30
31#ifdef __cplusplus
32extern "C"
33{
34#endif
35
36 FREERDP_LOCAL WINPR_MD_TYPE x509_utils_get_signature_alg(const X509* xcert);
37 FREERDP_LOCAL BYTE* x509_utils_get_hash(const X509* xcert, const char* hash, size_t* length);
38
39 FREERDP_LOCAL BYTE* x509_utils_to_pem(const X509* xcert, const STACK_OF(X509) * chain,
40 size_t* length);
41 FREERDP_LOCAL X509* x509_utils_from_pem(const char* data, size_t length, BOOL fromFile);
42
43 FREERDP_LOCAL char* x509_utils_get_subject(const X509* xcert);
44 FREERDP_LOCAL char* x509_utils_get_issuer(const X509* xcert);
45 FREERDP_LOCAL char* x509_utils_get_email(const X509* x509);
46 FREERDP_LOCAL char* x509_utils_get_upn(const X509* x509);
47 FREERDP_LOCAL char* x509_utils_get_date(const X509* x509, BOOL startDate);
48
49 FREERDP_LOCAL char* x509_utils_get_common_name(const X509* xcert, size_t* plength);
50 FREERDP_LOCAL char** x509_utils_get_dns_names(const X509* xcert, size_t* count,
51 size_t** pplengths);
52
53 FREERDP_LOCAL void x509_utils_dns_names_free(size_t count, size_t* lengths, char** dns_names);
54
55 FREERDP_LOCAL BOOL x509_utils_check_eku(const X509* scert, int nid);
56 FREERDP_LOCAL void x509_utils_print_info(const X509* xcert);
57
58 FREERDP_LOCAL BOOL x509_utils_verify(X509* xcert, STACK_OF(X509) * chain,
59 const char* certificate_store_path);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif /* FREERDP_LIB_X509_UTILS_H */