public void DigestEncrypt(Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, byte[] data, out byte[] digest, out byte[] encryptedData)
{
if (this._disposed)
throw new ObjectDisposedException(this.GetType().FullName);
if (digestingMechanism == null)
throw new ArgumentNullException("digestingMechanism");
if (encryptionMechanism == null)
throw new ArgumentNullException("encryptionMechanism");
if (keyHandle == null)
throw new ArgumentNullException("keyHandle");
if (data == null)
throw new ArgumentNullException("data");
using (MemoryStream inputMemoryStream = new MemoryStream(data), outputMemorySteam = new MemoryStream())
{
digest = DigestEncrypt(digestingMechanism, encryptionMechanism, keyHandle, inputMemoryStream, outputMemorySteam);
encryptedData = outputMemorySteam.ToArray();
}
}