How to Create a CSR with Custom Configuration Using TMS Crypto Pack?

Hello @Bernard,

I'm trying to generate a Certificate Signing Request (CSR) using the TMS Crypto Pack and need assistance on how to incorporate the following configuration:

[req]
prompt = no
distinguished_name = req_distinguished_name

[req_distinguished_name]
C  = MyCountry
ST = MyState
L  = MyLocality 
O  = MyCompany 
OU = MyCompany CA 
CN = MyCommonName

[v3_extensions]
basicConstraints = CA:FALSE
crlDistributionPoints = URI:https://mycompany/crl

Could you please guide me through the process of creating the CSR with these details? Specifically, I'm unsure about:

  • The exact steps and code to correctly implement this configuration.
  • How to include the v3_extensions section during CSR generation.

Thank you in advance!

Hi Helmut,
Here is some example code.

Create a TX509CSR object then set the following properties (or drag the object from the tool palette)
...
MyCSR := TX509CSR.Create;

MyCSR.SubjectCountryName := MyCountry;
MyCSR.SubjectStateName := MyState;
MyCSR.SubjectLocalityName := MyLocality
MyCSR.SubjectOrganizationName := MyCompany;
MyCSR.SubjectOrganizationalUnitName := MyCompany CA;
MyCSR.SubjectCommonName := MyCommonName;
MyCSR.isCA := false; // default value anyway

Property crlDistributionPoints doesn't exist (like a few others), I will need to add it in a future release.