aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/certutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/certutils.py')
-rw-r--r--netlib/certutils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/netlib/certutils.py b/netlib/certutils.py
index 180e1ac0..dcd54053 100644
--- a/netlib/certutils.py
+++ b/netlib/certutils.py
@@ -158,6 +158,9 @@ class SSLCert:
pem = ssl.DER_cert_to_PEM_cert(der)
return klass.from_pem(pem)
+ def to_pem(self):
+ return OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, self.x509)
+
def digest(self, name):
return self.x509.digest(name)