Alex Gaynor | 77ae0cd | 2016-03-05 14:07:34 -0500 | [diff] [blame] | 1 | # This file is dual licensed under the terms of the Apache License, Version |
| 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository |
| 3 | # for complete details. |
| 4 | |
Alex Gaynor | 53e7b24 | 2016-03-06 09:54:23 -0500 | [diff] [blame] | 5 | from __future__ import absolute_import, division, print_function |
| 6 | |
Alex Gaynor | 77ae0cd | 2016-03-05 14:07:34 -0500 | [diff] [blame] | 7 | from cryptography import utils |
| 8 | from cryptography.hazmat.primitives import hashes, serialization |
| 9 | from cryptography.hazmat.primitives.asymmetric import padding |
| 10 | from cryptography.hazmat.primitives.ciphers import CipherAlgorithm |
| 11 | from cryptography.hazmat.primitives.ciphers.modes import Mode |
| 12 | |
| 13 | |
| 14 | @utils.register_interface(CipherAlgorithm) |
| 15 | class DummyCipherAlgorithm(object): |
| 16 | name = "dummy-cipher" |
| 17 | block_size = 128 |
| 18 | key_size = None |
| 19 | |
| 20 | |
| 21 | @utils.register_interface(Mode) |
| 22 | class DummyMode(object): |
| 23 | name = "dummy-mode" |
| 24 | |
| 25 | def validate_for_algorithm(self, algorithm): |
| 26 | pass |
| 27 | |
| 28 | |
| 29 | @utils.register_interface(hashes.HashAlgorithm) |
| 30 | class DummyHashAlgorithm(object): |
| 31 | name = "dummy-hash" |
| 32 | block_size = None |
| 33 | digest_size = None |
| 34 | |
| 35 | |
| 36 | @utils.register_interface(serialization.KeySerializationEncryption) |
| 37 | class DummyKeySerializationEncryption(object): |
| 38 | pass |
| 39 | |
| 40 | |
| 41 | @utils.register_interface(padding.AsymmetricPadding) |
| 42 | class DummyAsymmetricPadding(object): |
| 43 | name = "dummy-padding" |