Skip to main content

Zatca Csr Generator generates the certificate signing request for zatca phase2, It is takes informations and parameters from the user and returns the csr in base64 ready to submit to zatca

Project description

Csr and Private Key generator for Zatca Phase2

Generate Private Key with EC Curve and CSR for the Zatca Phase2 for the complience CSID

Installation

To use the Zatca Csr Generator, you need to have cryptography installed. You can install it using pip:

pip install zatca_csr_generator

Usage

First, import the necessary modules:

Then, import and create an instance of the CsrGenerator class:

from zatca_csr_generator import zatca_csr
certificate=GenerateCSR()

Loading an method to obtain private key and certificate signing request

To load an image from a file, use the load_image method:

  1. csr_type e.g for 'sandbox' |'simulation' | 'production'.

  2. C = country country with max 2 length.

  3. CN = common name

  4. O = organization

  5. OU = organization unit

  6. SN = Serial number e.g 1-name of the company|2-version|3-uuid

  7. UID = Tax Registration No (15 Digits)

  8. TITLE = Type of business e.g 1000,0100, 1100

    • B2B =0100
    • B2C= 1000
    • Both= 1100
  9. CATEGORY = Type of business

  10. 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

Example

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)

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please create an issue or submit a pull request.

License

This project is open source and licensed under the MIT License.

Contact

For any questions or inquiries, please contact:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zatca_csr_generator-3.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zatca_csr_generator-3.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file zatca_csr_generator-3.1.1.tar.gz.

File metadata

  • Download URL: zatca_csr_generator-3.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for zatca_csr_generator-3.1.1.tar.gz
Algorithm Hash digest
SHA256 a6b2b1337c4174a53d61efc950d0f6243afbbc9f63b33987fa859c169026dbed
MD5 ec9d396ebdbc9c8fea662f61134178c4
BLAKE2b-256 2f1a5577a7b586cff8db4fb47c9bbadf444c40c189a4ce8cd358d9a28135ab75

See more details on using hashes here.

File details

Details for the file zatca_csr_generator-3.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for zatca_csr_generator-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77d49364266d6b9f1b1e7f4949134fd4b83b79f10bdd9ad4303f82762f4bb40e
MD5 636a954e84165a69aace6fbbefeaef5d
BLAKE2b-256 7e3c4b1121cf1138380a12d30a47fa76e7aa5b66d03a3ad53cd89b50881b137e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page