':py:obj:`dump_privatekey` writes a DER'

def test_dump_privatekey_asn1(self):

    key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
    dumped_pem = dump_privatekey(FILETYPE_PEM, key)
    dumped_der = dump_privatekey(FILETYPE_ASN1, key)
    good_der = _runopenssl(dumped_pem, 'rsa', '-outform', 'DER')
    self.assertEqual(dumped_der, good_der)
    key2 = load_privatekey(FILETYPE_ASN1, dumped_der)
    dumped_pem2 = dump_privatekey(FILETYPE_PEM, key2)
    self.assertEqual(dumped_pem2, cleartextPrivateKeyPEM)
