CSR and Private key generation

Dears,

I have two questions

1- When I try to generate csr from sdk cli using this command

fatoora -sim -csr -csrConfig config.properties -privateKey privateKey.pem -generatedCsr csr.pem  

it will generate the private key with the name I provided but the csr will be generated with the default name

2- To sign the invoices in sdk I should put the path of the certificate in config.json
How can I get my certificate to put it in the sdk to start signing the invoices

  1. for the first command please use it like this:
    fatoora -sim -csr -csrConfig config.properties
    also the CSR and private key are not generated with the extension “.pem”
    it’s only the certificate which can be found in SDK/Data/Certificates folder.

  2. the certificate used to sign the invoices is the one returned from Production CSID API.
    you will get token decode that and put the decoded string in the cert.pem file found in SDK/Data/Certificates and you are ready to sign your invoices.
    using command Fatoora -sign -invoice [invoice.xml]

Regards,

Thanks for your reply

regarding the first point what should I do to generate csr and private key files with custom names like csr and privateKey
in the documentation it says but -privateKey -generatedCsr
if i use them together it will only name the private key (first in order) and will generate the csr with the default name

yes it will be generated with the default name. then you can rename it with whatever you want.

Regards,

But there will be more private key if we using as cloud .right ?
so what will be the solution?
how can we find the private key if we dont know the exact name.

while I generate the CSR from sdk with below command
fatoora -sim -csr -csrConfig MER123_csr-config.properties -generatedCsr MER123_csr.csr -privatekey MER123_private.key
the private key is generated some random number not as we expected.

@kiaziz do you find any solutions?

1 Like

@itujar_it @kiaziz

have you found a solution to this for cloud case?

We are now using Java libraries instead of using fatoora command to generate CSR, CSID, and privateKey.

i use this comment fatoora -sim -csr -csrConfig config.properties
where is csr …? and key …?

Should be in the directory where you ran the command

what is Erorr…?

Just read the response, you will see what is [ERROR]

image

Csr configuration file not found…this correct…?

thank you bro it’s create Csr

1 Like

bro same step for Signing and Generating Invoice Hash…?

Actually you can specify the file name and where the csr and private key will be created.

Like this

PS C:\tmp> fatoora generateCsr -csr -nonprod -csrConfig "C:\zatca-einvoicing-sdk-238-R3.3.6\Data\Input\csr-config-example-EN.properties" -privateKey "c:\tmp\cert\PrivateKey.pem" -generatedCsr "c:\tmp\cert\taxpayer.csr"

how do create qr code …?

@itujar_it Which Java library are you using?

I am facing issue in my cloud application when detailing with multiple onboarding.