Pozdrav svima.
Imam exception na metodu ispod.
Sta sa nizom nije dovoljno "long"?
Evo print-screen exception-a:
http://picpaste.com/Screenshot_7-dFA8Vq9P.png
Hvala unapred.
Kôd:
public static CryptoStream GetCryptoReadStream( Stream stream )
{
ICryptoTransform encryptor;
Byte[] byteName;
Byte[] byteSerial;
byteName=new Byte[32];
byteName.Initialize();
byteSerial=new Byte[16];
byteSerial.Initialize();
Array.Copy(Encoding.ASCII.GetBytes(Settings.Name),0,byteName,0,
Math.Min(Encoding.ASCII.GetBytes(Settings.Name).Length,32));
Array.Copy(Encoding.ASCII.GetBytes(Settings.Serial),0,byteSerial,0,16);
RijndaelManaged rm;
rm=new RijndaelManaged();
encryptor=rm.CreateDecryptor(byteName,byteSerial);
CryptoStream cryptoStream;
cryptoStream=new CryptoStream(stream,encryptor,CryptoStreamMode.Read);
return cryptoStream;
}