[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
[return : MarshalAs(UnmanagedType.Bool)]
static extern bool CryptAcquireContext(ref IntPtr hProv, string pszContainer,
string pszProvider, uint dwProvType, uint dwFlags);
Declare Function CryptAcquireContext Lib "advapi32.dll" (ByRef hProv As IntPtr, _
pszContainer As String, pszProvider As String, dwProvType As Integer, _
dwFlags As Integer) As Boolean
None.
None.
Please add some!
public class Crypt32
{
[DllImport("advapi32.dll", SetLastError=true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CryptAcquireContext(
out IntPtr phProv,
string pszContainer,
string pszProvider,
uint dwProvType,
uint dwFlags);
}
.......
IntPtr hProv = new IntPtr();
bool res = Crypt32.CryptAcquireContext(out hProv, "user", null, PROV_RSA_FULL, CRYPT_NEWKEYSET);
TODO