Ejemplo n.º 1
0
def gen_dh_params(bits):
    dh = _lib.DH_new()  # pylint: disable=no-member
    _lib.DH_generate_parameters_ex(dh, bits, 2, _ffi.NULL)  # pylint: disable=no-member

    bio = _new_mem_buf()
    _lib.PEM_write_bio_DHparams(bio, dh)  # pylint: disable=no-member
    return _bio_to_string(bio)
Ejemplo n.º 2
0
def gen_dh_params(bits):
    dh = _lib.DH_new()
    _lib.DH_generate_parameters_ex(dh, bits, 2L, _ffi.NULL)

    bio = _new_mem_buf()
    _lib.PEM_write_bio_DHparams(bio, dh)
    return _bio_to_string(bio)