WIP saving

This commit is contained in:
2017-09-20 18:45:37 +02:00
parent 668ffcb107
commit c4ac244270
6 changed files with 64 additions and 67 deletions

View File

@@ -18,17 +18,16 @@ namespace ModernKeePassLib.Serialization
private IEnumerator<byte> m_enumerator = null;
public CryptoStream(Stream s, String strAlgName, bool bEncrypt, byte[] pbKey, byte[] pbIV)
: base()
{
IBuffer iv = CryptographicBuffer.CreateFromByteArray(pbIV);
SymmetricKeyAlgorithmProvider objAlg = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);
CryptographicKey key = objAlg.CreateSymmetricKey( CryptographicBuffer.CreateFromByteArray(pbKey) );
if (bEncrypt)
/*if (bEncrypt)
{
Debug.Assert(false, "Not implemented yet");
}
else
{
{*/
// For the time being, WinRT CryptographicEngine doesn't support stream decoding. Bummer.
// Copy the file to a memory buffer, then decode all at once.
@@ -50,7 +49,7 @@ namespace ModernKeePassLib.Serialization
}
CryptographicBuffer.CopyToByteArray(decoded, out m_decoded);
m_enumerator = m_decoded.AsEnumerable().GetEnumerator();
}
//}
}