码迷,mamicode.com
首页 > 其他好文 > 详细

生成CSR文件

时间:2015-08-05 10:49:56      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

Step 1: Generate Private Key

         NOTE: All certificates that will expire after October 2013 must have a 2048 bit key size.

        
The utility "openssl" is used to generate the key and CSR.
         This utility comes with the OpenSSL package and is usually installed under /usr/local/ssl/bin.
          If the utility was installed elsewhere, these instructions will need to be adjusted accordingly.

  1. Type the following command at the prompt:

    openssl genrsa -des3 -out <private key file name>.key 2048

    For example:

    技术分享


    This command generates a 2048 bit RSA private key and stores it in the file www.mydomain.com.key.
     

  2. When prompted for a pass phrase: enter a secure password and remember it, as this pass phrase
    is what protects the private key. Both the private key and the certificate are required to enable SSL.

    NOTE: To bypass the pass phrase requirement, omit the -des3 option when generating the private key.
    If the private key is left unprotected, Symantec recommends access to the server be restricted so that only
    authorized server administrators can access or read the private key file.

Step 2: Generate the CSR

  1. Type the following command at the prompt:

    openssl req -new -key <private key file name>.key -out <csr file name>.csr 

    For example:

    技术分享


    NOTE: If using openSSL on Windows, you may need to specify the path to openssl.cnf such as the following:
    openssl req -new -key <private key file name>.key -config "c:\Apache Software Foundation\Apache2.2\conf\openssl.cnf" -out <csr file name>.csr 

    This command will prompt for the following X.509 attributes of the certificate:

    技术分享

  • Country Name: Use the two-letter code without punctuation for country, for example: US or CA. 

  • State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: California

  • Locality or City: The Locality field is the city or town name, for example: Berkeley. Do not abbreviate. For example: Saint Louis, not St. Louis

  • Company: If the company or department has an &, @, or any other symbol using the shift key in its name, the symbol must be spelled out or omitted, in order to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z Corporation.

  • Organizational Unit: The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on the keyboard.

  • Common Name: The Common Name is the Host + Domain Name. It looks like "www.company.com" or "company.com".
    Symantec certificates can only be used on Web servers using the Common Name specified during enrollment. For example,
    a certificate for the domain "domain.com" will receive a warning if accessing a site named "www.domain.com" or
    "secure.domain.com", because "www.domain.com" and "secure.domain.com" are different from "domain.com".

    NOTE: Please do not enter an email address, challenge password or an optional company name when generating the CSR.
     

  1. A public/private key pair has now been created. The private key (www.domain.com.key) is stored locally on the
    server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (certrequest.csr), will be for certificate enrollment.

  2. To copy and paste the information into the enrollment form, open the file in a text editor such as Notepad or Vi and
    save it as a .txt file. Do not use Microsoft Word as it may insert extra hidden characters that will alter the contents of the CSR.

  3. Verify your CSR

  4. Once the CSR has been created, proceed to Enrollment.

Step 3: Backup the private key

        Symantec recommends backing up the .key file and storing of the corresponding pass phrase.
        A good choice is to create a copy of this file onto a diskette or other removable media. 
        While backing up the private key is not required, having one will be helpful in the instance of server failure.

Contact Information
       During the verification process, Symantec may need to contact your organization. Be sure to provide an email address,
       phone number, and fax number that will be checked and responded to quickly. These fields are not part of the certificate.

生成CSR文件

标签:

原文地址:http://my.oschina.net/u/1433006/blog/487907

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!