函数声明(简单,送您50分)(0分)

  • 主题发起人 主题发起人 Zephyr
  • 开始时间 开始时间
Z

Zephyr

Unregistered / Unconfirmed
GUEST, unregistred user!
哪位大侠能帮我把以下API函数的Delphi函数声明写出来,给他50分:<br>***&lt;A HREF="http://www.gislab.ecnu.edu.cn/delphibbs/DispQ.asp?LID=215428"&gt;答题后请到这儿拿分&lt;/A&gt;***<br>CryptAcquireContext<br>CryptGetProvParam<br>CryptReleaseContext<br>CryptSetProvider<br>CryptSetProvParam<br>CryptDeriveKey<br>CryptGenKey<br>CryptDestroyKey<br>CryptExportKey<br>CryptGenRandom<br>CryptGetKeyParam<br>CryptGetUserKey<br>CryptImportKey<br>CryptSetKeyParam<br>CryptEncrypt<br>CryptDecrypt<br><br>谢谢!
 
一个简便方法: VC++的wincrypt.h里面有C++的声明格式.<br><br>如果要翻译成delphi,50分太少了.
 
那就再加50分,一共100分,不知够不够。<br>我快倾家荡产了,现在只剩75分了。
 
呵呵,不够:)
 
这个问题是帮朋友问的,为朋友两肋插刀,花再多分也行!<br>我把分数加到&lt;B&gt;200分&lt;/B&gt;(答完题我会另开一帖子给分),<br>希望各位大侠帮忙一下。
 
