Discuss this help topic in SecureBlackbox Forum

Save CMS message

When you're finished with editing the CMS, you can save it to stream or file. This is done with the Save() method of your TElSignedCMSMessage object:


FileStream f = new FileStream("signature.p7s", FileMode.Create);
try
{
  cms.Save(f);
}
finally
{
  f.Close();
}
Before saving the CMS you might need to adjust the value of its Detached property to indicate whether you need your CMS to be saved in the detached or enveloping form.

Sometimes you might need to also adjust the UseUndefSize property to specify whether you need SecureBlackbox to use undefined-size ASN.1 tagging. While there is no principal difference between using the fixed and undefined size tags, a specific tagging configuration might be required by some third-party software.

How To articles about Cryptographic Message Syntax (CMS)

Discuss this help topic in SecureBlackbox Forum