OpenSSL是一个功能强大的命令行工具,用于加密、解密、签名和验证操作。以下是一些常用的OpenSSL命令行使用技巧:
openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout -out public.key
openssl req -new -key private.key -out csr.csr
openssl req -x509 -newkey rsa:2048 -keyout private.key -out certificate.crt -days 365
openssl enc -aes-256-cbc -in plaintext.txt -out encrypted.txt -k secretkey
openssl enc -d -aes-256-cbc -in encrypted.txt -out decrypted.txt -k secretkey
openssl dgst -md5 file.txt
openssl dgst -sha256 -sign private.key -out signature.bin file.txt
openssl dgst -sha256 -verify public.key -signature signature.bin file.txt
openssl s_client -connect example.com:443
openssl x509 -in certificate.crt -text -noout
openssl x509 -outform der -in certificate.pem -out certificate.der
这些命令只是OpenSSL功能的一部分,更多高级用法可以通过查阅OpenSSL手册或在线资源来学习。