制作CA证书
OS: Freebsd 6.4-RELEASE-p6
ports install openssl: OpenSSL 0.9.7e-p1 25 Oct 2004
cd /data/ca
# 生成CA key passwd:12345
openssl genrsa -des3 -out rootcakey.pem 2048
# 生成CA证书
openssl req -new -key rootcakey.pem -out rootcareq.pem
Enter pass phrase for rootca.key: (passwd:12345)
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]:BeiJing
Locality Name (eg, city) []:BJ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:wuhuren Technology Ltd.
Organizational Unit Name (eg, section) []:NOC DEPT.
Common Name (eg, YOUR name) []:wuhuren
Email Address []:postmaster@wuhuren.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
# 生成CA签名证书
openssl x509 -req -days 7305 -sha1 -extfile /etc/ssl/openssl.cnf -extensions v3_ca -signkey rootcakey.pem -in rootcareq.pem -out rootcacrt.pem
Signature ok
subject=/C=CN/ST=BeiJing/L=BJ/O=wuhuren Technology Ltd./OU=NOC DEPT./CN=wuhuren/emailAddress=postmaster@wuhuren.com
Getting Private key
Enter pass phrase for rootcakey.pem: (passwd:12345)
# 生成mx服务器的私有密匙
openssl genrsa -out mxkey.pem 2048
# 生成mx服务器的证书
openssl req -new -key mxkey.pem -out mxcsr.pem
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]:BeiJing
Locality Name (eg, city) []:BJ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:wuhuren Technology Ltd.
Organizational Unit Name (eg, section) []:OPMX
Common Name (eg, YOUR name) []:opmx
Email Address []:opmx@wuhuren.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
# 生成mx服务器的签名证书
openssl x509 -req -days 3650 -sha1 -extfile /etc/ssl/openssl.cnf -extensions v3_req -CA rootcacrt.pem -CAkey rootcakey.pem -CAserial rootcasrl.pem -CAcreateserial -in mxcsr.pem -out mxcrt.pem
Signature ok
subject=/C=CN/ST=BeiJing/L=BJ/O=wuhuren Technology Ltd./OU=OPMX/CN=opmx/emailAddress=opmx@wuhuren.com
Getting CA Private Key
Enter pass phrase for rootcakey.pem: (passwd:12345)