本文整理匯總了Python中cryptography.hazmat.primitives.asymmetric.dsa._check_dsa_private_numbers方法的典型用法代碼示例。如果您正苦於以下問題:Python dsa._check_dsa_private_numbers方法的具體用法?Python dsa._check_dsa_private_numbers怎麽用?Python dsa._check_dsa_private_numbers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cryptography.hazmat.primitives.asymmetric.dsa
的用法示例。
在下文中一共展示了dsa._check_dsa_private_numbers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: load_dsa_private_numbers
# 需要導入模塊: from cryptography.hazmat.primitives.asymmetric import dsa [as 別名]
# 或者: from cryptography.hazmat.primitives.asymmetric.dsa import _check_dsa_private_numbers [as 別名]
def load_dsa_private_numbers(self, numbers):
dsa._check_dsa_private_numbers(numbers)
parameter_numbers = numbers.public_numbers.parameter_numbers
dsa_cdata = self._lib.DSA_new()
self.openssl_assert(dsa_cdata != self._ffi.NULL)
dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
dsa_cdata.p = self._int_to_bn(parameter_numbers.p)
dsa_cdata.q = self._int_to_bn(parameter_numbers.q)
dsa_cdata.g = self._int_to_bn(parameter_numbers.g)
dsa_cdata.pub_key = self._int_to_bn(numbers.public_numbers.y)
dsa_cdata.priv_key = self._int_to_bn(numbers.x)
evp_pkey = self._dsa_cdata_to_evp_pkey(dsa_cdata)
return _DSAPrivateKey(self, dsa_cdata, evp_pkey)
示例2: load_dsa_private_numbers
# 需要導入模塊: from cryptography.hazmat.primitives.asymmetric import dsa [as 別名]
# 或者: from cryptography.hazmat.primitives.asymmetric.dsa import _check_dsa_private_numbers [as 別名]
def load_dsa_private_numbers(self, numbers):
dsa._check_dsa_private_numbers(numbers)
parameter_numbers = numbers.public_numbers.parameter_numbers
dsa_cdata = self._lib.DSA_new()
self.openssl_assert(dsa_cdata != self._ffi.NULL)
dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
p = self._int_to_bn(parameter_numbers.p)
q = self._int_to_bn(parameter_numbers.q)
g = self._int_to_bn(parameter_numbers.g)
pub_key = self._int_to_bn(numbers.public_numbers.y)
priv_key = self._int_to_bn(numbers.x)
self._dsa_cdata_set_values(dsa_cdata, p, q, g, pub_key, priv_key)
evp_pkey = self._dsa_cdata_to_evp_pkey(dsa_cdata)
return _DSAPrivateKey(self, dsa_cdata, evp_pkey)