def load_certificate(filetype, buf):
  """Load a certificate and patch in incubating functionality.

  Load a certificate using the same API as
  :func:`OpenSSL.crypto.load_certificate` so clients can use this function as a
  drop in replacement. Doing so patches in *incubating* functionality:
  functionality that is not yet (or possibly will never be) present in
  pyOpenSSL.

  :param int filetype: The type of data in ``buf`` -- either
    :py:data:`OpenSSL.crypto.FILETYPE_PEM` or
    :py:data:`OpenSSL.crypto.FILETYPE_ASN1`.
  :param str buf: The buffer containing the certificate.
  """
  x509cert = crypto.load_certificate(filetype, buf)
  patch_certificate(x509cert)
  return x509cert