找到一个现成的:<br><br>unit wincrypt;<br><br>{$ALIGN ON}<br><br>{$IFNDEF VER90}<br>&nbsp; {$WEAKPACKAGEUNIT}<br>{$ENDIF}<br>interface<br><br>uses<br>&nbsp; Windows;<br><br>const<br>&nbsp; CryptDll &nbsp;= 'advapi32.dll';<br><br>&nbsp; {---------------------------------------------------------------------------<br><br>&nbsp; Microsoft Windows<br>&nbsp; Copyright (C) Microsoft Corporation, 1992 - 1996.<br><br>&nbsp; File: wincrypt.h<br>&nbsp; Contents: Cryptographic API Prototypes and Definitions<br>&nbsp; ----------------------------------------------------------------------------}<br><br>&nbsp; {Algorithm IDs and Flags }<br><br>&nbsp; {ALG_ID crackers }<br>function GET_ALG_CLASS(x :integer) :integer;<br>function GET_ALG_TYPE(x :integer) :integer;<br>function GET_ALG_SID(x :integer) :integer;<br><br>{Algorithm classes }<br>const<br>&nbsp; ALG_CLASS_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0;<br>&nbsp; ALG_CLASS_SIGNATURE &nbsp; &nbsp; &nbsp; = (1 shl 13);<br>&nbsp; ALG_CLASS_MSG_ENCRYPT &nbsp; &nbsp; = (2 shl 13);<br>&nbsp; ALG_CLASS_DATA_ENCRYPT &nbsp; &nbsp;= (3 shl 13);<br>&nbsp; ALG_CLASS_HASH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (4 shl 13);<br>&nbsp; ALG_CLASS_KEY_EXCHANGE &nbsp; &nbsp;= (5 shl 13);<br>&nbsp; {Algorithm types }<br>&nbsp; ALG_TYPE_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0;<br>&nbsp; ALG_TYPE_DSS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (1 shl 9);<br>&nbsp; ALG_TYPE_RSA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (2 shl 9);<br>&nbsp; ALG_TYPE_BLOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (3 shl 9);<br>&nbsp; ALG_TYPE_STREAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (4 shl 9);<br>&nbsp; {Generic sub-ids }<br>&nbsp; ALG_SID_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0;<br>&nbsp; {Some RSA sub-ids }<br>&nbsp; ALG_SID_RSA_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0;<br>&nbsp; ALG_SID_RSA_PKCS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; ALG_SID_RSA_MSATWORK &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; ALG_SID_RSA_ENTRUST &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; ALG_SID_RSA_PGP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 4;<br>&nbsp; {Some DSS sub-ids}<br>&nbsp; ALG_SID_DSS_ANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0;<br>&nbsp; ALG_SID_DSS_PKCS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; ALG_SID_DSS_DMS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; {Block cipher sub ids DES sub_ids }<br>&nbsp; ALG_SID_DES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; ALG_SID_3DES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 3;<br>&nbsp; ALG_SID_DESX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4;<br>&nbsp; ALG_SID_IDEA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 5;<br>&nbsp; ALG_SID_CAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 6;<br>&nbsp; ALG_SID_SAFERSK64 &nbsp; &nbsp; &nbsp; &nbsp; = 7;<br>&nbsp; ALD_SID_SAFERSK128 &nbsp; &nbsp; &nbsp; &nbsp;= 8;<br>&nbsp; {KP_MODE }<br>&nbsp; CRYPT_MODE_CBCI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 6; &nbsp;{ANSI CBC Interleaved}<br>&nbsp; CRYPT_MODE_CFBP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7; &nbsp;{ANSI CFB Pipelined}<br>&nbsp; CRYPT_MODE_OFBP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 8; &nbsp;{ANSI OFB Pipelined}<br>&nbsp; CRYPT_MODE_CBCOFM &nbsp; &nbsp; &nbsp; &nbsp; = 9; &nbsp;{ANSI CBC + OF Masking}<br>&nbsp; CRYPT_MODE_CBCOFMI &nbsp; &nbsp; &nbsp; &nbsp;= 10; {ANSI CBC + OFM Interleaved}<br>&nbsp; {RC2 sub-ids }<br>&nbsp; ALG_SID_RC2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; {Stream cipher sub-ids }<br>&nbsp; ALG_SID_RC4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; ALG_SID_SEAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; {Hash sub ids }<br>&nbsp; ALG_SID_MD2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; ALG_SID_MD4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; ALG_SID_MD5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; ALG_SID_SHA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 4;<br>&nbsp; ALG_SID_MAC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 5;<br>&nbsp; ALG_SID_RIPEMD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 6;<br>&nbsp; ALG_SID_RIPEMD160 &nbsp; &nbsp; &nbsp; &nbsp; = 7;<br>&nbsp; ALG_SID_SSL3SHAMD5 &nbsp; &nbsp; &nbsp; &nbsp;= 8;<br>&nbsp; {Our silly example sub-id }<br>&nbsp; ALG_SID_EXAMPLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 80;<br><br>&nbsp; {$IFNDEF ALGIDDEF}<br>&nbsp; {$DEFINE ALGIDDEF}<br>type<br>&nbsp; ALG_ID = DWORD; &nbsp;//Cardinal;<br>&nbsp; {$ENDIF}<br><br>&nbsp; {algorithm identifier definitions }<br>const<br>&nbsp; CALG_MD2 &nbsp; &nbsp; &nbsp;= (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD2);<br>&nbsp; CALG_MD4 &nbsp; &nbsp; &nbsp;= (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD4);<br>&nbsp; CALG_MD5 &nbsp; &nbsp; &nbsp;= (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD5);<br>&nbsp; CALG_SHA &nbsp; &nbsp; &nbsp;= (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_SHA);<br>&nbsp; CALG_MAC &nbsp; &nbsp; &nbsp;= (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MAC);<br>&nbsp; CALG_RSA_SIGN = (ALG_CLASS_SIGNATURE or ALG_TYPE_RSA or ALG_SID_RSA_ANY);<br>&nbsp; CALG_DSS_SIGN = (ALG_CLASS_SIGNATURE or ALG_TYPE_DSS or ALG_SID_DSS_ANY);<br>&nbsp; CALG_RSA_KEYX = (ALG_CLASS_KEY_EXCHANGE or ALG_TYPE_RSA or ALG_SID_RSA_ANY);<br>&nbsp; CALG_DES &nbsp; &nbsp; &nbsp;= (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_BLOCK or ALG_SID_DES);<br>&nbsp; CALG_RC2 &nbsp; &nbsp; &nbsp;= (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_BLOCK or ALG_SID_RC2);<br>&nbsp; CALG_RC4 &nbsp; &nbsp; &nbsp;= (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_STREAM or ALG_SID_RC4);<br>&nbsp; CALG_SEAL &nbsp; &nbsp; = (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_STREAM or ALG_SID_SEAL);<br><br>type<br>&nbsp; VTableProvStruc = record<br>&nbsp; &nbsp; Version &nbsp; &nbsp; &nbsp; &nbsp; :LongInt;<br>&nbsp; &nbsp; FuncVerifyImage :TFarProc;<br>&nbsp; &nbsp; FuncReturnhWnd &nbsp;:TFarProc;<br>&nbsp; end;<br>&nbsp; PVTableProvStruc = ^VTableProvStruc;<br><br>const<br>&nbsp; {dwFlags definitions for CryptAquireContext }<br>&nbsp; CRYPT_VERIFYCONTEXT &nbsp; &nbsp;= $F0000000;<br>&nbsp; CRYPT_NEWKEYSET &nbsp; &nbsp; &nbsp; &nbsp;= $8;<br>&nbsp; CRYPT_DELETEKEYSET &nbsp; &nbsp; = $10;<br>&nbsp; {dwFlag definitions for CryptGenKey }<br>&nbsp; CRYPT_EXPORTABLE &nbsp; &nbsp; &nbsp; = $00000001;<br>&nbsp; CRYPT_USER_PROTECTED &nbsp; = $00000002;<br>&nbsp; CRYPT_CREATE_SALT &nbsp; &nbsp; &nbsp;= $00000004;<br>&nbsp; CRYPT_UPDATE_KEY &nbsp; &nbsp; &nbsp; = $00000008;<br>&nbsp; {exported key blob definitions }<br>&nbsp; SIMPLEBLOB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $1;<br>&nbsp; PUBLICKEYBLOB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $6;<br>&nbsp; PRIVATEKEYBLOB &nbsp; &nbsp; &nbsp; &nbsp; = $7;<br>&nbsp; AT_KEYEXCHANGE &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; AT_SIGNATURE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; CRYPT_USERDATA &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; {dwParam }<br>&nbsp; KP_IV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1; {Initialization vector}<br>&nbsp; KP_SALT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 2; {Salt value}<br>&nbsp; KP_PADDING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3; {Padding values}<br>&nbsp; KP_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4; {Mode of the cipher}<br>&nbsp; KP_MODE_BITS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 5; {Number of bits to feedback}<br>&nbsp; KP_PERMISSIONS &nbsp; &nbsp; &nbsp; &nbsp; = 6; {Key permissions DWORD}<br>&nbsp; KP_ALGID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7; {Key algorithm}<br>&nbsp; KP_BLOCKLEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 8; {Block size of the cipher}<br>&nbsp; {KP_PADDING }<br>&nbsp; PKCS5_PADDING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1; {PKCS 5 (sec 6.2) padding method}<br>&nbsp; {KP_MODE }<br>&nbsp; CRYPT_MODE_CBC &nbsp; &nbsp; &nbsp; &nbsp; = 1; {Cipher block chaining}<br>&nbsp; CRYPT_MODE_ECB &nbsp; &nbsp; &nbsp; &nbsp; = 2; {Electronic code book}<br>&nbsp; CRYPT_MODE_OFB &nbsp; &nbsp; &nbsp; &nbsp; = 3; {Output feedback mode}<br>&nbsp; CRYPT_MODE_CFB &nbsp; &nbsp; &nbsp; &nbsp; = 4; {Cipher feedback mode}<br>&nbsp; CRYPT_MODE_CTS &nbsp; &nbsp; &nbsp; &nbsp; = 5; {Ciphertext stealing mode}<br>&nbsp; {KP_PERMISSIONS }<br>&nbsp; CRYPT_ENCRYPT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0001; {Allow encryption}<br>&nbsp; CRYPT_DECRYPT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0002; {Allow decryption}<br>&nbsp; CRYPT_EXPORT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0004; {Allow key to be exported}<br>&nbsp; CRYPT_READ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0008; {Allow parameters to be read}<br>&nbsp; CRYPT_WRITE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0010; {Allow parameters to be set}<br>&nbsp; CRYPT_MAC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0020; {Allow MACs to be used with key}<br>&nbsp; HP_ALGID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0001; {Hash algorithm}<br>&nbsp; HP_HASHVAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0002; {Hash value}<br>&nbsp; HP_HASHSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0004; {Hash value size}<br>&nbsp; CRYPT_FAILED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = FALSE;<br>&nbsp; CRYPT_SUCCEED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= TRUE;<br><br>function RCRYPT_SUCCEEDED(rt :BOOL) :BOOL;<br>function RCRYPT_FAILED(rt :BOOL) :BOOL;<br><br>const<br>&nbsp; {CryptGetProvParam}<br>&nbsp; PP_ENUMALGS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; PP_ENUMCONTAINERS &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; PP_IMPTYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; PP_NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4;<br>&nbsp; PP_VERSION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 5;<br>&nbsp; PP_CONTAINER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 6;<br>&nbsp; CRYPT_FIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; CRYPT_NEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; CRYPT_IMPL_HARDWARE &nbsp; &nbsp;= 1;<br>&nbsp; CRYPT_IMPL_SOFTWARE &nbsp; &nbsp;= 2;<br>&nbsp; CRYPT_IMPL_MIXED &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; CRYPT_IMPL_UNKNOWN &nbsp; &nbsp; = 4;<br>&nbsp; {CryptSetProvParam}<br>&nbsp; PP_CLIENT_HWND &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; PROV_RSA_FULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; PROV_RSA_SIG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2;<br>&nbsp; PROV_DSS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; PROV_FORTEZZA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4;<br>&nbsp; PROV_MS_EXCHANGE &nbsp; &nbsp; &nbsp; = 5;<br>&nbsp; PROV_SSL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 6;<br>&nbsp; {STT defined Providers}<br>&nbsp; PROV_STT_MER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7;<br>&nbsp; PROV_STT_ACQ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 8;<br>&nbsp; PROV_STT_BRND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 9;<br>&nbsp; PROV_STT_ROOT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 10;<br>&nbsp; PROV_STT_ISS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 11;<br>&nbsp; MS_DEF_PROV_A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 'Microsoft Base Cryptographic Provider v1.0';<br>&nbsp; MS_DEF_PROV_W &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 'Microsoft Base Cryptographic Provider v1.0';<br>&nbsp; {$IFDEF UNICODE}<br>&nbsp; MS_DEF_PROV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= MS_DEF_PROV_W;<br>&nbsp; {$ELSE}<br>&nbsp; MS_DEF_PROV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= MS_DEF_PROV_A;<br>&nbsp; {$ENDIF}<br>&nbsp; MAXUIDLEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 64;<br>&nbsp; CUR_BLOB_VERSION &nbsp; &nbsp; &nbsp; = 2;<br><br>type<br>&nbsp; PROV_ENUMALGS = record<br>&nbsp; &nbsp; aiAlgid &nbsp; :ALG_ID;<br>&nbsp; &nbsp; dwBitLen &nbsp;:LongInt;<br>&nbsp; &nbsp; dwNameLen :LongInt;<br>&nbsp; &nbsp; szName &nbsp; &nbsp;:array[0..20 - 1] of Char;<br>&nbsp; end;<br>&nbsp; PPROV_ENUMALGS = ^PROV_ENUMALGS;<br><br>type<br>&nbsp; PUBLICKEYSTRUC = record<br>&nbsp; &nbsp; bType &nbsp; &nbsp;:BYTE;<br>&nbsp; &nbsp; bVersion :BYTE;<br>&nbsp; &nbsp; reserved :Word;<br>&nbsp; &nbsp; aiKeyAlg :ALG_ID;<br>&nbsp; end;<br>&nbsp; PPUBLICKEYSTRUC = ^PUBLICKEYSTRUC;<br>&nbsp; BLOBHEADER = PUBLICKEYSTRUC;<br>&nbsp; PBLOBHEADER = ^BLOBHEADER;<br>&nbsp; <br>type<br>&nbsp; RSAPUBKEY = record<br>&nbsp; &nbsp; magic &nbsp;:DWORD; // Has to be RSA1<br>&nbsp; &nbsp; bitlen :DWORD; // # of bits in modulus<br>&nbsp; &nbsp; pubexp :DWORD; // public exponent<br>&nbsp; &nbsp; {Modulus data follows }<br>&nbsp; end;<br>&nbsp; PRSAPUBKEY = ^RSAPUBKEY;<br><br>type<br>&nbsp; HCRYPTPROV &nbsp; &nbsp; = DWORD; //cardinal;<br>&nbsp; PHCRYPTPROV &nbsp; &nbsp;= ^HCRYPTPROV;<br>&nbsp; HCRYPTKEY &nbsp; &nbsp; &nbsp;= DWORD; //cardinal;<br>&nbsp; PHCRYPTKEY &nbsp; &nbsp; = ^HCRYPTKEY;<br>&nbsp; HCRYPTHASH &nbsp; &nbsp; = DWORD; //cardinal;<br>&nbsp; PHCRYPTHASH &nbsp; &nbsp;= ^HCRYPTHASH;<br><br>function CryptAcquireContextA(phProv &nbsp; &nbsp; &nbsp; :PHCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pszContainer :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pszProvider &nbsp;:PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwProvType &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptAcquireContext(phProv &nbsp; &nbsp; &nbsp; :PHCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pszContainer :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pszProvider &nbsp;:PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwProvType &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptAcquireContextW(phProv &nbsp; &nbsp; &nbsp; :PHCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pszContainer :PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pszProvider &nbsp;:PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwProvType &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptReleaseContext(hProv &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt) :BOOL;stdcall;<br><br>function CryptGenKey(hProv &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Algid &nbsp; :ALG_ID;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phKey &nbsp; :PHCRYPTKEY) :BOOL;stdcall;<br><br>function CryptDeriveKey(hProv &nbsp; &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Algid &nbsp; &nbsp; :ALG_ID;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hBaseData :HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; phKey &nbsp; &nbsp; :PHCRYPTKEY) :BOOL;stdcall;<br><br>function CryptDestroyKey(hKey :HCRYPTKEY) :BOOL;stdcall;<br><br>function CryptSetKeyParam(hKey &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwParam :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags :LongInt) :BOOL;stdcall;<br><br>function CryptGetKeyParam(hKey &nbsp; &nbsp; &nbsp; :HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwParam &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwDataLen :PLongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptSetHashParam(hHash &nbsp; :HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwParam :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbData &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt) :BOOL;stdcall;<br><br>function CryptGetHashParam(hHash &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwParam &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pdwDataLen :PLongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptSetProvParam(hProv &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwParam :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbData &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt) :BOOL;stdcall;<br><br>function CryptGetProvParam(hProv &nbsp; &nbsp; &nbsp;:HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwParam &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pdwDataLen :PLongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptGenRandom(hProv &nbsp; &nbsp;:HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwLen &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbBuffer :PBYTE) :BOOL;stdcall;<br><br>function CryptGetUserKey(hProv &nbsp; &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwKeySpec :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phUserKey :PHCRYPTKEY) :BOOL;stdcall;<br><br>function CryptExportKey(hKey &nbsp; &nbsp; &nbsp; :HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hExpKey &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwBlobType :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwDataLen :PLongInt) :BOOL;stdcall;<br><br>function CryptImportKey(hProv &nbsp; &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp; &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwDataLen :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hPubKey &nbsp; :HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; phKey &nbsp; &nbsp; :PHCRYPTKEY) :BOOL;stdcall;<br><br>function CryptEncrypt(hKey &nbsp; &nbsp; &nbsp; :HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hHash &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Final &nbsp; &nbsp; &nbsp;:Bool;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwDataLen :PLongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwBufLen &nbsp; :LongInt) :BOOL;stdcall;<br><br>function CryptDecrypt(hKey &nbsp; &nbsp; &nbsp; :HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hHash &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Final &nbsp; &nbsp; &nbsp;:Bool;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData &nbsp; &nbsp; :PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwDataLen :PLongInt) :BOOL;stdcall;<br><br>function CryptCreateHash(hProv &nbsp; :HCRYPTPROV;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Algid &nbsp; :ALG_ID;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hKey &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phHash &nbsp;:PHCRYPTHASH) :BOOL;stdcall;<br><br>function CryptHashData(hHash &nbsp; &nbsp; :HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbData &nbsp; &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwDataLen :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; :LongInt) :BOOL;stdcall;<br><br>function CryptHashSessionKey(hHash &nbsp; :HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hKey &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags :LongInt) :BOOL;stdcall;<br><br>function CryptDestroyHash(hHash :HCRYPTHASH) :BOOL;stdcall;<br><br>function CryptSignHashA(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwKeySpec &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sDescription :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwSigLen &nbsp; &nbsp;:PLongInt) :BOOL;stdcall;<br><br>function CryptSignHash(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwKeySpec &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sDescription :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pdwSigLen &nbsp; &nbsp;:PLongInt) :BOOL;stdcall;<br><br>function CryptSignHashW(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwKeySpec &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sDescription :PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp; &nbsp;:LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdwSigLen &nbsp; &nbsp;:PLongInt) :BOOL;stdcall;<br><br>function CryptVerifySignatureA(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwSigLen &nbsp; &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hPubKey &nbsp; &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sDescription :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptVerifySignature(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwSigLen &nbsp; &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hPubKey &nbsp; &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sDescription :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptVerifySignatureW(hHash &nbsp; &nbsp; &nbsp; &nbsp;:HCRYPTHASH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pbSignature &nbsp;:PBYTE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwSigLen &nbsp; &nbsp; :LongInt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hPubKey &nbsp; &nbsp; &nbsp;:HCRYPTKEY;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sDescription :PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags &nbsp; &nbsp; &nbsp;:LongInt) :BOOL;stdcall;<br><br><br>function CryptSetProviderA(pszProvName :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwProvType &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptSetProvider(pszProvName :PAnsiChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwProvType &nbsp;:LongInt) :BOOL;stdcall;<br><br>function CryptSetProviderW(pszProvName :PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwProvType &nbsp;:LongInt) :BOOL;stdcall;<br><br>implementation<br><br>{Macro inplementation}<br><br>function GET_ALG_CLASS(x :integer) :integer;<br>begin<br>&nbsp; Result := (x and (7 shl 13));<br>end;<br><br>function GET_ALG_TYPE(x :integer) :integer;<br>begin<br>&nbsp; Result := (x and (15 shl 9));<br>end;<br><br>function GET_ALG_SID(x :integer) :integer;<br>begin<br>&nbsp; Result := (x and (511));<br>end;<br><br>function RCRYPT_SUCCEEDED(rt :BOOL) :BOOL;<br>begin<br>&nbsp; Result := rt = CRYPT_SUCCEED;<br>end;<br><br>function RCRYPT_FAILED(rt :BOOL) :BOOL;<br>begin<br>&nbsp; Result := rt = CRYPT_FAILED;<br>end;<br>{end Macro}<br><br>function CryptAcquireContextA;external CryptDll name 'CryptAcquireContextA';<br>{$IFDEF UNICODE}<br>function CryptAcquireContext;external CryptDll name 'CryptAcquireContextW';<br>{$ELSE}<br>function CryptAcquireContext;external CryptDll name 'CryptAcquireContextA';<br>{$ENDIF}<br>function CryptAcquireContextW;external CryptDll name 'CryptAcquireContextW';<br>function CryptReleaseContext;external CryptDll name 'CryptReleaseContext';<br>function CryptGenKey;external CryptDll name 'CryptGenKey';<br>function CryptDeriveKey;external CryptDll name 'CryptDeriveKey';<br>function CryptDestroyKey;external CryptDll name 'CryptDestroyKey';<br>function CryptSetKeyParam;external CryptDll name 'CryptSetKeyParam';<br>function CryptGetKeyParam;external CryptDll name 'CryptGetKeyParam';<br>function CryptSetHashParam;external CryptDll name 'CryptSetHashParam';<br>function CryptGetHashParam;external CryptDll name 'CryptGetHashParam';<br>function CryptSetProvParam;external CryptDll name 'CryptSetProvParam';<br>function CryptGetProvParam;external CryptDll name 'CryptGetProvParam';<br>function CryptGenRandom;external CryptDll name 'CryptGenRandom';<br>function CryptGetUserKey;external CryptDll name 'CryptGetUserKey';<br>function CryptExportKey;external CryptDll name 'CryptExportKey';<br>function CryptImportKey;external CryptDll name 'CryptImportKey';<br>function CryptEncrypt;external CryptDll name 'CryptEncrypt';<br>function CryptDecrypt;external CryptDll name 'CryptDecrypt';<br>function CryptCreateHash;external CryptDll name 'CryptCreateHash';<br>function CryptHashData;external CryptDll name 'CryptHashData';<br>function CryptHashSessionKey;external CryptDll name 'CryptHashSessionKey';<br>function CryptDestroyHash;external CryptDll name 'CryptDestroyHash';<br>function CryptSignHashA;external CryptDll name 'CryptSignHashA';<br>{$IFDEF UNICODE}<br>function CryptSignHash;external CryptDll name 'CryptSignHashW';<br>{$ELSE}<br>function CryptSignHash;external CryptDll name 'CryptSignHashA';<br>{$ENDIF}<br>function CryptSignHashW;external CryptDll name 'CryptSignHashW';<br>function CryptVerifySignatureA;external CryptDll name 'CryptVerifySignatureA';<br>{$IFDEF UNICODE}<br>function CryptVerifySignature;external CryptDll name 'CryptVerifySignatureW';<br>{$ELSE}<br>function CryptVerifySignature;external CryptDll name 'CryptVerifySignatureA';<br>{$ENDIF}<br>function CryptVerifySignatureW;external CryptDll name 'CryptVerifySignatureW';<br>function CryptSetProviderA;external CryptDll name 'CryptSetProviderA';<br>{$IFDEF UNICODE}<br>function CryptSetProvider;external CryptDll name 'CryptSetProviderW';<br>{$ELSE}<br>function CryptSetProvider;external CryptDll name 'CryptSetProviderA';<br>{$ENDIF}<br>function CryptSetProviderW;external CryptDll name 'CryptSetProviderW';<br><br>end.<br><br>
 
刚刚看到,多谢cAkk大侠,看来这200分归您了。<br>我先试一下再给分,你不反对吧?
 
接受答案了.
 
后退
顶部