Pyopenssl RSA私钥与AES 256加密
在Pyopenssl中,我还没有找到一种使用AES 256加密RSA私钥的方法,一直在寻找此处,但似乎无法找到一种方法。
在我使用OpenSSL获取密钥和CA/CL证书之前,但是现在我选择在需要以某些方式处理PFX文件的应用程序中进行应用程序。
在openssl中,我曾经做过以下操作:
openssl pkcs12 -in file.pfx -nocerts -nocerts -out key.key
在那之后:
openssl rsa -aes256 -key.key.key-key -out negpted.key
。
In pyOpenSSL i haven't been able to find a way to encrypt a RSA private key with AES 256 just yet, been looking all over the place for this but cant seem to find a way.
Before i used OpenSSL to get the key and ca/cl certificates but now im opting to make an application where i need to handle the pfx-file in certain ways.
In OpenSSL i used to do the following:
openssl pkcs12 -in file.pfx -nocerts -out key.key
after that i did:
openssl rsa -aes256 -key.key -out encrypted.key
is there anything similar in pyOpenSSL using crypto?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我解决了这个问题。但是对于任何想知道的人来说,这就是我所做的:
仍然剩下的一个问题是,无论如何是否有与OpenSSL相似的Python中完成的加密信息?
如果您运行
openssl rsa -aes256 -in old.key -out new.key
键将在开始时返回属性:
但是,当我在python中导出私钥时,我会得到
:无论如何,都用
pycryptodome
显示这些属性?I believe I solved this. But for anyone wondering, this is what I did:
One question still remaining is if there's anyway to output the encryption info done in python similar to OpenSSL?
If you run
openssl rsa -aes256 -in old.key -out new.key
The key will return attributes in the beginning like such:
However when I export the private key in Python I just get:
Is there anyway to display these attributes with
pycryptodome
?