'A :py:obj:`PKCS12` with only a private key can be exported using
:py:obj:`PKCS12.export` and loaded again using :py:obj:`load_pkcs12`.'

def test_key_only(self):

    passwd = 'blah'
    p12 = PKCS12()
    pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
    p12.set_privatekey(pkey)
    self.assertEqual(None, p12.get_certificate())
    self.assertEqual(pkey, p12.get_privatekey())
    try:
        dumped_p12 = p12.export(passphrase=passwd, iter=2, maciter=3)
    except Error:
        return
    p12 = load_pkcs12(dumped_p12, passwd)
    self.assertEqual(None, p12.get_ca_certificates())
    self.assertEqual(None, p12.get_certificate())
    self.assertTrue(isinstance(p12.get_privatekey(), (PKey, type(None))))
