pinvoke CryptSetKeyParam not working?
Hi,
I'm trying to use AES encryption from the win32 cryptoAPIs using pinvoke.
My C# code pinvoke signature reads like this:
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CryptSetKeyParam(IntPtr hKey, uint
dwParam, byte[] pbData, uint dwFlags);
and then I setup CryptGetKeyParam
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CryptGetKeyParam(IntPtr hKey, uint
dwParam, byte[] pbData, ref uint pdwDataLen, uint dwFlags);
Are these signatures right? When I call CryptSetKeyParam to set the
initialization vector and then immediately call CryptGetKeyParam, I get back
all zeros for the initV instead of the value I supplied previously.
date: Fri, 18 Jul 2008 06:16:15 -0700
author: David Moore am