吊销证书.note

noteId: WEBb2f3dafed1efe64f76d0b15000cd49c4 · 原始路径:/ALL/Linux - A模块/服务配置/CA根证书颁发机构/吊销证书.note · 图片:2 · 附件待处理:0

 
它会自动读取 openssl.cnf 中的文件来寻找ca(默认是 ./demoCA)
 
1、吊销证书:
建议在吊销证书前备份 index.txt 文件
openssl ca -revoke web.crt
 
# 吊销后要手动重新生成crl,并且转格式为DER(如果要放到web中):
openssl ca -gencrl -out capem.crl
openssl crl -in capem.crl -inform PEM -out 
ca.crl -outform DER
 
 
2、指定证书吊销原因:
不加 -crl_reason 就不会有这个字段
openssl ca -revoke web.crt -crl_reason certificateHold
 
# 可用原因:
unspecified
keyCompromise
CACompromise
affiliationChanged
superseded
cessationOfOperation
certificateHold
 
 
3、反吊销证书:
使用 demoCA/index.txt.old 中的旧记录,替换index.txt 中现有的记录
cat demoCA/index.txt.old
vim demoCA/index.txt
# 将复制的未吊销的记录放进去
 
 
4、非交互吊销证书:
# 输出密码文件:
echo -n Skills39 > pass
openssl ca -revoke web.crt -passin file:/root/pass
 
 
# 吊销后要手动重新生成crl,并且转格式为DER(如果要放到web中):
openssl ca -gencrl -out capem.crl
openssl crl -in capem.crl -inform PEM -out 
ca.crl -outform DER