有点难度……一个infosec_api.h文件,一个与之相关的certinfo.lib文件。目标:写一个组件要在能在ASP中创建,并且能调用infosec_api.h中定义的各个函数……

Kandy 2001-12-12 01:49:28
在BCB中应该具体怎样声明??
infosec_api.h 源文件如下:
#ifndef _INFOSEC_API_
#define _INFOSEC_API_


#ifdef WIN32
#ifndef DLLENTRY
#define DLLENTRY __declspec(dllimport)
#endif
#else
#define DLLENTRY
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
Description:
sign a string

parameter:
src (in)--data to be sign
srcLen (in)--src 's length
privateKey (in)--private key
keyLen (in)--private key len
keyPass (in)--private key password,must be '\0' end string
signBuf (out)-signature data buffer
signBufLen (out)-signature buffer' length

return:
0 for successful
-1 src error
-2 private key error
-3 decrypt error
remark:
the caller has obligation to free the 'signBuf'
*/
DLLENTRY int sign(char *src,int srcLen,char *privateKey,
int keyLen,char *keyPass,char **signBuf,int *signBufLen);
/*
Description:
verify a signature

parameter:
src (in)--data to be verify
srcLen (in)--src 's length
cert (in)--certificate
certLen (in)--certificate len
signBuf (in)--signature buffer
signBufLen (in)--signature buffer' length

return:
0 signature is good
-1 decode cert failure
*/
DLLENTRY int verifySign(char *src,int srcLen,char *cert,int certLen,
char *signBuf,int signBufLen);
/*
Description:
base64 encode

parameter:
src (in)--src to be encoded
srcLen (in)--src len
dst (out)-base64 encode result
dstLen (out)-dst len
return:
0 get ok
-1 failure
remark:
caller must free "dst"
*/
DLLENTRY int base64enc(char *src,int srcLen,char **dst,int *dstLen);
/*
Description:
base64 decode

parameter:
src (in)--src to be decode
srcLen (in)--src len
dst (out)-base64 decode result
dstLen (out)-dst len
return:
0 get ok
-1 failure
remark:
caller must free "dst"
*/
DLLENTRY int base64dec(char *src,int srcLen,char **dst,int *dstLen);
/*
Description:
get certificate ID

parameter:
mertCert (in)--certificate
mertCertLen (in)--cert len
id (out)-id
idLen (out)-id len
return:
0 get ok
-1 failure
remark:
caller must free "id"
*/
DLLENTRY int getCertID(char *mertCert,int mertCertLen,char **id,int *idLen);

DLLENTRY void infosec_free(void *dst);
#ifdef __cplusplus
}
#endif

#endif
...全文
144 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kandy 2001-12-12
  • 打赏
  • 举报
回复
高手低手都没有?

1,220

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