def add_domain_backupkey(self, domain: str, pvk: bytes):
        """
        Add domain backupkey
        :domain is the domain fqdn
        :pvk is the domain backupkey
        """
        q = select(self.DpapiBackupkey).filter(func.lower(self.DpapiBackupkey.c.domain) == func.lower(domain))
        results = self.conn.execute(q).all()

        if not len(results):
            pvk_encoded = base64.b64encode(pvk)
            backup_key = {"domain": domain, "pvk": pvk_encoded}
            try:
                # TODO: find a way to abstract this away to a single Upsert call
                q = Insert(self.DpapiBackupkey)  # .returning(self.DpapiBackupkey.c.id)

                self.conn.execute(q, [backup_key])  # .scalar()
                cme_logger.debug(f"add_domain_backupkey(domain={domain}, pvk={pvk_encoded})")
                # return inserted_id
            except Exception as e:
                cme_logger.debug(f"Issue while inserting DPAPI Backup Key: {e}")

        Add domain backupkey
        :domain is the domain fqdn
        :pvk is the domain backupkey
        
cme/protocols/smb/database.py