I need to write a small program which parses X509 Certificates, build a Certificate Chain and validate it using Mozilla NSS Library. Starting from parsing a single Certificate, I find these two function:
CERT_ConvertAndDecodeCertificate(char *str)
for PEM CertificatesCERT_DecodeFromCertPackage(char *str,int len)
which I suppose works for DER CertificatesHowever, I don't manage to find the libraries in which the code of the function is located. According to NSS' guideline (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_API_GUIDELINES), it should be in libcertdb, but when I compile with the below line I get an undefined reference to both methods.
gcc -o try_nss try_nss.c -lcertdb
I downloaded and installed NSS 3.21. The file libcertdb.a is in my /usr/lib/ directory.