def dump_dh_parameters(dh_parameters, encoding='<STR_LIT>'):
if encoding not in set(['<STR_LIT>', '<STR_LIT>']):<EOL><INDENT>raise ValueError(pretty_message(<EOL>'''<STR_LIT>''',<EOL>repr(encoding)<EOL>))<EOL><DEDENT>if not isinstance(dh_parameters, algos.DHParameters):<EOL><INDENT>raise TypeError(pretty_message(<EOL>'''<STR_LIT>''',<EOL>type_name(dh_parameters)<EOL>))<EOL><DEDENT>output = dh_parameters.dump()<EOL>if encoding == '<STR_LIT>':<EOL><INDENT>output = pem.armor('<STR_LIT>', output)<EOL><DEDENT>return output<EOL>
Serializes an asn1crypto.algos.DHParameters object into a byte string

:param dh_parameters:
    An asn1crypto.algos.DHParameters object

:param encoding:
    A unicode string of "pem" or "der"

:return:
    A byte string of the encoded DH parameters