0

我尝试使用 tcl 包 pki::sign。目标是使用 tclws 使用 X509 证书对 SOAP 消息进行签名。

解析公钥是可以的:

pki::x509::parse_cert $publickey

但是,解析私钥不起作用

pki::pkcs::parse_key $privatekey  

它导致以下错误:

"Expected Sequence (0x30), but got 42"

证书作为 .p12 文件提供给我。我可以使用以下命令使用 openssl 获取公钥和私钥:

公钥:

openssl pkcs12 -in cert.p12 -clcerts -nokeys -out cert.pem 

私钥:

openssl pkcs12 -in cert.p12 -nocerts -nodes -out key.pem 
4

0 回答 0