Cryptodome.PublicKey导入RSA private key

Crypto.PublicKey.RSA.import_key(extern_key, passphrase=None)
作用:导入RSA key(公钥或者私钥)
extern_key为 string或者 byte string
支持PKCS#1 的 DER格式(二进制或者PEM编码)
私钥,还支持 PKCS#8 格式 (相当于PKCS#1 还有一些额外信息)


Crypto.PublicKey.RSA.construct(rsa_components, consistency_check=True)
作用:用大整数 构造 私钥 或者 公钥
modulus (n) 必选参数
public exponent (e) 必选参数
private exponent (d) key的类型为私钥时,必选
p
q

rsa_private_key = RSA.construct((modulus, pubExp, privateExp, prime1, prime2))


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注