Discuss this help topic in SecureBlackbox Forum

Save data (content) of CMS message

To save the payload (content, data) of the CMS message, use the Size property and Read() method of TElCMSContent object, accessed via TElCMSMessage.Content property.


FileStream f = new FileStream("mydata.txt", FileMode.Create);
try
{
    byte[] buf = new byte[Msg.Content.Size];
	Msg.Content.Read(ref buf, 0, buf.Length, 0);
	f.Write(buf, 0, buf.Length);
}
finally
{
  f.Close();
}

How To articles about Cryptographic Message Syntax (CMS)

Discuss this help topic in SecureBlackbox Forum