public byte[] DecryptToBytes(EncryptedData encrypted) { if (encrypted == null) throw new ArgumentNullException("encrypted"); if (encrypted.Data == null) throw new ArgumentException("Data property of encrypted cannot be null"); if (encrypted.IV == null) throw new ArgumentException("IV property of encrypted cannot be null"); return DecryptToBytes(encrypted.Data, encrypted.IV); }
public void DecryptToStream(EncryptedData encrypted, Stream outStream) { if (encrypted == null) throw new ArgumentNullException("encrypted"); if (encrypted.Data == null) throw new ArgumentException("Data property of encrypted cannot be null"); if (encrypted.IV == null) throw new ArgumentException("IV property of encrypted cannot be null"); DecryptToStream(encrypted.Data, encrypted.IV, outStream); }