Getting attachments of a S/MIME signed mail

前端 未结 2 1357
囚心锁ツ
囚心锁ツ 2021-01-19 10:45

I\'m trying to get the attachments of a signed mail via the microsoft-graph-api.

I use a GET-Request on this URL:

https://graph.mi         


        
2条回答
  •  [愿得一人]
    2021-01-19 11:21

    This is not a bug but the expected behavior in case of a 'multipart/signed' message.

    From RFC5751 (bottom of page 26):

    The multipart/signed media type has two parts. The first part contains the MIME entity that is signed; the second part contains the "detached signature" CMS SignedData object in which the encapContentInfo eContent field is absent.

    So the signed content, including any attachments, is stored inside the one smime.p7m attachment. It is up to you to extract it.

    Assuming you are using .Net, you can use the SignedCms class to validate the signature and retrieve the content using the ContentInfo property.

提交回复
热议问题