Set I{nonce} which is arbitraty set of bytes to prevent reply attacks. @param text: The nonce text value. Generated when I{None}. @type text: str
(self, text=None)
| 128 | self.created = None |
| 129 | |
| 130 | def setnonce(self, text=None): |
| 131 | """ |
| 132 | Set I{nonce} which is arbitraty set of bytes to prevent |
| 133 | reply attacks. |
| 134 | @param text: The nonce text value. |
| 135 | Generated when I{None}. |
| 136 | @type text: str |
| 137 | """ |
| 138 | if text is None: |
| 139 | s = [] |
| 140 | s.append(self.username) |
| 141 | s.append(self.password) |
| 142 | s.append(Token.sysdate()) |
| 143 | m = sha256() |
| 144 | m.update(':'.join(s).encode("utf-8")) |
| 145 | self.nonce = m.hexdigest() |
| 146 | else: |
| 147 | self.nonce = text |
| 148 | |
| 149 | def setcreated(self, dt=None): |
| 150 | """ |