[記錄]openssl給自己簽證cmd過程全記錄

OS:win7 openssl來自:lifetragedy的資源 參考:通向架構師的道路(第二天) 操作過程全部copy,但是其中遇到一個錯誤
I am unable to access the C:/openssl/demoCA/newcerts directory
C:/openssl/demoCA/newcerts: No such file or directory
解決思路:
1、找路徑是應該是配置文件的事情,可能是沒有找到我的openssl.cnf,所以有了第一次修改,結果還是錯誤
2、路徑應該是找到了的,那麼有可能是openssl.cnf本身出錯了吧?因爲我的openssl在d盤,而lifetragedy的在c盤
打開openssl.cnf,裏面果然有一個CA_default下面有個路徑,修改之,
成功


C:\Users\jincheng>cd d:\openssl

C:\Users\jincheng>d:

d:\openssl>openssl genrsa -des3 -out ca.key 1024
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
..++++++
.........++++++
e is 65537 (0x10001)
Enter pass phrase for ca.key:
Verifying - Enter pass phrase for ca.key:

d:\openssl>openssl rsa -in ca.key -out ca.key
Enter pass phrase for ca.key:
writing RSA key

d:\openssl>openssl req -new -x509 -key ca.key -out ca.crt -config d:\openssl\bin
\openssl.cnf
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:ZJ
Locality Name (eg, city) []:HZ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Jincheng
Organizational Unit Name (eg, section) []:jcs
Common Name (eg, YOUR name) []:jcs
Email Address []:[email protected]

d:\openssl>

d:\openssl>openssl genrsa -des3 -out server.key 1024
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
....++++++
.++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:

d:\openssl>openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:
writing RSA key

d:\openssl>openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:ZJ
Locality Name (eg, city) []:HZ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Jincheng
Organizational Unit Name (eg, section) []:jcs-DART
Common Name (eg, YOUR name) []:jcs
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:aaaaaa
An optional company name []:aaaaaa

d:\openssl>openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.ke
y
Using configuration from D:\openssl\bin\openssl.cnf
Loading 'screen' into random state - done
I am unable to access the C:/openssl/demoCA/newcerts directory
C:/openssl/demoCA/newcerts: No such file or directory

d:\openssl>openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.ke
y -config d:\openssl\bin\openssl.cnf
Using configuration from d:\openssl\bin\openssl.cnf
Loading 'screen' into random state - done
I am unable to access the C:/openssl/demoCA/newcerts directory
C:/openssl/demoCA/newcerts: No such file or directory

d:\openssl>

d:\openssl>openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.ke
y -config d:\openssl\bin\openssl.cnf
Using configuration from d:\openssl\bin\openssl.cnf
Loading 'screen' into random state - done
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 3 (0x3)
        Validity
            Not Before: Nov 23 07:33:41 2012 GMT
            Not After : Nov 23 07:33:41 2013 GMT
        Subject:
            countryName               = CN
            stateOrProvinceName       = ZJ
            organizationName          = Jincheng
            organizationalUnitName    = jcs-DART
            commonName                = jcs
            emailAddress              = 
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            Netscape Comment:
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier:
                64:8F:32:5E:9C:42:19:15:B5:97:47:E1:11:57:F8:58:FA:F2:CE:E5
            X509v3 Authority Key Identifier:
                keyid:E5:FC:6D:2F:F7:32:BC:E8:D1:2A:68:88:E3:ED:39:37:1A:61:97:9
0

Certificate is to be certified until Nov 23 07:33:41 2013 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

d:\openssl>

d:\openssl>

d:\openssl>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章