(2) OpenSSL命令

來源:互聯網
上載者:User

標籤:esx   -o   smi   stdin   多點   version   ecb   Opens   standard   

openssl命令的格式是"openssl command command-options args",command部分有很多種命令,這些命令需要依賴於openssl命令才能執行,所以稱為偽命令(pseudo-command),每個偽命令都有各自的功能,大部分command都可以直接man command查看命令的用法和功能。

以下是openssl支援的偽命令,常用命令或可能用的上的命令加粗加紅顯示了

[[email protected] ~]# openssl --helpopenssl:Error: ‘--help‘ is an invalid command. # 支援的標準命令,即偽命令Standard commandsasn1parse         ca                ciphers           cms              crl               crl2pkcs7         dgst              dh               dhparam           dsa               dsaparam          ec               ecparam           enc               engine            errstr           gendh             gendsa            genpkey           genrsa           nseq              ocsp              passwd            pkcs12            pkcs7             pkcs8             pkey              pkeyparam        pkeyutl           prime             rand              req              rsa               rsautl            s_client          s_server         s_time            sess_id           smime             speed             spkac             ts                verify            version          x509              # 指定"dgst"命令時即單向加密支援的演算法,實際上支援更多的演算法,具體見dgst命令Message Digest commands (see the `dgst‘ command for more details)md2               md4               md5               rmd160           sha               sha1             # 指定對稱式加密"enc"時支援的對稱式加密演算法Cipher commands (see the `enc‘ command for more details)aes-128-cbc       aes-128-ecb       aes-192-cbc       aes-192-ecb      aes-256-cbc       aes-256-ecb       base64            bf               bf-cbc            bf-cfb            bf-ecb            bf-ofb           camellia-128-cbc  camellia-128-ecb  camellia-192-cbc  camellia-192-ecb camellia-256-cbc  camellia-256-ecb  cast              cast-cbc         cast5-cbc         cast5-cfb         cast5-ecb         cast5-ofb        des               des-cbc           des-cfb           des-ecb          des-ede           des-ede-cbc       des-ede-cfb       des-ede-ofb      des-ede3          des-ede3-cbc      des-ede3-cfb      des-ede3-ofb     des-ofb           des3              desx              idea             idea-cbc          idea-cfb          idea-ecb          idea-ofb         rc2               rc2-40-cbc        rc2-64-cbc        rc2-cbc          rc2-cfb           rc2-ecb           rc2-ofb           rc4              rc4-40            seed              seed-cbc          seed-cfb         seed-ecb          seed-ofb          zlib             



看上去非常複雜?其實不複雜,只是偽命令多點而已,而且很多偽命令經常用到的選項也就1到兩個。

以下是各偽命令的選項"-passin"和"-passout"可能使用到的密碼傳遞格式,“-passin”指的是傳遞解密時的密碼,"-passout"指的是傳遞加密輸出檔案時的密碼。如果不給定密碼格式,將提示從終端輸入。

格式一:pass:password         :password表示傳遞的純文字密碼

格式二:env:var               :從環境變數var擷取密碼值

格式三:file:filename         :filename檔案中的第一行為要傳遞的密碼。若filename同時傳遞給"-passin"和"-passout"選項,則filename的第一行為"-passin"的值,第二行為"-passout"的值

格式四:stdin                 :從標準輸入中擷取要傳遞的密碼

例如,要加密某個密鑰檔案,使得每次使用該密鑰檔案都需要輸入密碼,則使用"-passout"指定加密密碼,當使用被加密的密鑰檔案時需要解密,使用"-passin"傳遞解密密碼。

(2) OpenSSL命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.