SSL證書請求文件(CSR)生成指南 - Tomcat

SSL證書請求文件(CSR)生成指南 - Tomcat
 

重要注意事項 An Important Note Before You Starthtml

在生成CSR文件時同時生成您的私鑰,若是您丟了私鑰或忘了私鑰密碼,則頒發證書給您後不能安裝成功!您必須從新生成私鑰和CSR文件,免費從新頒發新的證書。爲了不此狀況的發生,請在生成CSR後必定要備份私鑰文件和記住私鑰密碼,最好是在收到證書以前不要再動服務器。 
By far the most common problem users have when going through this process is related to private keys. If you lose or cannot access a private key, you cannot use the certificate we issue to you and will need to request a free reissue. To ensure this never happens, we advise that a backup of the private key file is made and that a note is made of the password that is used to protect the export of the private key.java

您能夠使用"keytool"來生成私鑰和CSR文件,若是您的服務器上沒有安裝keytool,請先下載安裝: 
The utility "keytool" that you use to generate the private key (keyEntry) and CSR comes with the Sun JDK toolkit. If you do not have JDK installed please download it from the following link:http://java.sun.com/J2SE/downloads.html,We recommend that the latest version be used, which is 1.5.0.tomcat

如下爲生成 keystore 和 keyentry 指南,Tomcat 支持 JKS 和 PKCS#12 格式的 keystore,JKS 格式是標準的 「Java Keystore」格式,使用 keytool 命令產生;而 PKCS#12 格式則能夠經過使用Openssl中的轉換工具轉換而成。本指南僅指keytool方式的JKS格式。 
The following sequence of commands will generate a keystore and keyEntry. Tomcat currently supports JKS and PKCS#12 format keystores. The JKS format is Java's standard "Java KeyStore" format, and is the format generated by the keytool command-line utility which is packaged in the JDK kit. The PKCS#12 format is a general format which can be converted using the Openssl toolkit. The following instructions make use of keytool only.服務器

1. 生成 keystore 和 keyEntry, Generate a keystore and keyEntryapp

請使用如下命令,並參考下圖: Please type the following command at the prompt:dom

keytool -genkey -alias [keyEntry_name] -keyalg RSA -keystore [keystore_name]ide

請注意:若是您不指定一個 keystore 名稱(不使用參數 -keystore), 則 keystore 文件將保存在您的用戶目錄中(如:C:/Documents and Settings/your name/.keystore),文件名爲:.keystore 
Note: If you do not specify a keystore (-keystore omitted from the command) name, the keystore will be saved to your local profile directory as a .keystore file (i.e C:/Documents and Settings/your name/.keystore)工具

系統會提示您輸入 keystore 密碼,缺省密碼爲:changeit,您能夠指定一個新的密碼,但請必定要記住。
When you execute this command you will be prompted for a keystore password. The default password used by Tomcat is "changeit" although you can specify a password of your choice.測試

接着,會提示「What is your fist and last name?」,請輸入您要申請SSL證書的域名,而不是真的輸入您的我的姓名,若是您須要爲www.domain.com申請SSL證書就不能只輸入domain.com。SSL證書是嚴格綁定域名的。
The term "First and last name" is X.509 speak for the name that distinguishes the certificate best, and ties it to your Organization. Enter your exact host and domain name that you wish to secure. Example: If you wish to secure www.mydomain.com, then you will need to enter the exact host (www) and domain name (mydomain.com) in this field. If you enter mydomain.com then the certificate issued to you will only work error free on https://mydomain.com. It will cause a certificate mismatch error when you or your users access the domain via https:// www.mydomain.com.ui

接着,輸入您的部門名稱、單位名稱、所在城市、所在省份和國家縮寫(中國填:CN,其餘國家填其縮寫),單位名稱必定要與證實文件上的名稱一致,部門名稱(OU)能夠不填。除國家縮寫必須填CN外,其他均可以是英文或中文。 
Enter your country, state or province and locality or city. You should enter the company name as it appears on your official company registration documents. The organization unit is optional, we verify and authenticate the company name and not the organization unit. To skip the organization unit (OU) field please press enter on your keyboard.

最後,要求您輸入私鑰密碼, 請必定要爲 keystore 和 keyEntry 輸入同樣的密碼,不然您從新啓動Tomcat後會提示錯誤信息:java.security.UnrecoverableKeyException: Cannot recover key。同時,請必定要記住密碼! 
Finally, you will be prompted for the keyEntry password, which is the password which protects the private key. Please specify the same password for the keystore and the keyEntry or else you will receive the following error message when you restart the Tomcat engine: java.security.UnrecoverableKeyException: Cannot recover key

2. 生成CSR, Generate the CSR

請使用如下命令,並參考下圖: Please type the following command at the prompt:

keytool -certreq -alias [keyEntry name] -file request.csr -keystore [keystore name]

CSR文件(request.csr)會保存在 JDK/bin 目錄,這樣就完成了公鑰和私鑰對的生成,私鑰(keyEntry)保存在JDK/bin目錄中,公鑰則須要發給WoTrust簽名後頒發證書。CSR文件爲文本文件,以下圖示。 
The CSR will be saved to your JDK/bin directory. You have now created a public/private key pair. The private key (KeyEntry) is stored inside the keystore in the JDK/bin directory and is used for decryption. The public portion is sent to WoTrust in the form of a Certificate Signing Request (request.csr), and will be used by your users to encrypt the data they send to your site. The Certificate Signing Request (CSR) looks something like this:

3. 備份私鑰文件 Backup your private key

請備份您的keystore文件並記下私鑰密碼。最好是把私鑰文件備份到軟盤或光盤中。 
Please backup your keystore file and make a note of the password. A good choice is to create a copy of this file onto a diskette or other removeable media.

4. 測試CSR和把CSR發給WoTrust, Start the certificate request process

生成CSR後,建議您本身測試一下生成的CSR文件是否正確,請點擊 這裏 測試您的CSR文件。請把測試成功的CSR文件發給WoTrust便可。請必定不要再動您的服務器,等待證書的頒發。To submit the CSR to WoTrust for processing you should start the certificate enrollment process

相關文章
相關標籤/搜索