Generates a seed then calls random-to-key
(cls, etype)
| 1391 | |
| 1392 | @classmethod |
| 1393 | def new_random_key(cls, etype): |
| 1394 | # type: (EncryptionType) -> Key |
| 1395 | """ |
| 1396 | Generates a seed then calls random-to-key |
| 1397 | """ |
| 1398 | try: |
| 1399 | ep = _enctypes[etype] |
| 1400 | except ValueError: |
| 1401 | raise ValueError("Unknown etype '%s'" % etype) |
| 1402 | return cls.random_to_key(etype, os.urandom(ep.seedsize)) |
| 1403 | |
| 1404 | @classmethod |
| 1405 | def string_to_key(cls, etype, string, salt, params=None): |
no test coverage detected