I have a signed message created by openssl (openssl smime -sign ....). I
would like to verify the signature in the signed file step by step. (i
know that i can do verification process by the command openssl smime
-verify ..)
-first, i have do openssl asn1pase ... to take more information.
- second, i have compared the the octet string of the message digest,
which is seen when doing the first step, with the hash of the file, is
the same hash.
- third, i have taken the octet string of the signature and have
verified it by "openssl rsautl -verify " using the public key of the
signer. The latter command output is the identifier of the hash
algorithm and the message digest. This message digest is not the hash of
the file which is signed.
So, how can i deal with this problem.
signature verification step by step usin openssl.
-----BEGIN PKCS7-----
MIIFqgYJKoZIhvcNAQcCoIIFmzCCBZcCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3
DQEHAaCCA7MwggOvMIICl6ADAgECAgEBMA0GCSqGSIb3DQEBBAUAMGAxCzAJBgNV
BAYTAlROMQ0wCwYDVQQKEwRBTkNFMQ0wCwYDVQQLEwRBTkNFMQ0wCwYDVQQDEwRh
bmNlMSQwIgYJKoZIhvcNAQkBFhVhbmNlQGNlcnRpZmljYXRpb24udG4wHhcNMDYw
MzI3MTMwMjM5WhcNMDcwMzI3MTMwMjM5WjBaMQswCQYDVQQGEwJUTjEMMAoGA1UE
ChMDVFROMQwwCgYDVQQLEwNUVE4xDjAMBgNVBAMTBXRlc3QxMR8wHQYJKoZIhvcN
AQkBFhB0ZXN0MUB0dG4uY29tLnRuMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
gQDghNYE9au+PC1jW3MBALp6ZgJjCtDfUzrP5EcqwniDhHlA3ndvxbwZaAV0FAf1
ZnW8OjCBrzCQz0cWDpLHjoO9ozSWT97Vc8B2Am/LWS/90SFrDC7LkomRdrIGC7LH
pwiIgRxXpcg1hIfXOvznnf45pIh7iJ8o84h1eQCHf8TngQIDAQABo4H9MIH6MAkG
A1UdEwQCMAAwCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl
bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUxWLQON3kRF0XqWnES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