C
Casper Hansen
Guest
I need to send a multipart/signed email with detached signature.
The problem is, that I cannot figure out which alternativeview to use.
I have constructed the email so it looks like this (part of the signature is removed):
Content-Type: multipart/signed; protocol="application/pkcs7-signature"
micalg=sha1; boundary="--PTBoundry=3"
----PTBoundry=3
Content-Type: multipart/mixed;
boundary="--PTBoundry=2"
----PTBoundry=2
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
TEST AF signed
----PTBoundry=2
Content-Type: application/octet-stream;
name="test.txt"
Content-Transfer-Encoding: base64
Content-Dis;
filename="test.txt"
bWludGVzdGF0dGFjaG1lbnRzaWduZWQ=
----PTBoundry=2--
----PTBoundry=3
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Dis; filename="smime.p7s"
MIIMIQYJKoZIhvcNAQcCoIIMEjCCDA4CAQExCzAJBgUrDgMCGgUAMIIBrgYJKoZIhvcNAQcBoIIB
/2kbmx/g/Dkp9xuEArLxix645wcSlnCh0NUOPBte6w==
----PTBoundry=3--
I have tried sending this using:
var contentType = new ContentType("application/pkcs7-mime; smime-type=signed-data; name=smime.p7s");
var stream = new MemoryStream(message);
var view = new AlternateView(stream, contentType);
message.AlternateViews.Add(view);
however it is not correct and outlook wrties the following error message: "Cannot open this item. Your digital ID name cannot be found by the underlying security system."
How do I add this as an alternativeview correctly?
The mime header should appear as below, but I have not been able to figure out how to do this.
Content-Type: multipart/signed;
boundary="--PTBoundry=3";
protocol="application/pkcs7-signature"; micalg=sha1
Continue reading...
The problem is, that I cannot figure out which alternativeview to use.
I have constructed the email so it looks like this (part of the signature is removed):
Content-Type: multipart/signed; protocol="application/pkcs7-signature"
micalg=sha1; boundary="--PTBoundry=3"
----PTBoundry=3
Content-Type: multipart/mixed;
boundary="--PTBoundry=2"
----PTBoundry=2
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
TEST AF signed
----PTBoundry=2
Content-Type: application/octet-stream;
name="test.txt"
Content-Transfer-Encoding: base64
Content-Dis;
filename="test.txt"
bWludGVzdGF0dGFjaG1lbnRzaWduZWQ=
----PTBoundry=2--
----PTBoundry=3
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Dis; filename="smime.p7s"
MIIMIQYJKoZIhvcNAQcCoIIMEjCCDA4CAQExCzAJBgUrDgMCGgUAMIIBrgYJKoZIhvcNAQcBoIIB
/2kbmx/g/Dkp9xuEArLxix645wcSlnCh0NUOPBte6w==
----PTBoundry=3--
I have tried sending this using:
var contentType = new ContentType("application/pkcs7-mime; smime-type=signed-data; name=smime.p7s");
var stream = new MemoryStream(message);
var view = new AlternateView(stream, contentType);
message.AlternateViews.Add(view);
however it is not correct and outlook wrties the following error message: "Cannot open this item. Your digital ID name cannot be found by the underlying security system."
How do I add this as an alternativeview correctly?
The mime header should appear as below, but I have not been able to figure out how to do this.
Content-Type: multipart/signed;
boundary="--PTBoundry=3";
protocol="application/pkcs7-signature"; micalg=sha1
Continue reading...