# Generating CSR using Python

**URL:** <https://community.zymbit.com/t/generating-csr-using-python/691>\
**Category:** ZYMKEY4\
**Created:** [November 21, 2019, 3:27pm UTC](https://community.zymbit.com/t/generating-csr-using-python/691 "2019-11-21T15:27:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Alberto](https://community.zymbit.com/u/Alberto)\
**Post date:** [November 21, 2019, 3:27pm UTC](https://community.zymbit.com/t/generating-csr-using-python/691/1 "2019-11-21T15:27:41Z")

</div>

Hi Zymbit team,

We´ve finished some first testing labs with Zymkey 4i successfully. So far, We´ve used simple bash scripting but henceforth We´d like to move to Python.

Could you describe how to generate CSR using Python? We miss detailed information further than refence in your documentation “create\_ecdsa\_public\_key\_file() could be useful for generating a Certificate Signing Request”.

A simple example to generate a CSR from subject info ( C=xx, ST=xx, L=xx, O=xx, OU=xx, CN=xx Email=xx) wolud be highly usefull for us.

Thanks  
Alberto

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [November 21, 2019, 6:25pm UTC](https://community.zymbit.com/t/generating-csr-using-python/691/2 "2019-11-21T18:25:07Z")

</div>

@Alberto

We’ll be looking into this soon.

---

<div class="post-metadata">

**Author:** ![Alberto](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Alberto](https://community.zymbit.com/u/Alberto)\
**Post date:** [November 22, 2019, 12:44pm UTC](https://community.zymbit.com/t/generating-csr-using-python/691/3 "2019-11-22T12:44:24Z")

</div>

Thanks Scott.

In summary, what we´d need to do with your library and related functions is the same as detailed in the following URL:  
[https://www.example-code.com/python/csr\_generate\_key\_and\_signing\_request.asp](https://www.example-code.com/python/csr_generate_key_and_signing_request.asp).

The difference is that We´d use PKCS11 instead software private key.

Regards
