If you are concerned about disk I/O you can use a
MemoryStream
.
However, the RSACryptoServiceProvider class will operate on byte arrays. This class performs asymmetric encryption and decryption using an implementation of the RSA algorithm.
The examples
here show how you can do this with byte arrays