def METHOD_NAME(cls, trustdb=None):  # type: ignore[no-untyped-def]
    """Export ownertrust to a trustdb file.
    If there is already a file named :file:`trustdb.gpg` in the current GnuPG
    homedir, it will be renamed to :file:`trustdb.gpg.bak`.
    :param string trustdb: The path to the trustdb.gpg file. If not given,
                           defaults to ``'trustdb.gpg'`` in the current GnuPG
                           homedir.
    """
    if trustdb is None:
        trustdb = os.path.join(cls.homedir, "trustdb.gpg")
    try:
        os.rename(trustdb, trustdb + ".bak")
    except OSError as err:
        log.debug(str(err))
    export_proc = cls._open_subprocess(["--export-ownertrust"])
    tdb = open(trustdb, "wb")
    _util._threaded_copy_data(export_proc.stdout, tdb)
    export_proc.wait()