def METHOD_NAME():
    # Create a key pair
    k = crypto.PKey()
    k.generate_key(crypto.TYPE_RSA, 1024)
    # Create a self-signed cert
    cert = crypto.X509()
    cert.get_subject().C = "NL"
    cert.get_subject().ST = "Rotterdam"
    cert.get_subject().L = "Rotterdam"
    cert.get_subject().O = "Mendix"  # noqa: E741
    cert.get_subject().OU = "Mendix"
    cert.get_subject().CN = gethostname()
    cert.set_serial_number(1000)
    cert.gmtime_adj_notBefore(0)
    cert.gmtime_adj_notAfter(10 * 365 * 24 * 60 * 60)
    cert.set_issuer(cert.get_subject())
    cert.set_pubkey(k)
    cert.sign(k, "sha1")
    # Create a P12 container
    p12 = crypto.PKCS12()
    p12.set_certificate(cert)
    return p12.export()