Openssl неправильный тип содержимого при расшифровке подписанного и зашифрованного сообщения SMIME - PullRequest
0 голосов
/ 30 октября 2019

У меня есть следующее смайм-сообщение из составного тела. Я пытаюсь расшифровать его с помощью команды openSSL ниже, используя сертификат и закрытый ключ. Однако я получаю ошибку неправильного типа контента. Кто-нибудь знает, откуда эта ошибка и как ее устранить?

команда openssl

openssl smime -decrypt -in enc_signed.txt -recip enc_signed.crt -inkey enc_signed.key

smime message

MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha1"; boundary="----BC660923488785300E5AA069D494A307"

This is an S/MIME signed message

------BC660923488785300E5AA069D494A307
MIME-Version: 1.0
Content-Disposition: attachment; filename="smime.p7m"
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name="smime.p7m"
Content-Transfer-Encoding: base64

MIICTAYJKoZIhvcNAQcDoIICPTCCAjkCAQAxggHUMIIB0AIBADCBtzCBnjELMAkG
A1UEBhMCTFUxETAPBgNVBAgMCFdJSU5ESE9GMRAwDgYDVQQHDAdXSU5ESE9GMSYw
JAYDVQQKDB1TSEVMVEVSIElOVkVTVE1FTlQgTUFOQUdFTUVOVDEPMA0GA1UECwwG
SU5WRVNUMQwwCgYDVQQDDANUSU0xIzAhBgkqhkiG9w0BCQEWFFRWQHJlZ28tcGFy
dG5lcnMuY29tAhQX1dnJd/SNV8/NKNb2TQ96aiAlSjANBgkqhkiG9w0BAQEFAASC
AQCVtqj7jlPkUqWlXfT+QPBfDh1ROWm4hEOb98h6UBbGMs/p+8LqUc3urwLYR0+2
i6I1ZACARwU4aGjCz6EcRn8FyUAoOGEB79cJTm57yjyq4rYK+0+6Gd9ac0nXvQSM
YYLrj7ORlPDHGVGFTfoJbZUaPp/gw733uh2vAYRoTWzQfQRpMxsL1K4laG0EEkfq
bnfPOiLW+ny7e5L/dboUcuibjEoc+n7muNPk8Hlnhn+iEppWBJf4mrGrYhpt7Wds
05/O9vwNDqfzBfuNPI/n7/liWfCP88i6/AACL7BRuHyGH3bvicf4/en6oFYT4nsg
dhdvrqelZ6mTLRyoVqWiBc4MMFwGCSqGSIb3DQEHATAdBglghkgBZQMEASoEEGRf
nDtU6BcN00AoAanDnJ+AMJBPtHISf7elUDtj6OkQV+KVpYxb5dyDFsUmQwxjg/Dx
bPo4h6l7FPOAW1izt9sG3A==


------BC660923488785300E5AA069D494A307
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"

MIIGawYJKoZIhvcNAQcCoIIGXDCCBlgCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3
DQEHAaCCA7UwggOxMIICmaADAgECAgkAj4Lp9JFutvswDQYJKoZIhvcNAQELBQAw
bzELMAkGA1UEBhMCQkUxETAPBgNVBAgMCEJydXNzZWxzMRUwEwYDVQQKDAxEZXV0
Y2hlIGJhbmsxCzAJBgNVBAsMAklUMSkwJwYJKoZIhvcNAQkBFhpiZWxnaXVtLnRj
cy1zdXBwb3J0QGRiLmNvbTAeFw0xODEyMDMxNjE4MDVaFw0yMzExMDcxNjE4MDVa
MG8xCzAJBgNVBAYTAkJFMREwDwYDVQQIDAhCcnVzc2VsczEVMBMGA1UECgwMRGV1
dGNoZSBiYW5rMQswCQYDVQQLDAJJVDEpMCcGCSqGSIb3DQEJARYaYmVsZ2l1bS50
Y3Mtc3VwcG9ydEBkYi5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQDcsTDdxqoIolObxraPXybLnLLa64a7X+MV5ed+jcHHeYw++0k2zRAWVv+E4FV0
44EoyZmJ7p01q6o3A4NAusZ/Mfq0lltqwAxymiehuOYZKhUaecMznZXZhUoPText
1q5pDQJxBo7lNGtObS83BARiKh/M4DeUcMGlN5rvof8kVK8NzN9SlfqaBIlzv7TC
VuD0Lfm3JNIb15DZFamD640D2ssrXVRkfkoypf27Kk2ueTZO+000dl5LawonlD04
B+ha+Nv36+O+Vsz2iuv2V3adINDbwB36Fh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G9w0BAQEFAASCAQBv
yUigOBkwQ9znFaHm1iEkGY/bANDQulKovNC8Xqreyy2UgxkN5bCE0lzUgA2uCdXf
QF9G4I6Gyt/nhhEYGSntxZnPf2hq9EceNx9U3AvqAKGso/MZgE+VU7H0f7B1QNgL
oJPR9RWwlgY+30P42Y8ipmGiOGTFRW+sjPg/FnFZqittdry5ToAztHtT4Puddxf5
3yGt44AmxdTwKD1NoJdjjebawlsJ3N1Q5IK8Lg8E9gHvTqsNvbkrI7aD/QHDMI35
wVS2zXhWK/q+Lvpy31iGXTmMF4eRt5tcpkBc2kHbIs1dAJAstfpoXQ6YFAHVH9XR
6MQMhg7rbKmosyFMXs32

------BC660923488785300E5AA069D494A307--

ошибка

Error decrypting PKCS#7 structure
3848:error:21072071:PKCS7 routines:PKCS7_decrypt:wrong content type:crypto\pkcs7\pk7_smime.c:489:
...