OS:win7 openssl来自:
lifetragedy的资源 参考:
通向架构师的道路(第二天) 操作过程全部copy,但是其中遇到一个错误
1、找路径是应该是配置文件的事情,可能是没有找到我的openssl.cnf,所以有了第一次修改,结果还是错误
2、路径应该是找到了的,那么有可能是openssl.cnf本身出错了吧?因为我的openssl在d盘,而lifetragedy的在c盘
打开openssl.cnf,里面果然有一个CA_default下面有个路径,修改之,
成功
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 []:jincheng_jcs@163.com
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>