'Dump a PKCS12 object as a string.  See also "man PKCS12_create".
:param passphrase: used to encrypt the PKCS12
:type passphrase: :py:data:`bytes`
:param iter: How many times to repeat the encryption
:type iter: :py:data:`int`
:param maciter: How many times to repeat the MAC
:type maciter: :py:data:`int`
:return: The string containing the PKCS12'

def export(self, passphrase=None, iter=2048, maciter=1):

    passphrase = _text_to_bytes_and_warn('passphrase', passphrase)
    if (self._cacerts is None):
        cacerts = _ffi.NULL
    else:
        cacerts = _lib.sk_X509_new_null()
        cacerts = _ffi.gc(cacerts, _lib.sk_X509_free)
        for cert in self._cacerts:
            _lib.sk_X509_push(cacerts, cert._x509)
    if (passphrase is None):
        passphrase = _ffi.NULL
    friendlyname = self._friendlyname
    if (friendlyname is None):
        friendlyname = _ffi.NULL
    if (self._pkey is None):
        pkey = _ffi.NULL
    else:
        pkey = self._pkey._pkey
    if (self._cert is None):
        cert = _ffi.NULL
    else:
        cert = self._cert._x509
    pkcs12 = _lib.PKCS12_create(passphrase, friendlyname, pkey, cert, cacerts, _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC, _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC, iter, maciter, 0)
    if (pkcs12 == _ffi.NULL):
        _raise_current_error()
    pkcs12 = _ffi.gc(pkcs12, _lib.PKCS12_free)
    bio = _new_mem_buf()
    _lib.i2d_PKCS12_bio(bio, pkcs12)
    return _bio_to_string(bio)
