SecureBlackbox 16: How do I sign / encrypt the text data (and not a file)?
PKCS#7 message signing and encryption classes work with binary data buffers and streams. You pass the text data as a binary data buffer to the class or use MemoryStream (in .NET), TMemoryStream (in VCL), or the IStream interface implementation (in ActiveX) to keep the text data.
With PGP, you need to save the data to MemoryStream (in .NET), TMemoryStream (in VCL), or the IStream interface implementation (in ActiveX). Then pass the resulting stream as an input stream to the PGP classes. Use another in-memory stream object to receive the resulting data.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.