请教CryptoApi用Delphi的实现(200分)

  • 主题发起人 主题发起人 pwxwabcd
  • 开始时间 开始时间
P

pwxwabcd

Unregistered / Unconfirmed
GUEST, unregistred user!
请教CryptoApi用Delphi的实现<br>1.公钥,私钥生成<br>2.加密<br>3.验证<br>4.证书
 
{---------------------------------------------------------<br>Copyright (c) 1996-97 Massimo Maria Ghisalberti<br>CopyRight (c) 1996-97 MAx!<br>CopyRight (c) 1996-97 Objects Built for you! (O.B.you!)<br>Internet EMail: roentgen@mbox.vol.it<br><br>translate from: wincrypt.h<br>date: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mm/gg/yy<br>version: &nbsp; &nbsp; &nbsp; &nbsp;2beta.<br><br>note: use at own risk.<br>&nbsp; &nbsp; &nbsp; If you use this code, please mention O.B.you!<br>&nbsp; &nbsp; &nbsp; somewhere in your program<br><br><br>----------------------------------------------------------<br>IMPORTANT : USE ONLY IF YOU HAVE WINDOWS NT 4.X OR WINDOWS<br>95 OSR2 OR/AND INTERNET EXPLORER 3.X.<br>----------------------------------------------------------}<br><br>unit wincrypt;<br><br>interface<br><br>uses<br>&nbsp; Windows;<br>&nbsp; <br>const CryptDll = 'advapi32';<br>&nbsp; &nbsp; &nbsp;<br>{--------------------------------------------------------------------------- <br><br>Microsoft Windows<br>Copyright (C) Microsoft Corporation, 1992 - 1996. <br><br>File: wincrypt.h<br>Contents: Cryptographic API Prototypes and Definitions<br>----------------------------------------------------------------------------}<br><br><br>{Algorithm IDs and Flags }<br><br>{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;= 0;<br>&nbsp; ALG_CLASS_SIGNATURE &nbsp; &nbsp;= (1 shl 13);<br>&nbsp; ALG_CLASS_MSG_ENCRYPT &nbsp;= (2 shl 13);<br>&nbsp; ALG_CLASS_DATA_ENCRYPT = (3 shl 13);<br>&nbsp; ALG_CLASS_HASH &nbsp; &nbsp; &nbsp; &nbsp; = (4 shl 13);<br>&nbsp; ALG_CLASS_KEY_EXCHANGE = (5 shl 13);<br>{Algorithm types }<br>&nbsp; ALG_TYPE_ANY &nbsp; &nbsp;= 0;<br>&nbsp; ALG_TYPE_DSS &nbsp; &nbsp;= (1 shl 9);<br>&nbsp; ALG_TYPE_RSA &nbsp; &nbsp;= (2 shl 9);<br>&nbsp; ALG_TYPE_BLOCK &nbsp;= (3 shl 9);<br>&nbsp; ALG_TYPE_STREAM = (4 shl 9);<br>{Generic sub-ids }<br>&nbsp; ALG_SID_ANY = 0;<br>{Some RSA sub-ids }<br>&nbsp; ALG_SID_RSA_ANY &nbsp; &nbsp; &nbsp;= 0;<br>&nbsp; ALG_SID_RSA_PKCS &nbsp; &nbsp; = 1;<br>&nbsp; ALG_SID_RSA_MSATWORK = 2;<br>&nbsp; ALG_SID_RSA_ENTRUST &nbsp;= 3;<br>&nbsp; ALG_SID_RSA_PGP &nbsp; &nbsp; &nbsp;= 4;<br>{Some DSS sub-ids}<br>&nbsp; ALG_SID_DSS_ANY &nbsp; &nbsp;= 0;<br>&nbsp; ALG_SID_DSS_PKCS &nbsp; = 1;<br>&nbsp; ALG_SID_DSS_DMS &nbsp; &nbsp;= 2;<br>{Block cipher sub ids DES sub_ids }<br>&nbsp; ALG_SID_DES &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; ALG_SID_3DES &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; ALG_SID_DESX &nbsp; &nbsp; &nbsp; = 4;<br>&nbsp; ALG_SID_IDEA &nbsp; &nbsp; &nbsp; = 5;<br>&nbsp; ALG_SID_CAST &nbsp; &nbsp; &nbsp; = 6;<br>&nbsp; ALG_SID_SAFERSK64 &nbsp;= 7;<br>&nbsp; ALD_SID_SAFERSK128 = 8;<br>{KP_MODE }<br>&nbsp; CRYPT_MODE_CBCI &nbsp; &nbsp;= 6; &nbsp;{ANSI CBC Interleaved}<br>&nbsp; CRYPT_MODE_CFBP &nbsp; &nbsp;= 7; &nbsp;{ANSI CFB Pipelined}<br>&nbsp; CRYPT_MODE_OFBP &nbsp; &nbsp;= 8; &nbsp;{ANSI OFB Pipelined}<br>&nbsp; CRYPT_MODE_CBCOFM &nbsp;= 9; &nbsp;{ANSI CBC + OF Masking}<br>&nbsp; CRYPT_MODE_CBCOFMI = 10; {ANSI CBC + OFM Interleaved}<br>{RC2 sub-ids }<br>&nbsp; ALG_SID_RC2 &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br>{Stream cipher sub-ids }<br>&nbsp; ALG_SID_RC4 &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; ALG_SID_SEAL &nbsp; &nbsp; &nbsp; = 2;<br>{Hash sub ids }<br>&nbsp; ALG_SID_MD2 &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; ALG_SID_MD4 &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; ALG_SID_MD5 &nbsp; &nbsp; &nbsp; &nbsp;= 3;<br>&nbsp; ALG_SID_SHA &nbsp; &nbsp; &nbsp; &nbsp;= 4;<br>&nbsp; ALG_SID_MAC &nbsp; &nbsp; &nbsp; &nbsp;= 5;<br>&nbsp; ALG_SID_RIPEMD &nbsp; &nbsp; = 6;<br>&nbsp; ALG_SID_RIPEMD160 &nbsp;= 7;<br>&nbsp; ALG_SID_SSL3SHAMD5 = 8;<br>{Our silly example sub-id }<br>&nbsp; ALG_SID_EXAMPLE &nbsp; &nbsp;= 80;<br><br>{$IFNDEF ALGIDDEF}<br>&nbsp; {$DEFINE ALGIDDEF}<br>Type ALG_ID = Cardinal;<br>{$ENDIF}<br><br>{algorithm identifier definitions }<br>Const <br>&nbsp; CALG_MD2 = (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD2);<br>&nbsp; CALG_MD4 = (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD4);<br>&nbsp; CALG_MD5 = (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_MD5);<br>&nbsp; CALG_SHA = (ALG_CLASS_HASH or ALG_TYPE_ANY or ALG_SID_SHA);<br>&nbsp; CALG_MAC = (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 = (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_BLOCK or ALG_SID_DES);<br>&nbsp; CALG_RC2 = (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_BLOCK or ALG_SID_RC2);<br>&nbsp; CALG_RC4 = (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_STREAM or ALG_SID_RC4);<br>&nbsp; CALG_SEAL = (ALG_CLASS_DATA_ENCRYPT or ALG_TYPE_STREAM or ALG_SID_SEAL);<br>&nbsp; <br>type VTableProvStruc = record<br>&nbsp; Version: LongInt;<br>&nbsp; FuncVerifyImage: TFarProc;<br>&nbsp; FuncReturnhWnd: TFarProc;<br>end;<br>&nbsp; PVTableProvStruc = ^VTableProvStruc;<br><br>&nbsp; <br>const<br>{dwFlags definitions for CryptAquireContext }<br>&nbsp; CRYPT_VERIFYCONTEXT &nbsp;= $F0000000;<br>&nbsp; CRYPT_NEWKEYSET &nbsp; &nbsp; &nbsp;= $8;<br>&nbsp; CRYPT_DELETEKEYSET &nbsp; = $10;<br>{dwFlag definitions for CryptGenKey }<br>&nbsp; CRYPT_EXPORTABLE &nbsp; &nbsp; = $00000001;<br>&nbsp; CRYPT_USER_PROTECTED = $00000002;<br>&nbsp; CRYPT_CREATE_SALT &nbsp; &nbsp;= $00000004;<br>&nbsp; CRYPT_UPDATE_KEY &nbsp; &nbsp; = $00000008;<br>{exported key blob definitions }<br>&nbsp; SIMPLEBLOB &nbsp; &nbsp; &nbsp; &nbsp;= $1;<br>&nbsp; PUBLICKEYBLOB &nbsp; &nbsp; = $6;<br>&nbsp; PRIVATEKEYBLOB &nbsp; &nbsp;= $7;<br>&nbsp; AT_KEYEXCHANGE &nbsp; &nbsp;= 1;<br>&nbsp; AT_SIGNATURE &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; CRYPT_USERDATA &nbsp; &nbsp;= 1;<br>&nbsp;{dwParam }<br>&nbsp; KP_IV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1; {Initialization vector}<br>&nbsp; KP_SALT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2; {Salt value}<br>&nbsp; KP_PADDING &nbsp; &nbsp; &nbsp; &nbsp;= 3; {Padding values}<br>&nbsp; KP_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 4; {Mode of the cipher}<br>&nbsp; KP_MODE_BITS &nbsp; &nbsp; &nbsp;= 5; {Number of bits to feedback}<br>&nbsp; KP_PERMISSIONS &nbsp; &nbsp;= 6; {Key permissions DWORD}<br>&nbsp; KP_ALGID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7; {Key algorithm}<br>&nbsp; KP_BLOCKLEN &nbsp; &nbsp; &nbsp; = 8; {Block size of the cipher}<br>{KP_PADDING }<br>&nbsp; PKCS5_PADDING &nbsp; &nbsp; = 1; {PKCS 5 (sec 6.2) padding method}<br>{KP_MODE }<br>&nbsp; CRYPT_MODE_CBC &nbsp; &nbsp;= 1; {Cipher block chaining}<br>&nbsp; CRYPT_MODE_ECB &nbsp; &nbsp;= 2; {Electronic code book}<br>&nbsp; CRYPT_MODE_OFB &nbsp; &nbsp;= 3; {Output feedback mode}<br>&nbsp; CRYPT_MODE_CFB &nbsp; &nbsp;= 4; {Cipher feedback mode}<br>&nbsp; CRYPT_MODE_CTS &nbsp; &nbsp;= 5; {Ciphertext stealing mode}<br>{KP_PERMISSIONS }<br>&nbsp; CRYPT_ENCRYPT &nbsp; &nbsp; = $0001; {Allow encryption}<br>&nbsp; CRYPT_DECRYPT &nbsp; &nbsp; = $0002; {Allow decryption}<br>&nbsp; CRYPT_EXPORT &nbsp; &nbsp; &nbsp;= $0004; {Allow key to be exported}<br>&nbsp; CRYPT_READ &nbsp; &nbsp; &nbsp; &nbsp;= $0008; {Allow parameters to be read}<br>&nbsp; CRYPT_WRITE &nbsp; &nbsp; &nbsp; = $0010; {Allow parameters to be set}<br>&nbsp; CRYPT_MAC &nbsp; &nbsp; &nbsp; &nbsp; = $0020; {Allow MACs to be used with key}<br>&nbsp; HP_ALGID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0001; {Hash algorithm}<br>&nbsp; HP_HASHVAL &nbsp; &nbsp; &nbsp; &nbsp;= $0002; {Hash value}<br>&nbsp; HP_HASHSIZE &nbsp; &nbsp; &nbsp; = $0004; {Hash value size}<br>&nbsp; CRYPT_FAILED &nbsp; &nbsp; &nbsp;= FALSE;<br>&nbsp; CRYPT_SUCCEED &nbsp; &nbsp; = TRUE;<br><br>function RCRYPT_SUCCEEDED(rt:BOOL):BOOL;<br>function RCRYPT_FAILED(rt:BOOL):BOOL;<br><br>const<br>{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>{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>{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>{$IFDEF UNICODE}<br>&nbsp; MS_DEF_PROV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= MS_DEF_PROV_W;<br>{$ELSE}<br>&nbsp; MS_DEF_PROV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= MS_DEF_PROV_A;<br>{$ENDIF}<br>&nbsp; MAXUIDLEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 64;<br>&nbsp; CUR_BLOB_VERSION &nbsp; &nbsp; &nbsp; = 2;<br><br><br>type PROV_ENUMALGS = record<br>&nbsp; aiAlgid &nbsp; :ALG_ID;<br>&nbsp; dwBitLen &nbsp;:LongInt;<br>&nbsp; dwNameLen :LongInt;<br>&nbsp; szName &nbsp; &nbsp;:array[0..20-1] of Char;<br>end ;<br>&nbsp; PPROV_ENUMALGS = ^PROV_ENUMALGS;<br><br><br>type PUBLICKEYSTRUC = record<br>&nbsp; bType &nbsp; &nbsp;:BYTE;<br>&nbsp; bVersion :BYTE;<br>&nbsp; reserved :Word;<br>&nbsp; aiKeyAlg :ALG_ID;<br>end;<br>&nbsp; PPUBLICKEYSTRUC = ^PUBLICKEYSTRUC;<br><br>type RSAPUBKEY = record<br>&nbsp; magic &nbsp;:LongInt;<br>{ DWORD bitlen; // # of bits in modulus }<br>&nbsp; pubexp :LongInt;<br>{Modulus data follows }<br>end;<br>&nbsp; PRSAPUBKEY = ^RSAPUBKEY;<br><br>type <br>&nbsp; HCRYPTPROV &nbsp;= cardinal;<br>&nbsp; PHCRYPTPROV = ^HCRYPTPROV;<br>&nbsp; HCRYPTKEY &nbsp; = cardinal;<br>&nbsp; PHCRYPTKEY &nbsp;= ^HCRYPTKEY;<br>&nbsp; HCRYPTHASH &nbsp;= cardinal;<br>&nbsp; PHCRYPTHASH = ^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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>function CryptAcquireContext(phProv &nbsp; &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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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><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><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><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><br><br>function CryptDestroyKey(hKey &nbsp;:HCRYPTKEY) :BOOL;stdcall ; <br><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><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><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><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><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><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><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><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><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><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><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><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><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><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><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><br>function CryptDestroyHash(hHash :HCRYPTHASH) :BOOL;stdcall; <br><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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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; &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><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; &nbsp;dwProvType :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><br>implementation<br><br><br>end.<br>
 
请提供详细的例子
 
http://homepages.borland.com/efg2lab/Library/Delphi/MathFunctions/BerndLehmannCrypto.zip
 
楼上的朋友提供的例子不能正常执行,不过还是谢谢。
 
你自己到这里找找吧:<br>http://homepages.borland.com/efg2lab/Library/Delphi/MathFunctions/Cryptography.htm
 
楼上的朋友提供的连接地址只有头文件,没有delphi实际的例子.
 
怎么没有啊,这个是全的:<br>ftp://delphi-jedi.org/api/CryptoAPI1.zip
 
Enjoy This Samples hehe!<br>http://delphi.ur-solution.com/delphi_download/upload/29919_CryptSample.zip
 
证书如何生成,如何在不通过文件导入导出获得私钥。
 
后退
顶部