Python cryptography.hazmat.primitives.ciphers.algorithms 模块,TripleDES() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用cryptography.hazmat.primitives.ciphers.algorithms.TripleDES()

项目:cryptography-pkcs11    作者:reaperhulk    | 项目源码 | 文件源码
def cipher_supported(self, cipher, mode):
        # TODO: softhsm only supports AES and 3DES with ECB/CBC
        return (
            isinstance(cipher, (AES, TripleDES)) and
            isinstance(mode, (ECB, CBC))
        )
项目:deb-python-pykmip    作者:openstack    | 项目源码 | 文件源码
def __init__(self):
        """
        Construct a CryptographyEngine.
        """
        self.logger = logging.getLogger('kmip.server.engine.cryptography')

        self._symmetric_key_algorithms = {
            enums.CryptographicAlgorithm.TRIPLE_DES: algorithms.TripleDES,
            enums.CryptographicAlgorithm.AES: algorithms.AES,
            enums.CryptographicAlgorithm.BLOWFISH: algorithms.Blowfish,
            enums.CryptographicAlgorithm.CAMELLIA: algorithms.Camellia,
            enums.CryptographicAlgorithm.CAST5: algorithms.CAST5,
            enums.CryptographicAlgorithm.IDEA: algorithms.IDEA,
            enums.CryptographicAlgorithm.RC4: algorithms.ARC4
        }
        self._asymetric_key_algorithms = {
            enums.CryptographicAlgorithm.RSA: self._create_rsa_key_pair
        }
        self._hash_algorithms = {
            enums.CryptographicAlgorithm.HMAC_SHA1: hashes.SHA1,
            enums.CryptographicAlgorithm.HMAC_SHA224: hashes.SHA224,
            enums.CryptographicAlgorithm.HMAC_SHA256: hashes.SHA256,
            enums.CryptographicAlgorithm.HMAC_SHA384: hashes.SHA384,
            enums.CryptographicAlgorithm.HMAC_SHA512: hashes.SHA512,
            enums.CryptographicAlgorithm.HMAC_MD5: hashes.MD5
        }