29
我正在某些Java代碼中籤名數據包,我想驗證C服務器上的簽名。我想爲此目的分叉openssl(以後總是可以使用庫函數......當我知道openssl可以驗證簽名時);然而,它不這樣做:使用openssl驗證文件簽名dgst
openssl dgst -verify cert.pem -signature file.sha1 file.data
- 所有它說的是 「無法加載密鑰文件」
證書說:
openssl verify cert.pem
cert.pem: /C=....
error 20 at 0 depth lookup:unable to get local issuer certificate
然而,我特別不關心驗證證書,我只想驗證給定的簽名文件!
的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: (2048 bit)
Modulus (2048 bit):
00:cc:cc:f9:c7:3a:00:0f:07:90:55:d9:fb:a9:fe:
...
32:cc:ee:7f:f2:01:c7:35:d2:b5:9b:35:dd:69:76:
00:a9
Exponent: 65537 (0x10001)
Signature Algorithm: sha1WithRSAEncryption
39:d6:2c:6b:6a:00:74:b5:81:c2:b8:60:d6:6b:54:11:41:8d:
...
8f:3e:3f:5d:b3:f8:dd:5e
我認爲有一些問題與cert.pem。 「openssl x509 -in cert.pem -noout -text」輸出是什麼? – 2010-03-05 08:12:22
@Anders Lindahl我已經添加了這個問題 – Will 2010-03-05 08:33:13