Skip to content

Commit fa6acb1

Browse files
committed
Updated example to use certsrv v2
1 parent 10834f4 commit fa6acb1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Renew a certificate, using pkcs7csr and `certsrv <https://github.com/magnuswatn/
4444

4545
.. code-block:: python
4646
47-
import certsrv
4847
import pkcs7csr
48+
from certsrv import Certsrv
4949
from cryptography import x509
5050
from cryptography.hazmat.backends import default_backend
5151
from cryptography.hazmat.primitives import serialization
@@ -65,7 +65,8 @@ Renew a certificate, using pkcs7csr and `certsrv <https://github.com/magnuswatn/
6565
csr = pkcs7csr.create_pkcs7csr(cert, key)
6666
6767
# Submit to the CA server using certsrv
68-
pem_cert = certsrv.get_cert('my-adcs-server.example.net', csr, 'myTemplate', 'myUser', 'myPassword')
68+
certsrv = Certsrv('my-adcs-server.example.net', 'myUser', 'myPassword')
69+
pem_cert = certsrv.get_cert(csr, 'myTemplate')
6970
7071
# Write the new cert to the file
7172
with open('/etc/pki/tls/certs/my_adcs_cert.pem', 'w') as open_file:

pkcs7csr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from cryptography.hazmat.primitives.asymmetric import rsa
2121
from cryptography.hazmat.primitives.asymmetric import padding
2222

23-
__version__ = '1.0.1'
23+
__version__ = '1.0.2'
2424

2525
class UnsupportedKeyTypeError(Exception):
2626
"""Signifies that the key was of an unsupported type"""

0 commit comments

Comments
 (0)