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