Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get attachment from multipart/signed attachments #1587

Closed
SandraCHC opened this issue Sep 26, 2024 · 2 comments
Closed

Get attachment from multipart/signed attachments #1587

SandraCHC opened this issue Sep 26, 2024 · 2 comments
Labels
for:MS-Q&A An issue that's better suited for Microsoft Q&A no-recent-activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@SandraCHC
Copy link

When a message is signed, I receive a smime.p7m file as an attachment. When I display the content, I see several file attachments with the file name and the Base64 content.

I receive my file attachments with

$attachments = $graphServiceClient->users()->byUserId($address)->messages()->byMessageId($messageId)->attachments()->get()->wait();
foreach ($attachments->getValue() as $attachment) {
    $data = \base64_decode($attachment->getBackingStore()->get('contentBytes'));
    ...
}

But how do I read the file attachments if they are in a smime.p7m? Is there a function for this?

I have found this issue (#980), but I don't understand how I can implement this with PHP.

@SandraCHC SandraCHC added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Sep 26, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Oct 8, 2024

Hi @SandraCHC
PHP provides openssl_pkcs7_decrypt to decrypt S/MIME content. However, you'll need the certificate and private key that were used when signing the message.

You may need to collaborate with your tenant admin to retrieve the configured certificates. Microsoft Graph doesn't control this functionality but here are some potentially useful links to download the certificates & decrypt the messages:

Microsoft Q&A would also be a good place to ask this to get more domain experts on this.

@Ndiritu Ndiritu added type:question An issue that's a question status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close for:MS-Q&A An issue that's better suited for Microsoft Q&A and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 8, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for:MS-Q&A An issue that's better suited for Microsoft Q&A no-recent-activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
None yet
Development

No branches or pull requests

2 participants