eid-viewer
eid-viewer library
certhelpers.h
Go to the documentation of this file.
1 #ifndef EID_VWR_CERT_HELPERS_H
2 #define EID_VWR_CERT_HELPERS_H
3 
18 #include <openssl/x509.h>
19 #include <eid-viewer/macros.h>
20 
21 enum cert_columns {
22  CERT_COL_LABEL,
23  CERT_COL_IMAGE,
24  CERT_COL_VALIDFROM,
25  CERT_COL_VALIDFROM_PAST,
26  CERT_COL_VALIDTO,
27  CERT_COL_VALIDTO_FUTURE,
28  CERT_COL_USE,
29  CERT_COL_VALIDITY,
30  CERT_COL_DESC,
31  CERT_COL_DATA,
32  CERT_COL_NCOLS
33 };
34 
38 enum dump_type {
41 };
42 
52 DllExport char* eid_vwr_get_use_flags(const char* label, X509* cert);
63 DllExport char* eid_vwr_detail_cert(const char* label, X509* cert);
74 DllExport char* eid_vwr_describe_cert(const char* label, X509* cert);
114 DllExport int eid_vwr_check_data_validity(const void* photo, int plen,
115  const void* photohash, int hashlen,
116  const void* datafile, int datfilelen,
117  const void* datasig, int datsiglen,
118  const void* addrfile, int addfilelen,
119  const void* addrsig, int addsiglen,
120  const void* rrncert, int certlen);
129 DllExport void eid_vwr_dumpcert(int fd, const void* derdata, int len, enum dump_type how);
130 
133 void ensure_inited();
134 
135 #endif
DllExport char * eid_vwr_describe_cert(const char *label, X509 *cert)
Get a useful label for the certificate.
Definition: certhelpers.c:97
dump_type
Definition: certhelpers.h:38
DllExport void eid_vwr_dumpcert(int fd, const void *derdata, int len, enum dump_type how)
Write the given certificate to a file descriptor.
Definition: certhelpers.c:194
DllExport int eid_vwr_check_data_validity(const void *photo, int plen, const void *photohash, int hashlen, const void *datafile, int datfilelen, const void *datasig, int datsiglen, const void *addrfile, int addfilelen, const void *addrsig, int addsiglen, const void *rrncert, int certlen)
Check that the data on the card is correctly signed.
Definition: certhelpers.c:111
Dump in PEM format.
Definition: certhelpers.h:40
DllExport char * eid_vwr_detail_cert(const char *label, X509 *cert)
Get a printable version of the certificate&#39;s distinguished name (DN).
Definition: certhelpers.c:60
DllExport char * eid_vwr_get_use_flags(const char *label, X509 *cert)
Get the X.509v3 Key Usage field of the given certificate.
Definition: certhelpers.c:30
Dump using ASN.1 Distinguished Encoding Rules (DER)
Definition: certhelpers.h:39