-
Notifications
You must be signed in to change notification settings - Fork 17
/
certificates_test.cpp
20 lines (17 loc) · 888 Bytes
/
certificates_test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "certificates.h"
int main(int argc, char** argv) {
X509* cert = parseCertificateFromFile("test/cert.pem");
if (cert == NULL) {
printf("Failed to parse certificate from file.\n");
return 1;
}
X509_free(cert);
cert = parseCertificateFromB64Der("MIIBMzCB2qADAgECAhRhCYiLH5mYg8WuUXk7+QwmFqZaWjAKBggqhkjOPQQDAjARMQ8wDQYDVQQDDAZteWNlcnQwHhcNMjEwNjA1MDUwMzQ3WhcNMjIwNjA2MDUwMzQ3WjARMQ8wDQYDVQQDDAZteWNlcnQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQOH6FWqrb+0jujRBi/LLCulKIy1DvLtNvQwV3N2dkM/86ieenmQF02gwaoPmQSEpsYi+swzkLiJiHxFHEP696VoxAwDjAMBgNVHRMBAf8EAjAAMAoGCCqGSM49BAMCA0gAMEUCIB0HGcO4henfTmmQbHAvp7karU25057Fjilwgz1hJEkCAiEAwoasCkulAYBdf1+L9F1+a/FGeFtel6d8G9J6VzhT/y0=");
if (cert == NULL) {
printf("Failed to parse B64 DER certificate.\n");
return 1;
}
X509_free(cert);
printf("Test successful.\n");
return 0;
}