def copy(self): if self._ctx is None: raise AlreadyFinalized("Context was already finalized.") return DSASignatureHashContext(self._mac_key, dsa_key=self._dsa_key, ctx=self._ctx.copy())