在Debian系统中,OpenSSL是一个强大的加密工具包,它提供了许多命令行工具来执行各种加密任务
sudo apt-get update sudo apt-get install openssl openssl genrsa -out rsa_key.pem 2048 这将生成一个名为rsa_key.pem的私钥文件。接下来,使用以下命令从私钥生成公钥:
openssl rsa -in rsa_key.pem -pubout -out rsa_key.pub 这将生成一个名为rsa_key.pub的公钥文件。
openssl req -new -x509 -days 365 -key rsa_key.pem -out certificate.crt 按照提示输入相关信息,如国家、组织名称等。这将生成一个名为certificate.crt的证书文件。
openssl x509 -in certificate.crt -outform DER -out certificate.der openssl x509 -in certificate.crt -text -noout openssl rsautl -decrypt -in encrypted_file.enc -out decrypted_file.txt -inkey rsa_key.pem openssl rsautl -encrypt -in plain_file.txt -out encrypted_file.enc -pubin -inkey rsa_key.pub 这只是OpenSSL命令行工具的一些基本用法。OpenSSL提供了许多其他功能,如创建和管理PKCS#12证书存储、生成Diffie-Hellman密钥对等。要了解更多关于OpenSSL的信息,请查阅其官方文档或使用man openssl命令查看手册页。