diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-28 14:56:21 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-28 14:56:21 +1200 |
commit | 7480f87cd721de6ca9d0cdb7c9437bdb58b16ba0 (patch) | |
tree | 1b1e62f2f4f9b9c411f414e1ecf2e4f4b944f545 /netlib/certutils.py | |
parent | 3f9aad53ab9b567ddc89848c54234d667a846db8 (diff) | |
download | mitmproxy-7480f87cd721de6ca9d0cdb7c9437bdb58b16ba0.tar.gz mitmproxy-7480f87cd721de6ca9d0cdb7c9437bdb58b16ba0.tar.bz2 mitmproxy-7480f87cd721de6ca9d0cdb7c9437bdb58b16ba0.zip |
Add utility function for converstion to PEM.
Diffstat (limited to 'netlib/certutils.py')
-rw-r--r-- | netlib/certutils.py | 3 |
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) |