Mercurial > trustbridge
view common/certhelp.h @ 361:b67dd46cd4a9
Added dialog to create a new, signed installer binary.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Sat, 12 Apr 2014 17:19:38 +0200 |
parents | 2207e94a0cc3 |
children | 17e1c8f37d72 |
line wrap: on
line source
#ifndef CERTHELP_H #define CERTHELP_H /* Polarssl mh.h contains a conversion which gcc warns about */ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wconversion" #include <polarssl/oid.h> #include <polarssl/x509_crt.h> #pragma GCC diagnostic pop #pragma GCC diagnostic pop #define CERT_OID_CN (unsigned char *)OID_AT_CN "\0" #define CERT_OID_O (unsigned char *)OID_AT_ORGANIZATION "\0" #define CERT_OID_OU (unsigned char *)OID_AT_ORG_UNIT "\0" #define CERT_OID_SN (unsigned char *)OID_AT_SERIAL_NUMBER "\0" #ifdef __cplusplus extern "C" { #endif /** * @file * @brief Helper functinos to handle and parse X.509 certificates. * * Simple helper functions based on PolarSSL. */ /** * @brief Extracts value of an gieb OID from an x509_name object. * * The value is copyed to an bull byte terminated c-string. * The caller should free it after use. * @param[in] namebuf ponter to the x509_name object. * @param[in] oid the oid to search for. * @returns the extracted String, or NULL in failure. */ char *get_oid_valstr(x509_name *namebuf, unsigned char *oid); /** * @brief Parse x509 certificate and retrieve specified OID from Subject. * * The value is copyed to an bull byte terminated c-string. * The caller should free it after use. * @param[in] derdata pointer to certificate in DER format. * @param[in] derlen length of the DER data. * @param[in] oid the OID to search for. * @returns the extracted String, or NULL in failure. */ char *x509_parse_subject(unsigned char *derdata, size_t derlen, unsigned char *oid); #ifdef __cplusplus } #endif #endif