简体   繁体   English

openssl在命令行中为私钥设置密码

[英]openssl set password for private key in command line

我正在尝试通过openssl工具加密一些数据,问题是如何在此命令中为private.key设置密码:

openssl smime -sign -signer /var/www/protected/keys/ym.pem -inkey /var/www/protected/keys/ym.key -nochain -nocerts -outform PEM -nodetach

对于那些面临相同问题的人:以这种方式从私钥中删除密码:

openssl rsa -in privateKey.pem -out newPrivateKey.pem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 openssl 获取私钥(没有开始行:pem_lib.c:703:Expecting: ANY PRIVATE KEY) - Can't get private key with openssl (no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY) 如何(成功)从命令行openSSL解码编码密码? - How do I (successfully) decode a encoded password from command line openSSL? OpenSSL命令行解密故障 - OpenSSL command line decryption hiccups 使用 openssl 命令行加密字符串 - Encrypt a string using openssl command line ansible如何输入私钥密码 - How to enter private key password with ansible ssh 使用没有密码的私钥 - ssh using private-key without password bash脚本中的SSH仍然会提示输入密码,而命令行中的ssh使用密钥进行身份验证时 - SSH in bash script still prompts password while ssh on command-line authenticates with key 在命令行上解密使用PHP openssl_encrypt创建的文件 - Decrypt File Made With PHP openssl_encrypt on Command Line 无法使用 openssl 验证公共证书的模块(无法验证 rsa 公钥来自私钥) - Unable to verify a public cert's modules with openssl (Unable to verify rsa public key came from a private key) 加载 OpenSSL 引擎后如何使用 OpenSSL 命令行操作(例如签名)? - How to use OpenSSL command line to operate(signature, for example) after loading OpenSSL engine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM