tomcat生成csr,前提必须配置好java环境. 才能使用keytool工具
生成CSR只需要2条命令
#生成KeyStore文件和私钥 keytool -genkey -alias getssl -keyalg RSA -keysize 2048 -keystore getssl.jks #生成CSR文件 keytool -certreq -alias getssl -file csr.txt -keystore getssl.jks
运行后会生成一个csr.txt文件, 提交csr时, 将文件里面的内容填写进去。
以下是完整的操作步骤.
C:\Users\suppo\tomcat>keytool -genkey -alias getssl -keyalg RSA -keysize 2048 -keystore ssle.jks 输入keystore密码: 再次输入新密码: 您的名字与姓氏是什么? [Unknown]: demo.ssle.cn 您的组织单位名称是什么? [Unknown]: SSLE 您的组织名称是什么? [Unknown]: IT DEPT 您所在的城市或区域名称是什么? [Unknown]: SHANGHAI 您所在的州或省份名称是什么? [Unknown]: SHANGHAI 该单位的两字母国家代码是什么 [Unknown]: CN CN=demo.ssle.cn, OU=SSLE, O=IT DEPT, L=SHANGHAI, ST=SHANGHAI, C=CN 正确吗? [否]: 是 输入<ssle>的主密码 (如果和 keystore 密码相同,按回车): C:\Users\suppo\tomcat>keytool -certreq -alias ssle -file csr.txt -keystore ssle.jks 输入keystore密码: C:\Users\suppo\tomcat>
在我们网站购买证书的用户,提交CSR时复制csr.txt的文件内容提交
-----BEGIN NEW CERTIFICATE REQUEST----- MIICpjCCAY4CAQAwYTELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNIQU5HSEFJMREwDwYDVQQHEwhT SEFOR0hBSTENMAsGA1UEChMEVEVDSDEPMA0GA1UECxMGR0VUU1NMMQwwCgYDVQQDEwNMRUUwggEi MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWSqrDRJpOEUsTVes95AI5nPnCCaigMJt7n85a t5EidNekFrShrP34S8j4ouJAqaMrTvg78XrGogqtrDstanenRtQ+XdXVUtbk8wEgMLQ90tliTZid IFbflSlizh59SWf8kMtBIZqZ9FHA/m8SR+HsaDYgyQv/OHBiyNi5ueW1HoQOJF8LocRafbW3R5s+ 4LpqPemSkknDy7k4wNMpUrfipo1ksjFGfDmv/q4ViKWesyUbuITCTULyGrFOiPOmvmzZ4Pq7tCg/ t/1SZ4ohYZVaD+3mRtAxSPNncCVpIAP+3pZ2gNMfMQikXptOF4eVsoTjDPX2MrE6ZVYjvF9LFU85 AgMBAAGgADANBgkqhkiG9w0BAQUFAAOCAQEAWZM/mejvwVzLQ+9cdJrODxT0Y4zCfYyTDP0H9cAC ah+VDza+lYwYIcgRPQCwsuAxNNKy3kevKXGOWb99/f1+Jo6MwsmhYYRxoiAwxcoY/JyV8pcfI55N e6QlFy4qDWO2pAPgQr4iarC6c6RpdO/jm5uF8Dlx0UDlIRpfbm0PJTLWU/MSxv8vvCe3RJVDhEy0 vOoNC16NFlZFo5I6js6GNBN5sxnRYPpXRkgQEvwZhMay9Vi1BL1pI/1DNK7JaTkxYP5BHp5f+Obd 6ISKllG9MOd/epCdZz3lh754dIc2MhnmSqQZ2G3gt1q5SJy6SXt7OxLGyhRmeOQ4voEAV3/4+A== -----END NEW CERTIFICATE REQUEST-----
Was this helpful?
0 / 0