How to leverage sample codes to generate authentication strings from CA Certs?