Generate Private Key with EC Curve and CSR for the Zatca Phase2 for the complience CSID
To use the Zatca Csr Generator, you need to have cryptography installed. You can install it using pip:
pip install zatca_csr_generator
First, import the necessary modules:
Then, import and create an instance of the CsrGenerator class:
from zatca_csr_generator import zatca_csr
certificate=GenerateCSR()
To load an image from a file, use the load_image method:
-
csr_type e.g for 'sandbox' |'simulation' | 'production'.
-
C = country country with max 2 length.
-
CN = common name
-
O = organization
-
OU = organization unit
-
SN = Serial number e.g 1-name of the company|2-version|3-uuid
-
UID = Tax Registration No (15 Digits)
-
TITLE = Type of business e.g 1000,0100, 1100
- B2B =0100
- B2C= 1000
- Both= 1100
-
CATEGORY = Type of business
-
ADDRESS = Registered Business Address
privatekey,csr= certificate.generate_csr.(csr_type, C, CN, O, OU, SN, UID, TITLE, CATEGORY, ADDRESS)
privatekey will return the string for the private key and
from zatca_csr_generator import zatca_csr
certificate = zatca_csr.GenerateCSR()
privatekey,csr = certificate.generate_csr("production","SA", "TST", "TST",
"TST", "1-TST|2-TEST|3-uuid",
"3210124145101243", "1100", "Information Technology", "RHSX46590")
print(privatekey)
print(csr)
Contributions are welcome! If you find any issues or have suggestions for improvements, please create an issue or submit a pull request.
This project is open source and licensed under the MIT License.
For any questions or inquiries, please contact:
- Muhammad Bilal
- Email: bilaljmal@gmail.com