终于使用Microsoft Enhanced Cryptographic Provider v1.0 实现了公钥加密和解密,但SafeSign CSP Version 1.0不能,不知为什么,有高手能解答吗?
另外dwBufLen 怎样计算才好,我取100,出编号234错,便取了200。
以下程序在VS2003下调试成功
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <wincrypt.h>
void HandleError(char *s);
#define SA_SIGN_PROV "SafeSign CSP Version 1.0"
int _tmain(int argc, _TCHAR* argv[])
{
HCRYPTPROV hCryptProv;
HCRYPTKEY hXchgKey; //交换密钥
BYTE pbData[1000];
DWORD cbData;
printf("A cryptographic provider will acquired. /n");
char ch;
//--------------------------------------------------------------------
//访问CSP
if(CryptAcquireContext(
&
另外dwBufLen 怎样计算才好,我取100,出编号234错,便取了200。
以下程序在VS2003下调试成功
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <wincrypt.h>
void HandleError(char *s);
#define SA_SIGN_PROV "SafeSign CSP Version 1.0"
int _tmain(int argc, _TCHAR* argv[])
{
HCRYPTPROV hCryptProv;
HCRYPTKEY hXchgKey; //交换密钥
BYTE pbData[1000];
DWORD cbData;
printf("A cryptographic provider will acquired. /n");
char ch;
//--------------------------------------------------------------------
//访问CSP
if(CryptAcquireContext(
&