I have a CSR file and CA keys
Thanks
See the x509 unit tests and the PKI demo in contribs. The latter might need tweaks since it has not been maintained.