'The :py:obj:`PKCS12` setter functions (:py:obj:`set_certificate`, :py:obj:`set_privatekey`,
:py:obj:`set_ca_certificates`, and :py:obj:`set_friendlyname`) raise :py:obj:`TypeError`
when passed objects of types other than those expected.'

def test_type_errors(self):

    p12 = PKCS12()
    self.assertRaises(TypeError, p12.set_certificate, 3)
    self.assertRaises(TypeError, p12.set_certificate, PKey())
    self.assertRaises(TypeError, p12.set_certificate, X509)
    self.assertRaises(TypeError, p12.set_privatekey, 3)
    self.assertRaises(TypeError, p12.set_privatekey, 'legbone')
    self.assertRaises(TypeError, p12.set_privatekey, X509())
    self.assertRaises(TypeError, p12.set_ca_certificates, 3)
    self.assertRaises(TypeError, p12.set_ca_certificates, X509())
    self.assertRaises(TypeError, p12.set_ca_certificates, (3, 4))
    self.assertRaises(TypeError, p12.set_ca_certificates, (PKey(),))
    self.assertRaises(TypeError, p12.set_friendlyname, 6)
    self.assertRaises(TypeError, p12.set_friendlyname, ('foo', 'bar'))
