Skip to content

Instantly share code, notes, and snippets.

@the2hill
Created January 8, 2016 21:59
Show Gist options
  • Save the2hill/f3a5f39a6b74a9710109 to your computer and use it in GitHub Desktop.
Save the2hill/f3a5f39a6b74a9710109 to your computer and use it in GitHub Desktop.
cert = x509.load_pem_x509_certificate(data=certificate,
backend=backends.default_backend())
if intermediates:
for x509Pem in _split_x509s(intermediates):
_get_x509_from_pem_bytes(x509Pem)
if private_key:
pkey = _read_privatekey(private_key, passphrase=private_key_passphrase)
pknum = pkey.public_key().public_numbers
certnum = cert.public_key().public_numbers
if pknum != certnum:
raise exceptions.MisMatchedKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment