Export certificate in text format using keytool, if the certificate is in the key store
keytool -storepass my-keystore-password -alias myalias -export -rfc -file outfilename.cer