Que*_*tin 5 openssl certificate timestamping
我想为我的时间戳服务创建一个tsa证书.
首先,我创建一个根证书
openssl genrsa -out tsaroot.key 4096 -config openssl.cnf
openssl req -new -x509 -days 1826 -key tsaroot.key -out tsaroot.crt -config openssl.cnf
Run Code Online (Sandbox Code Playgroud)
然后我创建了tsa证书
openssl genrsa -des3 -out tsa.key 4096 -config openssl.cnf
openssl req -new -key tsa.key -out tsa.csr -config openssl.cnf
openssl x509 -req -days 730 -in tsa.csr -CA tsaroot.crt -CAkey tsaroot.key -set_serial 01 -out tsa.crt
openssl pkcs12 -export -out tsa.p12 -inkey tsa.key -in tsa.crt -chain -CAfile tsaroot.crt
Run Code Online (Sandbox Code Playgroud)
在我的openssl.cnf文件中,我添加以下行:
extendedKeyUsage = critical,timeStamping
Run Code Online (Sandbox Code Playgroud)
Howerver,创建的证书似乎不包括extendeKeyUsage(当我尝试用充气城堡阅读它时,我得到了"证书必须具有ExtendedKeyUsage扩展名."例外
如何生成有效的tsa证书(包含正确的extendedKeyUsage值)?
谢谢
以下工作有效:
创建一个文件 extKey.cnf ,其中包含 ExtendedKeyUsage
extendedKeyUsage = critical,timeStamping
Run Code Online (Sandbox Code Playgroud)
创建请求时添加:
openssl x509 -req -days 730 -in tsa.csr -CA tsaroot.crt -CAkey tsaroot.key -set_serial 01 -out tsa.crt -extfile extKey.cnf
Run Code Online (Sandbox Code Playgroud)