Decrypting PKCS#7 encrypted data in C#

后端 未结 4 1419
无人及你
无人及你 2020-12-10 19:53

I am working on a solution that needs to decrypt PKCS#7 encrypted data, preferably in C#. As far as I can see, the .NET api has support for this through the System.Security.

4条回答
  •  无人及你
    2020-12-10 20:39

    The .NET framework has only rudimentary support for PKCS#7/CMS, so it does not support streaming the data.

    You need a 3rd party library. As others have mentioned, BouncyCastle is an excellent choice. It does support PKCS#7 (PKCS#7 is also known as CMS).

    Their tests are probably a good place to look for sample code: EnvelopedDataStreamTest.cs.

提交回复
热议问题