【问题标题】:How to encrypt and decrypt xml using openSSL with public key如何使用带有公钥的openSSL加密和解密xml
【发布时间】:2011-08-19 10:39:26
【问题描述】:

谁能告诉我如何使用openssl加密和解密xml文件。我可以使用 Linux 命令创建私钥

openssl genrsa -out private.pem 1024 

我的私钥是private.pem。使用

创建公钥
openssl rsa -in private.pem -out public.pem -outform PEM -pubout

我的公钥是public.pem

现在我想要使用此公钥加密 XML 文件,并再次使用我的私钥解密。

【问题讨论】:

  • 键盘上的返回键怎么了?它离开是因为觉得不需要吗? :-P

标签: linux openssl


【解决方案1】:

试试:

$ openssl rsautl -encrypt -inkey public.pem -pubin -in file.xml -out file.xml.encrypted

提示:我作弊并看这里:

http://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-15
    • 2012-04-28
    • 2020-02-28
    • 2010-12-09
    • 2013-04-06
    • 1970-01-01
    相关资源
    最近更新 更多