我在一些Java代码中签署数据包,我想验证C服务器上的签名.我想为此目的分叉openssl(以后总是可以使用库函数...当我知道openssl可以验证签名时); 但是,它没有这样做:
openssl dgst -verify cert.pem -signature file.sha1 file.data
Run Code Online (Sandbox Code Playgroud)
证书说:
openssl verify cert.pem
cert.pem: /C=....
error 20 at 0 depth lookup:unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)
但是,我特别不关心验证证书,我只想验证给定文件的签名!
输出openssl x509 -in cert.pem -noout -text是:
Certificate:
Data:
Version: 1 (0x0)
Serial Number:
...
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=...
Validity
Not Before: Feb 1 15:22:44 2010 GMT
Not After : Jun 19 15:22:44 2037 GMT
Subject: C=...
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: …Run Code Online (Sandbox Code Playgroud)