<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.0" />

CmsEnvelopedDataStreamGenerator

Constructor allowing specific source of randomness

public Stream Open(Stream outStream, string encryptionOid)

public Stream Open(Stream outStream, string encryptionOid, int keySize)

public void SetBerEncodeRecipients(bool berEncodeRecipientSet)

Use a BER Set to store the recipient information.

public void SetBufferSize(int bufferSize)

Set the underlying string size for encapsulated data.