使用openssl创建tsa(时间戳)证书-在证书中添加extendedKeyUsage
我想为我的时间戳服务创建一个tsa证书 首先,我创建一个根证书使用openssl创建tsa(时间戳)证书-在证书中添加extendedKeyUsage,openssl,certificate,timestamping,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 openssl genrsa -des3 -out tsa.key 4096 -config openssl.cnf openssl req -
openssl genrsa -out tsaroot.key 4096 -config openssl.cnf
openssl req -new -x509 -days 1826 -key tsaroot.key -out tsaroot.crt -config openssl.cnf
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
然后我创建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
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
在我的openssl.cnf文件中,我添加了以下行:
extendedKeyUsage = critical,timeStamping
然而,创建的证书似乎不包含extendeKeyUsage(当我尝试使用bouncy castle读取它时,我得到了一个“证书必须具有ExtendedKeyUsage扩展。”异常
如何生成有效的tsa证书(包含正确的extendedKeyUsage值)
谢谢请尝试以下内容:
openssl.cnf
文件中添加命名节:
[v3_tsa]
extendedKeyUsage = critical,timeStamping
-extensions
:
openssl x509 -req ... -extensions v3_tsa
extendedKeyUsage = critical,timeStamping
在创建请求时添加它:
openssl x509 -req -days 730 -in tsa.csr -CA tsaroot.crt -CAkey tsaroot.key -set_serial 01 -out tsa.crt -extfile extKey.cnf