我需要将XML数据发送给检查数据完整性的应用程序。
demodata.pem(http://privatepaste.com/376402542e)
ca.pem(http://privatepaste.com/85fff7bfe3)
D:\stest\wz\apptest\dist\q\realq>openssl smime -verify -inform pem -in demodata.pem -CAfile ca.pem -out out.xml
Verification successful
D:\stest\wz\apptest\dist\q\realq>
所以我在下面的链接中提到了一条新消息。
D:\stest\wz\apptest\dist\q\realq>openssl pkcs7 -in demodata.pem -inform pem -print_certs -out smime.pem
[smime.pem]
-----BEGIN CERTIFICATE-----
MIIDeDCCAuGgAwIBAgIBBDANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCS1Ix
EDAOBgNVBAgTB3dpenZlcmExDjAMBgNVBAcTBXNlb3VsMRAwDgYDVQQKEwd3aXp2
ZXJhMRAwDgYDVQQLEwd3aXp2ZXJhMRIwEAYDVQQDEwlheG1zZXJ2ZXIxHzAdBgkq
hkiG9w0BCQEWEHJvb3RAd2l6dmVyYS5jb20wHhcNMDgxMTE2MDYzMjA1WhcNMjkw
OTA3MDYzMjA1WjB7MQswCQYDVQQGEwJLUjEOMAwGA1UECBMFc2VvdWwxDjAMBgNV
BAcTBXNlb3VsMQwwCgYDVQQKEwNrZWIxDDAKBgNVBAsTA2tlYjESMBAGA1UEAxMJ
a2ViLmNvLmtyMRwwGgYJKoZIhvcNAQkBFg1heG1Aa2ViLmNvLmtyMIGfMA0GCSqG
SIb3DQEBAQUAA4GNADCBiQKBgQDqiAmyc1N+9/+dsOvA8ZvjpAHkF4ZmhSdjf2ZN
9xoh/M6z3YqkTHdchaAdTuiCSvAHiITYgCPEQ4h95ur2/0SdBFk7sbbmNmrhJWTv
KypizOKnJ27pVrNs/HhmMDWw3g0TQmwgDG8pUwR0M2tfP/Z5gNeFK49BnGZMCYJi
4zyQGwIDAQABo4H9MIH6MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5T
U0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRzwPiRKm5PWVsjsSat
FxRTyi3zWjCBnwYDVR0jBIGXMIGUoYGOpIGLMIGIMQswCQYDVQQGEwJLUjEQMA4G
A1UECBMHd2l6dmVyYTEOMAwGA1UEBxMFc2VvdWwxEDAOBgNVBAoTB3dpenZlcmEx
EDAOBgNVBAsTB3dpenZlcmExEjAQBgNVBAMTCWF4bXNlcnZlcjEfMB0GCSqGSIb3
DQEJARYQcm9vdEB3aXp2ZXJhLmNvbYIBADANBgkqhkiG9w0BAQQFAAOBgQCd3RYF
Nn22ca9x1lD/vvKuDk+DM5/448kKowu0zVheWvaU/GrKTCvtyJNMnr87dEn219BE
iAczBxzYaXnQAK09vptCKbc+tc/QG0NRalSxidIiuPvbIjzko/j4IuX6IWOR+5Ka
/EhbG4N5WrmKZkuSpuFxrwdbh5i/AtEpkqBv9w==
-----END CERTIFICATE-----
D:\stest\wz\apptest\dist\q\realq>openssl smime -encrypt -text -in newxml.txt -out newdata.der -outform der smime.pem
Loading 'screen' into random state - done
D:\stest\wz\apptest\dist\q\realq>openssl smime -verify -inform der-in newdata.der -CAfile ca.pem
Verification failure
8476:error:21075071:PKCS7 routines:PKCS7_verify:wrong content type:.\crypto\pkcs
7\pk7_smime.c:285:
D:\stest\wz\apptest\dist\q\realq>
但正如您所见,验证失败。
那么如何从某人的数据中制作签名数据呢?有可能吗?