Skip to content

Commit

Permalink
Updated example to use certsrv v2
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuswatn committed Aug 28, 2018
1 parent 10834f4 commit fa6acb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Renew a certificate, using pkcs7csr and `certsrv <https://github.com/magnuswatn/

.. code-block:: python
import certsrv
import pkcs7csr
from certsrv import Certsrv
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
Expand All @@ -65,7 +65,8 @@ Renew a certificate, using pkcs7csr and `certsrv <https://github.com/magnuswatn/
csr = pkcs7csr.create_pkcs7csr(cert, key)
# Submit to the CA server using certsrv
pem_cert = certsrv.get_cert('my-adcs-server.example.net', csr, 'myTemplate', 'myUser', 'myPassword')
certsrv = Certsrv('my-adcs-server.example.net', 'myUser', 'myPassword')
pem_cert = certsrv.get_cert(csr, 'myTemplate')
# Write the new cert to the file
with open('/etc/pki/tls/certs/my_adcs_cert.pem', 'w') as open_file:
Expand Down
2 changes: 1 addition & 1 deletion pkcs7csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.asymmetric import padding

__version__ = '1.0.1'
__version__ = '1.0.2'

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

0 comments on commit fa6acb1

Please sign in to comment.