本文整理汇总了Python中cryptography.hazmat.bindings.openssl.binding.Binding._register_osrandom_engine方法的典型用法代码示例。如果您正苦于以下问题:Python Binding._register_osrandom_engine方法的具体用法?Python Binding._register_osrandom_engine怎么用?Python Binding._register_osrandom_engine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cryptography.hazmat.bindings.openssl.binding.Binding
的用法示例。
在下文中一共展示了Binding._register_osrandom_engine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_check_startup_errors_are_allowed
# 需要导入模块: from cryptography.hazmat.bindings.openssl.binding import Binding [as 别名]
# 或者: from cryptography.hazmat.bindings.openssl.binding.Binding import _register_osrandom_engine [as 别名]
def test_check_startup_errors_are_allowed(self):
b = Binding()
b.lib.ERR_put_error(
b.lib.ERR_LIB_EVP,
b.lib.EVP_F_EVP_ENCRYPTFINAL_EX,
b.lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH,
b"",
-1
)
b._register_osrandom_engine()
assert _consume_errors(b.lib) == []
示例2: test_add_engine_more_than_once
# 需要导入模块: from cryptography.hazmat.bindings.openssl.binding import Binding [as 别名]
# 或者: from cryptography.hazmat.bindings.openssl.binding.Binding import _register_osrandom_engine [as 别名]
def test_add_engine_more_than_once(self):
b = Binding()
b._register_osrandom_engine()
assert b.lib.ERR_get_error() == 0
示例3: test_add_engine_more_than_once
# 需要导入模块: from cryptography.hazmat.bindings.openssl.binding import Binding [as 别名]
# 或者: from cryptography.hazmat.bindings.openssl.binding.Binding import _register_osrandom_engine [as 别名]
def test_add_engine_more_than_once(self):
b = Binding()
with pytest.raises(RuntimeError):
b._register_osrandom_engine()