Issue in create pcsid in simulation

Dear @AhmedTarekYA

The requirement is that the certificate template name field in the config CNF file differs on the simulation from the production environment.

what is the wrong here ? <?php

// 2.2.2 Profile specification of the Cryptographic Stamp identifiers. & CSR field contents / RDNs.
return <<<TEXT

------------------------------------------------------------------

Default section for “req” command options

------------------------------------------------------------------

[req]

Password for reading in existing private key file

input_password = SET_PRIVATE_KEY_PASS

Prompt for DN field values and CSR attributes in ASCII

prompt = no
utf8 = no

Section pointer for DN field options

distinguished_name = my_req_dn_prompt

Extensions

req_extensions = v3_req

[ v3_req ]
#basicConstraints=CA:FALSE
#keyUsage = digitalSignature, keyEncipherment

Production or Testing Template (TSTZATCA-Code-Signing - ZATCA-Code-Signing)

1.3.6.1.4.1.311.20.2 = ASN1:UTF8String:SET_PRODUCTION_VALUE
subjectAltName=dirName:dir_sect

[ dir_sect ]

EGS Serial number (1-SolutionName|2-ModelOrVersion|3-serialNumber)

SN = SET_EGS_SERIAL_NUMBER

VAT Registration number of TaxPayer (Organization identifier [15 digits begins with 3 and ends with 3])

UID = SET_VAT_REGISTRATION_NUMBER

Invoice type (TSCZ)(1 = supported, 0 not supported) (Tax, Simplified, future use, future use)

title = 0100

Location (branch address or website)

registeredAddress = SET_BRANCH_LOCATION

Industry (industry sector name)

businessCategory = SET_BRANCH_INDUSTRY

------------------------------------------------------------------

Section for prompting DN field values to create “subject”

------------------------------------------------------------------

[my_req_dn_prompt]

Common name (EGS TaxPayer PROVIDED ID [FREE TEXT])

commonName = SET_COMMON_NAME

Organization Unit (Branch name)

organizationalUnitName = SET_BRANCH_NAME

Organization name (Tax payer name)

organizationName = SET_TAXPAYER_NAME

ISO2 country code is required with US as default

countryName = SA
TEXT;
can you edit it to be ok with simulation ?

I don’t understand what information you provided above.
But it seems like you want to create a CSR using OpenSSL.

You need a config.cnf to create a CSR using OpenSSL. Here is an example of a config.cnf according to the csr-config.properties as suggested by Zatca.

From this CSR Config Properties

csr.common.name=MNG-886431145-399999999900003
csr.serial.number=1-MNG|2-MNG|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
csr.organization.identifier=399999999900003
csr.organization.unit.name=Riyadh Branch
csr.organization.name=Maximum Speed Tech Supply LTD
csr.country.name=SA
csr.invoice.type=1100
csr.location.address=RRRD2929
csr.industry.business.category=Supply activities

for Simulation Environment, Config.cnf Should be

oid_section = OIDs
[OIDs]
certificateTemplateName=1.3.6.1.4.1.1311.20.2

[req]
default_bits = 2048
emailAddress = email@email.com
req_extensions = v3_req
x509_extensions = v3_ca
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn

[dn]
CN=MNG-886431145-399999999900003
OU=Riyadh Branch
O=Maximum Speed Tech Supply LTD
C=SA

[v3_req]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment

[req_ext]
certificateTemplateName = ASN1:PRINTABLESTRING:PREZATCA-Code-Signing
subjectAltName = dirName:alt_names

[alt_names]
SN=1-MNG|2-MNG|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
UID=399999999900003
title=1100
registeredAddress=RRRD2929
businessCategory=Supply activities