2015年1月20日

用 openssl產生金鑰

產生私鑰 長度2048 檔名ca.key
openssl genrsa -out ca.key 2048
產生配對的公鑰 檔名 ca.crt
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
 Country Name (2 letter code) [AU]:TW                                                   //國碼臺灣是 TW
 State or Province Name (full name) [Some-State]:Taiwan R.O.C                           //國名臺灣填 Taiwan
 Locality Name (eg, city) []:Taipei                                                     //地名
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:FreeBSD Personal Reserach   //組織單位名稱
 Organizational Unit Name (eg, section) []:FreeBSD Personal Reserach                    //部門名稱
 Common Name (eg, YOUR name) []:www.weithenn.org                                        //憑證的名稱 (通常為伺服器 FQDN)
 Email Address []:weithenn@weithenn.org                                                 //申請單位的聯絡信箱
 Please enter the following 'extra' attributes
 to be sent with your certificate request
 A challenge password []: 按 Enter 直接跳過                                             //申請書的密碼
 An optional company name []: 按 Enter 直接跳過                                         //憑證代辦公司的名稱