我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用cryptography.hazmat.primitives.ciphers.algorithms.ARC4。
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 }