2020年12月

需要安装库pip install cryptography

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization

方法一

def populate_public_key(rsaExponent, rsaModulus):

'''
根据cryptography包下的rsa模块,对指数模数进行处理生成公钥
:param rsaExponent:指数
:param rsaModulus:模数
:return:公钥
'''
rsaExponent = int(rsaExponent, 16)  # 十六进制转十进制
rsaModulus = int(rsaModulus, 16)

pubkey = rsa.RSAPublicNumbers(rsaExponent, rsaModulus).public_key(default_backend())

return pubkey

if name == '__main__':

print('start')
rsaExponent = "10001"
rsaModulus = 'd3bcef1f00424f3261c89323fa8cdfa12bbac400d9fe8bb627e8d27a44bd5d59dce559135d678a8143beb5b8d7056c4e1f89c4e1f152470625b7b41944a97f02da6f605a49a93ec6eb9cbaf2e7ac2b26a354ce69eb265953d2c29e395d6d8c1cdb688978551aa0f7521f290035fad381178da0bea8f9e6adce39020f513133fb'
pubkey = populate_public_key(rsaExponent, rsaModulus)
pem = pubkey.public_bytes(
    encoding=serialization.Encoding.PEM,
    format=serialization.PublicFormat.SubjectPublicKeyInfo
)
print(pem)

在其他浏览器正常,但是在火狐浏览器出现问题
是因为当内层容器上方没有容器的时候,内层div与外层div的margin-top融合
导致内层的margin-top交给外层