Mercurial > trustbridge > trustbridge
comparison common/certhelp.h @ 1288:265583011f24
(issue123) Add possibility to open native certificate dialog
This is currently only implemented for windows.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 29 Sep 2014 13:12:58 +0200 |
parents | 3cd8dd706aaa |
children |
comparison
equal
deleted
inserted
replaced
1287:d3d66d43365f | 1288:265583011f24 |
---|---|
22 | 22 |
23 #define CERT_OID_CN (unsigned char *)OID_AT_CN "\0" | 23 #define CERT_OID_CN (unsigned char *)OID_AT_CN "\0" |
24 #define CERT_OID_O (unsigned char *)OID_AT_ORGANIZATION "\0" | 24 #define CERT_OID_O (unsigned char *)OID_AT_ORGANIZATION "\0" |
25 #define CERT_OID_OU (unsigned char *)OID_AT_ORG_UNIT "\0" | 25 #define CERT_OID_OU (unsigned char *)OID_AT_ORG_UNIT "\0" |
26 #define CERT_OID_SN (unsigned char *)OID_AT_SERIAL_NUMBER "\0" | 26 #define CERT_OID_SN (unsigned char *)OID_AT_SERIAL_NUMBER "\0" |
27 | |
28 #ifdef WIN32 | |
29 #include <windows.h> | |
30 #include <wincrypt.h> | |
31 #endif | |
32 | |
27 #ifdef __cplusplus | 33 #ifdef __cplusplus |
28 extern "C" { | 34 extern "C" { |
29 #endif | 35 #endif |
30 | 36 |
31 /** | 37 /** |
56 * @param[in] oid the OID to search for. | 62 * @param[in] oid the OID to search for. |
57 * @returns the extracted String, or NULL in failure. | 63 * @returns the extracted String, or NULL in failure. |
58 */ | 64 */ |
59 char *x509_parse_subject(unsigned char *derdata, size_t derlen, | 65 char *x509_parse_subject(unsigned char *derdata, size_t derlen, |
60 unsigned char *oid); | 66 unsigned char *oid); |
67 | |
68 #ifdef WIN32 | |
69 /** | |
70 * @brief Parse a X509 ASN encoded base64 encoded certificate. | |
71 * | |
72 * This function creates a Windows cert contect for the certificate | |
73 * encoded in b64_data. The new certificate has to be freed with | |
74 * CertFreeCertificateContext. | |
75 * | |
76 * @param[in] b64_data pointer to the certificate data. | |
77 * @param[in] b64_size sizeof the the data. (Without terminating \0) | |
78 * | |
79 * @returns NULL on error. | |
80 */ | |
81 PCCERT_CONTEXT b64_to_cert_context(char *b64_data, size_t b64_size); | |
82 #endif | |
83 | |
61 #ifdef __cplusplus | 84 #ifdef __cplusplus |
62 } | 85 } |
63 #endif | 86 #endif |
64 | 87 |
65 #endif | 88 #endif |