JITComVCTKLib_TLB.pas 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. unit JITComVCTKLib_TLB;
  2. // ************************************************************************ //
  3. // WARNING
  4. // -------
  5. // The types declared in this file were generated from data read from a
  6. // Type Library. If this type library is explicitly or indirectly (via
  7. // another type library referring to this type library) re-imported, or the
  8. // 'Refresh' command of the Type Library Editor activated while editing the
  9. // Type Library, the contents of this file will be regenerated and all
  10. // manual modifications will be lost.
  11. // ************************************************************************ //
  12. // PASTLWTR : 1.2
  13. // File generated on 2009-12-2 14:58:20 from Type Library described below.
  14. // ************************************************************************ //
  15. // Type Lib: E:\WorkRoot\JIT_IPC\产品研发\数字签名产品\签名服务器\02源码\client\VCTK\release\JITComVCTK.dll (1)
  16. // LIBID: {1281332C-EF71-4866-A895-3FC82FB06871}
  17. // LCID: 0
  18. // Helpfile:
  19. // HelpString: JITComVCTK 1.0 Type Library
  20. // DepndLst:
  21. // (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
  22. // Errors:
  23. // Error creating palette bitmap of (TJITVCTK) : Server E:\WorkRoot\JIT_IPC\产品研发\数字签名产品\签名服务器\02源码\client\VCTK\release\JITComVCTK.dll contains no icons
  24. // Error creating palette bitmap of (TJITDSign) : Server E:\WorkRoot\JIT_IPC\产品研发\数字签名产品\签名服务器\02源码\client\VCTK\release\JITComVCTK.dll contains no icons
  25. // ************************************************************************ //
  26. // *************************************************************************//
  27. // NOTE:
  28. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
  29. // which return objects that may need to be explicitly created via a function
  30. // call prior to any access via the property. These items have been disabled
  31. // in order to prevent accidental use from within the object inspector. You
  32. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
  33. // removing them from the $IFDEF blocks. However, such items must still be
  34. // programmatically created via a method of the appropriate CoClass before
  35. // they can be used.
  36. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  37. {$WARN SYMBOL_PLATFORM OFF}
  38. {$WRITEABLECONST ON}
  39. {$VARPROPSETTER ON}
  40. interface
  41. uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
  42. // *********************************************************************//
  43. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  44. // Type Libraries : LIBID_xxxx
  45. // CoClasses : CLASS_xxxx
  46. // DISPInterfaces : DIID_xxxx
  47. // Non-DISP interfaces: IID_xxxx
  48. // *********************************************************************//
  49. const
  50. // TypeLibrary Major and minor versions
  51. JITComVCTKLibMajorVersion = 1;
  52. JITComVCTKLibMinorVersion = 0;
  53. LIBID_JITComVCTKLib: TGUID = '{1281332C-EF71-4866-A895-3FC82FB06871}';
  54. IID_IJITVCTK: TGUID = '{9CDA9B8E-04AA-4070-9375-B1F327C8AA34}';
  55. CLASS_JITVCTK: TGUID = '{707C7D52-85A8-4584-8954-573EFCE77488}';
  56. IID_IJITDSign: TGUID = '{BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}';
  57. CLASS_JITDSign: TGUID = '{06CA9432-D9BD-4867-8475-770B131E1759}';
  58. type
  59. // *********************************************************************//
  60. // Forward declaration of types defined in TypeLibrary
  61. // *********************************************************************//
  62. IJITVCTK = interface;
  63. IJITVCTKDisp = dispinterface;
  64. IJITDSign = interface;
  65. IJITDSignDisp = dispinterface;
  66. // *********************************************************************//
  67. // Declaration of CoClasses defined in Type Library
  68. // (NOTE: Here we map each CoClass to its Default Interface)
  69. // *********************************************************************//
  70. JITVCTK = IJITVCTK;
  71. JITDSign = IJITDSign;
  72. // *********************************************************************//
  73. // Declaration of structures, unions and aliases.
  74. // *********************************************************************//
  75. PByte1 = ^Byte; {*}
  76. // *********************************************************************//
  77. // Interface: IJITVCTK
  78. // Flags: (4544) Dual NonExtensible OleAutomation Dispatchable
  79. // GUID: {9CDA9B8E-04AA-4070-9375-B1F327C8AA34}
  80. // *********************************************************************//
  81. IJITVCTK = interface(IDispatch)
  82. ['{9CDA9B8E-04AA-4070-9375-B1F327C8AA34}']
  83. function SetCert(const bstrCertType: WideString; const bstrDN: WideString;
  84. const bstrSN: WideString; const bstrEmail: WideString;
  85. const bstrDNIssuer: WideString; const bstrCertBase64: WideString): Integer; safecall;
  86. function SetCertChooseType(nType: Integer): Integer; safecall;
  87. function GetCertInfo(const bstrCertType: WideString; lInfoType: Integer;
  88. const bstrOID: WideString): WideString; safecall;
  89. function SetAlgorithm(const bstrSignAlg: WideString; const bstrEncAlg: WideString): Integer; safecall;
  90. function AttachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; safecall;
  91. function AttachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  92. const bstrFileNameOut: WideString): WideString; safecall;
  93. function VerifyAttachedSign(const bstrSignedData: WideString): Integer; safecall;
  94. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer; safecall;
  95. function DetachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; safecall;
  96. function DetachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  97. const bstrFileNameOut: WideString): WideString; safecall;
  98. function VerifyDetachedSign(const bstrSignedData: WideString; var pszSrcData: Byte;
  99. lSrcDataLen: Integer): Integer; safecall;
  100. function VerifyDetachedSignEx(const bstrSignedData: WideString;
  101. const bstrFileNameDetached: WideString;
  102. const bstrFileName: WideString): Integer; safecall;
  103. function EncryptEnvelop(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; safecall;
  104. function EncryptEnvelopEx(const bstrDN: WideString; const bstrFileName: WideString;
  105. const bstrFileNameOut: WideString): WideString; safecall;
  106. function DecryptEnvelop(const bstrEnvelop: WideString): Integer; safecall;
  107. function DecryptEnvelopEx(const bstrFileNameDetached: WideString): Integer; safecall;
  108. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  109. var pszSrcData: Byte; lSrcDataLen: Integer): WideString; safecall;
  110. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  111. const bstrEncCertDN: WideString; const bstrFileName: WideString;
  112. const bstrFileNameOut: WideString): WideString; safecall;
  113. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer; safecall;
  114. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer; safecall;
  115. function GetDataEx(out pszSrcData: Byte; var plSrcDataLen: Integer): Integer; safecall;
  116. function GetFile(const bstrFileSavePath: WideString): WideString; safecall;
  117. function GetErrorCode: Integer; safecall;
  118. function GetErrorMessage(lErrorCode: Integer): WideString; safecall;
  119. function SetCSP(const bstrProvider: WideString): Integer; safecall;
  120. function SetPIN(const bstrPIN: WideString): Integer; safecall;
  121. function JITGetVersion: WideString; safecall;
  122. function GetBase64Encode(var pszSrcData: Byte; lSrcDataLen: Integer): WideString; safecall;
  123. function GetBase64Decode(const bstrBase64Data: WideString; out pszSrcData: Byte;
  124. var pSrcDataLen: Integer): Integer; safecall;
  125. function GetData: WideString; safecall;
  126. function AttachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; safecall;
  127. function DetachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; safecall;
  128. function VerifyDetachedSignStr(const bstrSignedData: WideString; const bstrSrc: WideString): Integer; safecall;
  129. function EncryptEnvelopStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; safecall;
  130. function CreateSignedEnvelopStr(const bstrSignCertDN: WideString;
  131. const bstrEncCertDN: WideString; const bstrSrc: WideString): WideString; safecall;
  132. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  133. const lpszSN: WideString; const lpszEmail: WideString;
  134. const lpszIssuer: WideString; lInfoType: Integer): WideString; safecall;
  135. function SetCertEx(const bstrCertStoreType: WideString; const bstrCertType: WideString;
  136. const bstrDN: WideString; const bstrSN: WideString;
  137. const bstrEmail: WideString; const bstrDNIssuer: WideString;
  138. const bstrCertBase64: WideString): Integer; safecall;
  139. end;
  140. // *********************************************************************//
  141. // DispIntf: IJITVCTKDisp
  142. // Flags: (4544) Dual NonExtensible OleAutomation Dispatchable
  143. // GUID: {9CDA9B8E-04AA-4070-9375-B1F327C8AA34}
  144. // *********************************************************************//
  145. IJITVCTKDisp = dispinterface
  146. ['{9CDA9B8E-04AA-4070-9375-B1F327C8AA34}']
  147. function SetCert(const bstrCertType: WideString; const bstrDN: WideString;
  148. const bstrSN: WideString; const bstrEmail: WideString;
  149. const bstrDNIssuer: WideString; const bstrCertBase64: WideString): Integer; dispid 1;
  150. function SetCertChooseType(nType: Integer): Integer; dispid 2;
  151. function GetCertInfo(const bstrCertType: WideString; lInfoType: Integer;
  152. const bstrOID: WideString): WideString; dispid 3;
  153. function SetAlgorithm(const bstrSignAlg: WideString; const bstrEncAlg: WideString): Integer; dispid 4;
  154. function AttachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; dispid 5;
  155. function AttachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  156. const bstrFileNameOut: WideString): WideString; dispid 6;
  157. function VerifyAttachedSign(const bstrSignedData: WideString): Integer; dispid 7;
  158. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer; dispid 8;
  159. function DetachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; dispid 9;
  160. function DetachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  161. const bstrFileNameOut: WideString): WideString; dispid 10;
  162. function VerifyDetachedSign(const bstrSignedData: WideString; var pszSrcData: Byte;
  163. lSrcDataLen: Integer): Integer; dispid 11;
  164. function VerifyDetachedSignEx(const bstrSignedData: WideString;
  165. const bstrFileNameDetached: WideString;
  166. const bstrFileName: WideString): Integer; dispid 12;
  167. function EncryptEnvelop(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString; dispid 13;
  168. function EncryptEnvelopEx(const bstrDN: WideString; const bstrFileName: WideString;
  169. const bstrFileNameOut: WideString): WideString; dispid 14;
  170. function DecryptEnvelop(const bstrEnvelop: WideString): Integer; dispid 15;
  171. function DecryptEnvelopEx(const bstrFileNameDetached: WideString): Integer; dispid 16;
  172. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  173. var pszSrcData: Byte; lSrcDataLen: Integer): WideString; dispid 17;
  174. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  175. const bstrEncCertDN: WideString; const bstrFileName: WideString;
  176. const bstrFileNameOut: WideString): WideString; dispid 18;
  177. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer; dispid 19;
  178. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer; dispid 20;
  179. function GetDataEx(out pszSrcData: Byte; var plSrcDataLen: Integer): Integer; dispid 21;
  180. function GetFile(const bstrFileSavePath: WideString): WideString; dispid 22;
  181. function GetErrorCode: Integer; dispid 23;
  182. function GetErrorMessage(lErrorCode: Integer): WideString; dispid 24;
  183. function SetCSP(const bstrProvider: WideString): Integer; dispid 25;
  184. function SetPIN(const bstrPIN: WideString): Integer; dispid 26;
  185. function JITGetVersion: WideString; dispid 27;
  186. function GetBase64Encode(var pszSrcData: Byte; lSrcDataLen: Integer): WideString; dispid 28;
  187. function GetBase64Decode(const bstrBase64Data: WideString; out pszSrcData: Byte;
  188. var pSrcDataLen: Integer): Integer; dispid 29;
  189. function GetData: WideString; dispid 30;
  190. function AttachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; dispid 31;
  191. function DetachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; dispid 32;
  192. function VerifyDetachedSignStr(const bstrSignedData: WideString; const bstrSrc: WideString): Integer; dispid 33;
  193. function EncryptEnvelopStr(const bstrDN: WideString; const bstrSrc: WideString): WideString; dispid 34;
  194. function CreateSignedEnvelopStr(const bstrSignCertDN: WideString;
  195. const bstrEncCertDN: WideString; const bstrSrc: WideString): WideString; dispid 35;
  196. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  197. const lpszSN: WideString; const lpszEmail: WideString;
  198. const lpszIssuer: WideString; lInfoType: Integer): WideString; dispid 36;
  199. function SetCertEx(const bstrCertStoreType: WideString; const bstrCertType: WideString;
  200. const bstrDN: WideString; const bstrSN: WideString;
  201. const bstrEmail: WideString; const bstrDNIssuer: WideString;
  202. const bstrCertBase64: WideString): Integer; dispid 37;
  203. end;
  204. // *********************************************************************//
  205. // Interface: IJITDSign
  206. // Flags: (4544) Dual NonExtensible OleAutomation Dispatchable
  207. // GUID: {BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}
  208. // *********************************************************************//
  209. IJITDSign = interface(IDispatch)
  210. ['{BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}']
  211. function GetVersion: WideString; safecall;
  212. function SetCert(const lpstrCertType: WideString; const lpstrDN: WideString;
  213. const lpstrSN: WideString; const lpstrEmail: WideString;
  214. const lpstrDNIssuer: WideString; const lpstrCertBase64: WideString): Integer; safecall;
  215. function SetCertChooseType(lType: Integer): Integer; safecall;
  216. function GetCertInfo(const pszCertType: WideString; lInfoType: Integer; const pszOID: WideString): WideString; safecall;
  217. function SetAlgorithm(const lpstrSignAlgo: WideString; const lpstrEncAlgo: WideString): Integer; safecall;
  218. function AttachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString; safecall;
  219. function AttachSignEx(const pszDN: WideString; const pszFileName: WideString;
  220. const pszFileNameOut: WideString): WideString; safecall;
  221. function VerifyAttachedSign(const bstrSignedData: WideString): Integer; safecall;
  222. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer; safecall;
  223. function DetachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString; safecall;
  224. function DetachSignEx(const pszDN: WideString; const pszFileName: WideString;
  225. const pszFileNameOut: WideString): WideString; safecall;
  226. function VerifyDetachedSign(const pszSignedData: WideString; const pszSrcData: WideString): Integer; safecall;
  227. function VerifyDetachedSignEx(const pszSignedData: WideString;
  228. const pszFileNameDetached: WideString;
  229. const pszFileName: WideString): Integer; safecall;
  230. function EncryptEnvelop(const pszDN: WideString; const pszSrcData: WideString): WideString; safecall;
  231. function EncryptEnvelopEx(const pszDN: WideString; const pszFileName: WideString;
  232. const pszFileNameOut: WideString): WideString; safecall;
  233. function DecryptEnvelop(const pszEvpContent: WideString): Integer; safecall;
  234. function DecryptEnvelopEx(const bstrEvpFile: WideString): Integer; safecall;
  235. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  236. const pVarSrcData: WideString): WideString; safecall;
  237. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  238. const bstrEncCertDN: WideString;
  239. const pbstrFileName: WideString;
  240. const bstrFileNameOut: WideString): WideString; safecall;
  241. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer; safecall;
  242. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer; safecall;
  243. function GetBase64Encode(const bstrSrcData: WideString): WideString; safecall;
  244. function GetBase64Decode(const bstrBase64Data: WideString): WideString; safecall;
  245. function GetErrorCode: Integer; safecall;
  246. function GetBase64HashEnCode(const bstrSrcData: WideString): WideString; safecall;
  247. function GetErrorMessage: WideString; safecall;
  248. function GetData: WideString; safecall;
  249. function GetFile(const bstrFileSavePath: WideString): WideString; safecall;
  250. function AddData(const bstrSrcData: WideString): Integer; safecall;
  251. function AddFile(const bstrSrcFile: WideString): Integer; safecall;
  252. function SetCSP(const pszProvider: WideString): Integer; safecall;
  253. function SetPIN(const pszPIN: WideString): Integer; safecall;
  254. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  255. const lpszSN: WideString; const lpszEmail: WideString;
  256. const lpszIssuer: WideString; lInfoType: Integer): WideString; safecall;
  257. function SetErrMsgLanguage(const lpzLangType: WideString): Integer; safecall;
  258. function ClearPIN: Integer; safecall;
  259. end;
  260. // *********************************************************************//
  261. // DispIntf: IJITDSignDisp
  262. // Flags: (4544) Dual NonExtensible OleAutomation Dispatchable
  263. // GUID: {BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}
  264. // *********************************************************************//
  265. IJITDSignDisp = dispinterface
  266. ['{BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}']
  267. function GetVersion: WideString; dispid 1;
  268. function SetCert(const lpstrCertType: WideString; const lpstrDN: WideString;
  269. const lpstrSN: WideString; const lpstrEmail: WideString;
  270. const lpstrDNIssuer: WideString; const lpstrCertBase64: WideString): Integer; dispid 2;
  271. function SetCertChooseType(lType: Integer): Integer; dispid 3;
  272. function GetCertInfo(const pszCertType: WideString; lInfoType: Integer; const pszOID: WideString): WideString; dispid 4;
  273. function SetAlgorithm(const lpstrSignAlgo: WideString; const lpstrEncAlgo: WideString): Integer; dispid 5;
  274. function AttachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString; dispid 6;
  275. function AttachSignEx(const pszDN: WideString; const pszFileName: WideString;
  276. const pszFileNameOut: WideString): WideString; dispid 7;
  277. function VerifyAttachedSign(const bstrSignedData: WideString): Integer; dispid 8;
  278. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer; dispid 9;
  279. function DetachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString; dispid 10;
  280. function DetachSignEx(const pszDN: WideString; const pszFileName: WideString;
  281. const pszFileNameOut: WideString): WideString; dispid 11;
  282. function VerifyDetachedSign(const pszSignedData: WideString; const pszSrcData: WideString): Integer; dispid 12;
  283. function VerifyDetachedSignEx(const pszSignedData: WideString;
  284. const pszFileNameDetached: WideString;
  285. const pszFileName: WideString): Integer; dispid 13;
  286. function EncryptEnvelop(const pszDN: WideString; const pszSrcData: WideString): WideString; dispid 14;
  287. function EncryptEnvelopEx(const pszDN: WideString; const pszFileName: WideString;
  288. const pszFileNameOut: WideString): WideString; dispid 15;
  289. function DecryptEnvelop(const pszEvpContent: WideString): Integer; dispid 16;
  290. function DecryptEnvelopEx(const bstrEvpFile: WideString): Integer; dispid 17;
  291. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  292. const pVarSrcData: WideString): WideString; dispid 18;
  293. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  294. const bstrEncCertDN: WideString;
  295. const pbstrFileName: WideString;
  296. const bstrFileNameOut: WideString): WideString; dispid 19;
  297. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer; dispid 20;
  298. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer; dispid 21;
  299. function GetBase64Encode(const bstrSrcData: WideString): WideString; dispid 22;
  300. function GetBase64Decode(const bstrBase64Data: WideString): WideString; dispid 23;
  301. function GetErrorCode: Integer; dispid 24;
  302. function GetBase64HashEnCode(const bstrSrcData: WideString): WideString; dispid 25;
  303. function GetErrorMessage: WideString; dispid 26;
  304. function GetData: WideString; dispid 27;
  305. function GetFile(const bstrFileSavePath: WideString): WideString; dispid 28;
  306. function AddData(const bstrSrcData: WideString): Integer; dispid 29;
  307. function AddFile(const bstrSrcFile: WideString): Integer; dispid 30;
  308. function SetCSP(const pszProvider: WideString): Integer; dispid 31;
  309. function SetPIN(const pszPIN: WideString): Integer; dispid 32;
  310. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  311. const lpszSN: WideString; const lpszEmail: WideString;
  312. const lpszIssuer: WideString; lInfoType: Integer): WideString; dispid 33;
  313. function SetErrMsgLanguage(const lpzLangType: WideString): Integer; dispid 34;
  314. function ClearPIN: Integer; dispid 35;
  315. end;
  316. // *********************************************************************//
  317. // The Class CoJITVCTK provides a Create and CreateRemote method to
  318. // create instances of the default interface IJITVCTK exposed by
  319. // the CoClass JITVCTK. The functions are intended to be used by
  320. // clients wishing to automate the CoClass objects exposed by the
  321. // server of this typelibrary.
  322. // *********************************************************************//
  323. CoJITVCTK = class
  324. class function Create: IJITVCTK;
  325. class function CreateRemote(const MachineName: string): IJITVCTK;
  326. end;
  327. // *********************************************************************//
  328. // OLE Server Proxy class declaration
  329. // Server Object : TJITVCTK
  330. // Help String : JITVCTK Class
  331. // Default Interface: IJITVCTK
  332. // Def. Intf. DISP? : No
  333. // Event Interface:
  334. // TypeFlags : (2) CanCreate
  335. // *********************************************************************//
  336. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  337. TJITVCTKProperties= class;
  338. {$ENDIF}
  339. TJITVCTK = class(TOleServer)
  340. private
  341. FIntf: IJITVCTK;
  342. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  343. FProps: TJITVCTKProperties;
  344. function GetServerProperties: TJITVCTKProperties;
  345. {$ENDIF}
  346. function GetDefaultInterface: IJITVCTK;
  347. protected
  348. procedure InitServerData; override;
  349. public
  350. constructor Create(AOwner: TComponent); override;
  351. destructor Destroy; override;
  352. procedure Connect; override;
  353. procedure ConnectTo(svrIntf: IJITVCTK);
  354. procedure Disconnect; override;
  355. function SetCert(const bstrCertType: WideString; const bstrDN: WideString;
  356. const bstrSN: WideString; const bstrEmail: WideString;
  357. const bstrDNIssuer: WideString; const bstrCertBase64: WideString): Integer;
  358. function SetCertChooseType(nType: Integer): Integer;
  359. function GetCertInfo(const bstrCertType: WideString; lInfoType: Integer;
  360. const bstrOID: WideString): WideString;
  361. function SetAlgorithm(const bstrSignAlg: WideString; const bstrEncAlg: WideString): Integer;
  362. function AttachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  363. function AttachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  364. const bstrFileNameOut: WideString): WideString;
  365. function VerifyAttachedSign(const bstrSignedData: WideString): Integer;
  366. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer;
  367. function DetachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  368. function DetachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  369. const bstrFileNameOut: WideString): WideString;
  370. function VerifyDetachedSign(const bstrSignedData: WideString; var pszSrcData: Byte;
  371. lSrcDataLen: Integer): Integer;
  372. function VerifyDetachedSignEx(const bstrSignedData: WideString;
  373. const bstrFileNameDetached: WideString;
  374. const bstrFileName: WideString): Integer;
  375. function EncryptEnvelop(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  376. function EncryptEnvelopEx(const bstrDN: WideString; const bstrFileName: WideString;
  377. const bstrFileNameOut: WideString): WideString;
  378. function DecryptEnvelop(const bstrEnvelop: WideString): Integer;
  379. function DecryptEnvelopEx(const bstrFileNameDetached: WideString): Integer;
  380. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  381. var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  382. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  383. const bstrEncCertDN: WideString; const bstrFileName: WideString;
  384. const bstrFileNameOut: WideString): WideString;
  385. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer;
  386. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer;
  387. function GetDataEx(out pszSrcData: Byte; var plSrcDataLen: Integer): Integer;
  388. function GetFile(const bstrFileSavePath: WideString): WideString;
  389. function GetErrorCode: Integer;
  390. function GetErrorMessage(lErrorCode: Integer): WideString;
  391. function SetCSP(const bstrProvider: WideString): Integer;
  392. function SetPIN(const bstrPIN: WideString): Integer;
  393. function JITGetVersion: WideString;
  394. function GetBase64Encode(var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  395. function GetBase64Decode(const bstrBase64Data: WideString; out pszSrcData: Byte;
  396. var pSrcDataLen: Integer): Integer;
  397. function GetData: WideString;
  398. function AttachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  399. function DetachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  400. function VerifyDetachedSignStr(const bstrSignedData: WideString; const bstrSrc: WideString): Integer;
  401. function EncryptEnvelopStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  402. function CreateSignedEnvelopStr(const bstrSignCertDN: WideString;
  403. const bstrEncCertDN: WideString; const bstrSrc: WideString): WideString;
  404. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  405. const lpszSN: WideString; const lpszEmail: WideString;
  406. const lpszIssuer: WideString; lInfoType: Integer): WideString;
  407. function SetCertEx(const bstrCertStoreType: WideString; const bstrCertType: WideString;
  408. const bstrDN: WideString; const bstrSN: WideString;
  409. const bstrEmail: WideString; const bstrDNIssuer: WideString;
  410. const bstrCertBase64: WideString): Integer;
  411. property DefaultInterface: IJITVCTK read GetDefaultInterface;
  412. published
  413. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  414. property Server: TJITVCTKProperties read GetServerProperties;
  415. {$ENDIF}
  416. end;
  417. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  418. // *********************************************************************//
  419. // OLE Server Properties Proxy Class
  420. // Server Object : TJITVCTK
  421. // (This object is used by the IDE's Property Inspector to allow editing
  422. // of the properties of this server)
  423. // *********************************************************************//
  424. TJITVCTKProperties = class(TPersistent)
  425. private
  426. FServer: TJITVCTK;
  427. function GetDefaultInterface: IJITVCTK;
  428. constructor Create(AServer: TJITVCTK);
  429. protected
  430. public
  431. property DefaultInterface: IJITVCTK read GetDefaultInterface;
  432. published
  433. end;
  434. {$ENDIF}
  435. // *********************************************************************//
  436. // The Class CoJITDSign provides a Create and CreateRemote method to
  437. // create instances of the default interface IJITDSign exposed by
  438. // the CoClass JITDSign. The functions are intended to be used by
  439. // clients wishing to automate the CoClass objects exposed by the
  440. // server of this typelibrary.
  441. // *********************************************************************//
  442. CoJITDSign = class
  443. class function Create: IJITDSign;
  444. class function CreateRemote(const MachineName: string): IJITDSign;
  445. end;
  446. // *********************************************************************//
  447. // OLE Server Proxy class declaration
  448. // Server Object : TJITDSign
  449. // Help String : JITDSign Class
  450. // Default Interface: IJITDSign
  451. // Def. Intf. DISP? : No
  452. // Event Interface:
  453. // TypeFlags : (2) CanCreate
  454. // *********************************************************************//
  455. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  456. TJITDSignProperties= class;
  457. {$ENDIF}
  458. TJITDSign = class(TOleServer)
  459. private
  460. FIntf: IJITDSign;
  461. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  462. FProps: TJITDSignProperties;
  463. function GetServerProperties: TJITDSignProperties;
  464. {$ENDIF}
  465. function GetDefaultInterface: IJITDSign;
  466. protected
  467. procedure InitServerData; override;
  468. public
  469. constructor Create(AOwner: TComponent); override;
  470. destructor Destroy; override;
  471. procedure Connect; override;
  472. procedure ConnectTo(svrIntf: IJITDSign);
  473. procedure Disconnect; override;
  474. function GetVersion: WideString;
  475. function SetCert(const lpstrCertType: WideString; const lpstrDN: WideString;
  476. const lpstrSN: WideString; const lpstrEmail: WideString;
  477. const lpstrDNIssuer: WideString; const lpstrCertBase64: WideString): Integer;
  478. function SetCertChooseType(lType: Integer): Integer;
  479. function GetCertInfo(const pszCertType: WideString; lInfoType: Integer; const pszOID: WideString): WideString;
  480. function SetAlgorithm(const lpstrSignAlgo: WideString; const lpstrEncAlgo: WideString): Integer;
  481. function AttachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString;
  482. function AttachSignEx(const pszDN: WideString; const pszFileName: WideString;
  483. const pszFileNameOut: WideString): WideString;
  484. function VerifyAttachedSign(const bstrSignedData: WideString): Integer;
  485. function VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer;
  486. function DetachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString;
  487. function DetachSignEx(const pszDN: WideString; const pszFileName: WideString;
  488. const pszFileNameOut: WideString): WideString;
  489. function VerifyDetachedSign(const pszSignedData: WideString; const pszSrcData: WideString): Integer;
  490. function VerifyDetachedSignEx(const pszSignedData: WideString;
  491. const pszFileNameDetached: WideString;
  492. const pszFileName: WideString): Integer;
  493. function EncryptEnvelop(const pszDN: WideString; const pszSrcData: WideString): WideString;
  494. function EncryptEnvelopEx(const pszDN: WideString; const pszFileName: WideString;
  495. const pszFileNameOut: WideString): WideString;
  496. function DecryptEnvelop(const pszEvpContent: WideString): Integer;
  497. function DecryptEnvelopEx(const bstrEvpFile: WideString): Integer;
  498. function CreateSignedEnvelop(const bstrSignCertDN: WideString; const bstrEncCertDN: WideString;
  499. const pVarSrcData: WideString): WideString;
  500. function CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  501. const bstrEncCertDN: WideString;
  502. const pbstrFileName: WideString;
  503. const bstrFileNameOut: WideString): WideString;
  504. function VerifySignedEnvelop(const bstrEnvelop: WideString): Integer;
  505. function VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer;
  506. function GetBase64Encode(const bstrSrcData: WideString): WideString;
  507. function GetBase64Decode(const bstrBase64Data: WideString): WideString;
  508. function GetErrorCode: Integer;
  509. function GetBase64HashEnCode(const bstrSrcData: WideString): WideString;
  510. function GetErrorMessage: WideString;
  511. function GetData: WideString;
  512. function GetFile(const bstrFileSavePath: WideString): WideString;
  513. function AddData(const bstrSrcData: WideString): Integer;
  514. function AddFile(const bstrSrcFile: WideString): Integer;
  515. function SetCSP(const pszProvider: WideString): Integer;
  516. function SetPIN(const pszPIN: WideString): Integer;
  517. function GetCertList(const lpszType: WideString; const lpszDN: WideString;
  518. const lpszSN: WideString; const lpszEmail: WideString;
  519. const lpszIssuer: WideString; lInfoType: Integer): WideString;
  520. function SetErrMsgLanguage(const lpzLangType: WideString): Integer;
  521. function ClearPIN: Integer;
  522. property DefaultInterface: IJITDSign read GetDefaultInterface;
  523. published
  524. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  525. property Server: TJITDSignProperties read GetServerProperties;
  526. {$ENDIF}
  527. end;
  528. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  529. // *********************************************************************//
  530. // OLE Server Properties Proxy Class
  531. // Server Object : TJITDSign
  532. // (This object is used by the IDE's Property Inspector to allow editing
  533. // of the properties of this server)
  534. // *********************************************************************//
  535. TJITDSignProperties = class(TPersistent)
  536. private
  537. FServer: TJITDSign;
  538. function GetDefaultInterface: IJITDSign;
  539. constructor Create(AServer: TJITDSign);
  540. protected
  541. public
  542. property DefaultInterface: IJITDSign read GetDefaultInterface;
  543. published
  544. end;
  545. {$ENDIF}
  546. procedure Register;
  547. resourcestring
  548. dtlServerPage = 'ActiveX';
  549. dtlOcxPage = 'ActiveX';
  550. implementation
  551. uses ComObj;
  552. class function CoJITVCTK.Create: IJITVCTK;
  553. begin
  554. Result := CreateComObject(CLASS_JITVCTK) as IJITVCTK;
  555. end;
  556. class function CoJITVCTK.CreateRemote(const MachineName: string): IJITVCTK;
  557. begin
  558. Result := CreateRemoteComObject(MachineName, CLASS_JITVCTK) as IJITVCTK;
  559. end;
  560. procedure TJITVCTK.InitServerData;
  561. const
  562. CServerData: TServerData = (
  563. ClassID: '{707C7D52-85A8-4584-8954-573EFCE77488}';
  564. IntfIID: '{9CDA9B8E-04AA-4070-9375-B1F327C8AA34}';
  565. EventIID: '';
  566. LicenseKey: nil;
  567. Version: 500);
  568. begin
  569. ServerData := @CServerData;
  570. end;
  571. procedure TJITVCTK.Connect;
  572. var
  573. punk: IUnknown;
  574. begin
  575. if FIntf = nil then
  576. begin
  577. punk := GetServer;
  578. Fintf:= punk as IJITVCTK;
  579. end;
  580. end;
  581. procedure TJITVCTK.ConnectTo(svrIntf: IJITVCTK);
  582. begin
  583. Disconnect;
  584. FIntf := svrIntf;
  585. end;
  586. procedure TJITVCTK.DisConnect;
  587. begin
  588. if Fintf <> nil then
  589. begin
  590. FIntf := nil;
  591. end;
  592. end;
  593. function TJITVCTK.GetDefaultInterface: IJITVCTK;
  594. begin
  595. if FIntf = nil then
  596. Connect;
  597. Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  598. Result := FIntf;
  599. end;
  600. constructor TJITVCTK.Create(AOwner: TComponent);
  601. begin
  602. inherited Create(AOwner);
  603. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  604. FProps := TJITVCTKProperties.Create(Self);
  605. {$ENDIF}
  606. end;
  607. destructor TJITVCTK.Destroy;
  608. begin
  609. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  610. FProps.Free;
  611. {$ENDIF}
  612. inherited Destroy;
  613. end;
  614. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  615. function TJITVCTK.GetServerProperties: TJITVCTKProperties;
  616. begin
  617. Result := FProps;
  618. end;
  619. {$ENDIF}
  620. function TJITVCTK.SetCert(const bstrCertType: WideString; const bstrDN: WideString;
  621. const bstrSN: WideString; const bstrEmail: WideString;
  622. const bstrDNIssuer: WideString; const bstrCertBase64: WideString): Integer;
  623. begin
  624. Result := DefaultInterface.SetCert(bstrCertType, bstrDN, bstrSN, bstrEmail, bstrDNIssuer,
  625. bstrCertBase64);
  626. end;
  627. function TJITVCTK.SetCertChooseType(nType: Integer): Integer;
  628. begin
  629. Result := DefaultInterface.SetCertChooseType(nType);
  630. end;
  631. function TJITVCTK.GetCertInfo(const bstrCertType: WideString; lInfoType: Integer;
  632. const bstrOID: WideString): WideString;
  633. begin
  634. Result := DefaultInterface.GetCertInfo(bstrCertType, lInfoType, bstrOID);
  635. end;
  636. function TJITVCTK.SetAlgorithm(const bstrSignAlg: WideString; const bstrEncAlg: WideString): Integer;
  637. begin
  638. Result := DefaultInterface.SetAlgorithm(bstrSignAlg, bstrEncAlg);
  639. end;
  640. function TJITVCTK.AttachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  641. begin
  642. Result := DefaultInterface.AttachSign(bstrDN, pszSrcData, lSrcDataLen);
  643. end;
  644. function TJITVCTK.AttachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  645. const bstrFileNameOut: WideString): WideString;
  646. begin
  647. Result := DefaultInterface.AttachSignEx(bstrDN, bstrFileName, bstrFileNameOut);
  648. end;
  649. function TJITVCTK.VerifyAttachedSign(const bstrSignedData: WideString): Integer;
  650. begin
  651. Result := DefaultInterface.VerifyAttachedSign(bstrSignedData);
  652. end;
  653. function TJITVCTK.VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer;
  654. begin
  655. Result := DefaultInterface.VerifyAttachedSignEx(bstrFileNameAttached);
  656. end;
  657. function TJITVCTK.DetachSign(const bstrDN: WideString; var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  658. begin
  659. Result := DefaultInterface.DetachSign(bstrDN, pszSrcData, lSrcDataLen);
  660. end;
  661. function TJITVCTK.DetachSignEx(const bstrDN: WideString; const bstrFileName: WideString;
  662. const bstrFileNameOut: WideString): WideString;
  663. begin
  664. Result := DefaultInterface.DetachSignEx(bstrDN, bstrFileName, bstrFileNameOut);
  665. end;
  666. function TJITVCTK.VerifyDetachedSign(const bstrSignedData: WideString; var pszSrcData: Byte;
  667. lSrcDataLen: Integer): Integer;
  668. begin
  669. Result := DefaultInterface.VerifyDetachedSign(bstrSignedData, pszSrcData, lSrcDataLen);
  670. end;
  671. function TJITVCTK.VerifyDetachedSignEx(const bstrSignedData: WideString;
  672. const bstrFileNameDetached: WideString;
  673. const bstrFileName: WideString): Integer;
  674. begin
  675. Result := DefaultInterface.VerifyDetachedSignEx(bstrSignedData, bstrFileNameDetached, bstrFileName);
  676. end;
  677. function TJITVCTK.EncryptEnvelop(const bstrDN: WideString; var pszSrcData: Byte;
  678. lSrcDataLen: Integer): WideString;
  679. begin
  680. Result := DefaultInterface.EncryptEnvelop(bstrDN, pszSrcData, lSrcDataLen);
  681. end;
  682. function TJITVCTK.EncryptEnvelopEx(const bstrDN: WideString; const bstrFileName: WideString;
  683. const bstrFileNameOut: WideString): WideString;
  684. begin
  685. Result := DefaultInterface.EncryptEnvelopEx(bstrDN, bstrFileName, bstrFileNameOut);
  686. end;
  687. function TJITVCTK.DecryptEnvelop(const bstrEnvelop: WideString): Integer;
  688. begin
  689. Result := DefaultInterface.DecryptEnvelop(bstrEnvelop);
  690. end;
  691. function TJITVCTK.DecryptEnvelopEx(const bstrFileNameDetached: WideString): Integer;
  692. begin
  693. Result := DefaultInterface.DecryptEnvelopEx(bstrFileNameDetached);
  694. end;
  695. function TJITVCTK.CreateSignedEnvelop(const bstrSignCertDN: WideString;
  696. const bstrEncCertDN: WideString; var pszSrcData: Byte;
  697. lSrcDataLen: Integer): WideString;
  698. begin
  699. Result := DefaultInterface.CreateSignedEnvelop(bstrSignCertDN, bstrEncCertDN, pszSrcData,
  700. lSrcDataLen);
  701. end;
  702. function TJITVCTK.CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  703. const bstrEncCertDN: WideString;
  704. const bstrFileName: WideString;
  705. const bstrFileNameOut: WideString): WideString;
  706. begin
  707. Result := DefaultInterface.CreateSignedEnvelopEx(bstrSignCertDN, bstrEncCertDN, bstrFileName,
  708. bstrFileNameOut);
  709. end;
  710. function TJITVCTK.VerifySignedEnvelop(const bstrEnvelop: WideString): Integer;
  711. begin
  712. Result := DefaultInterface.VerifySignedEnvelop(bstrEnvelop);
  713. end;
  714. function TJITVCTK.VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer;
  715. begin
  716. Result := DefaultInterface.VerifySignedEnvelopEx(bstrEvpFile);
  717. end;
  718. function TJITVCTK.GetDataEx(out pszSrcData: Byte; var plSrcDataLen: Integer): Integer;
  719. begin
  720. Result := DefaultInterface.GetDataEx(pszSrcData, plSrcDataLen);
  721. end;
  722. function TJITVCTK.GetFile(const bstrFileSavePath: WideString): WideString;
  723. begin
  724. Result := DefaultInterface.GetFile(bstrFileSavePath);
  725. end;
  726. function TJITVCTK.GetErrorCode: Integer;
  727. begin
  728. Result := DefaultInterface.GetErrorCode;
  729. end;
  730. function TJITVCTK.GetErrorMessage(lErrorCode: Integer): WideString;
  731. begin
  732. Result := DefaultInterface.GetErrorMessage(lErrorCode);
  733. end;
  734. function TJITVCTK.SetCSP(const bstrProvider: WideString): Integer;
  735. begin
  736. Result := DefaultInterface.SetCSP(bstrProvider);
  737. end;
  738. function TJITVCTK.SetPIN(const bstrPIN: WideString): Integer;
  739. begin
  740. Result := DefaultInterface.SetPIN(bstrPIN);
  741. end;
  742. function TJITVCTK.JITGetVersion: WideString;
  743. begin
  744. Result := DefaultInterface.JITGetVersion;
  745. end;
  746. function TJITVCTK.GetBase64Encode(var pszSrcData: Byte; lSrcDataLen: Integer): WideString;
  747. begin
  748. Result := DefaultInterface.GetBase64Encode(pszSrcData, lSrcDataLen);
  749. end;
  750. function TJITVCTK.GetBase64Decode(const bstrBase64Data: WideString; out pszSrcData: Byte;
  751. var pSrcDataLen: Integer): Integer;
  752. begin
  753. Result := DefaultInterface.GetBase64Decode(bstrBase64Data, pszSrcData, pSrcDataLen);
  754. end;
  755. function TJITVCTK.GetData: WideString;
  756. begin
  757. Result := DefaultInterface.GetData;
  758. end;
  759. function TJITVCTK.AttachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  760. begin
  761. Result := DefaultInterface.AttachSignStr(bstrDN, bstrSrc);
  762. end;
  763. function TJITVCTK.DetachSignStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  764. begin
  765. Result := DefaultInterface.DetachSignStr(bstrDN, bstrSrc);
  766. end;
  767. function TJITVCTK.VerifyDetachedSignStr(const bstrSignedData: WideString; const bstrSrc: WideString): Integer;
  768. begin
  769. Result := DefaultInterface.VerifyDetachedSignStr(bstrSignedData, bstrSrc);
  770. end;
  771. function TJITVCTK.EncryptEnvelopStr(const bstrDN: WideString; const bstrSrc: WideString): WideString;
  772. begin
  773. Result := DefaultInterface.EncryptEnvelopStr(bstrDN, bstrSrc);
  774. end;
  775. function TJITVCTK.CreateSignedEnvelopStr(const bstrSignCertDN: WideString;
  776. const bstrEncCertDN: WideString; const bstrSrc: WideString): WideString;
  777. begin
  778. Result := DefaultInterface.CreateSignedEnvelopStr(bstrSignCertDN, bstrEncCertDN, bstrSrc);
  779. end;
  780. function TJITVCTK.GetCertList(const lpszType: WideString; const lpszDN: WideString;
  781. const lpszSN: WideString; const lpszEmail: WideString;
  782. const lpszIssuer: WideString; lInfoType: Integer): WideString;
  783. begin
  784. Result := DefaultInterface.GetCertList(lpszType, lpszDN, lpszSN, lpszEmail, lpszIssuer, lInfoType);
  785. end;
  786. function TJITVCTK.SetCertEx(const bstrCertStoreType: WideString; const bstrCertType: WideString;
  787. const bstrDN: WideString; const bstrSN: WideString;
  788. const bstrEmail: WideString; const bstrDNIssuer: WideString;
  789. const bstrCertBase64: WideString): Integer;
  790. begin
  791. Result := DefaultInterface.SetCertEx(bstrCertStoreType, bstrCertType, bstrDN, bstrSN, bstrEmail,
  792. bstrDNIssuer, bstrCertBase64);
  793. end;
  794. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  795. constructor TJITVCTKProperties.Create(AServer: TJITVCTK);
  796. begin
  797. inherited Create;
  798. FServer := AServer;
  799. end;
  800. function TJITVCTKProperties.GetDefaultInterface: IJITVCTK;
  801. begin
  802. Result := FServer.DefaultInterface;
  803. end;
  804. {$ENDIF}
  805. class function CoJITDSign.Create: IJITDSign;
  806. begin
  807. Result := CreateComObject(CLASS_JITDSign) as IJITDSign;
  808. end;
  809. class function CoJITDSign.CreateRemote(const MachineName: string): IJITDSign;
  810. begin
  811. Result := CreateRemoteComObject(MachineName, CLASS_JITDSign) as IJITDSign;
  812. end;
  813. procedure TJITDSign.InitServerData;
  814. const
  815. CServerData: TServerData = (
  816. ClassID: '{06CA9432-D9BD-4867-8475-770B131E1759}';
  817. IntfIID: '{BD6E3733-66B4-4BD8-ADA1-64F1F6B508AC}';
  818. EventIID: '';
  819. LicenseKey: nil;
  820. Version: 500);
  821. begin
  822. ServerData := @CServerData;
  823. end;
  824. procedure TJITDSign.Connect;
  825. var
  826. punk: IUnknown;
  827. begin
  828. if FIntf = nil then
  829. begin
  830. punk := GetServer;
  831. Fintf:= punk as IJITDSign;
  832. end;
  833. end;
  834. procedure TJITDSign.ConnectTo(svrIntf: IJITDSign);
  835. begin
  836. Disconnect;
  837. FIntf := svrIntf;
  838. end;
  839. procedure TJITDSign.DisConnect;
  840. begin
  841. if Fintf <> nil then
  842. begin
  843. FIntf := nil;
  844. end;
  845. end;
  846. function TJITDSign.GetDefaultInterface: IJITDSign;
  847. begin
  848. if FIntf = nil then
  849. Connect;
  850. Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  851. Result := FIntf;
  852. end;
  853. constructor TJITDSign.Create(AOwner: TComponent);
  854. begin
  855. inherited Create(AOwner);
  856. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  857. FProps := TJITDSignProperties.Create(Self);
  858. {$ENDIF}
  859. end;
  860. destructor TJITDSign.Destroy;
  861. begin
  862. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  863. FProps.Free;
  864. {$ENDIF}
  865. inherited Destroy;
  866. end;
  867. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  868. function TJITDSign.GetServerProperties: TJITDSignProperties;
  869. begin
  870. Result := FProps;
  871. end;
  872. {$ENDIF}
  873. function TJITDSign.GetVersion: WideString;
  874. begin
  875. Result := DefaultInterface.GetVersion;
  876. end;
  877. function TJITDSign.SetCert(const lpstrCertType: WideString; const lpstrDN: WideString;
  878. const lpstrSN: WideString; const lpstrEmail: WideString;
  879. const lpstrDNIssuer: WideString; const lpstrCertBase64: WideString): Integer;
  880. begin
  881. Result := DefaultInterface.SetCert(lpstrCertType, lpstrDN, lpstrSN, lpstrEmail, lpstrDNIssuer,
  882. lpstrCertBase64);
  883. end;
  884. function TJITDSign.SetCertChooseType(lType: Integer): Integer;
  885. begin
  886. Result := DefaultInterface.SetCertChooseType(lType);
  887. end;
  888. function TJITDSign.GetCertInfo(const pszCertType: WideString; lInfoType: Integer;
  889. const pszOID: WideString): WideString;
  890. begin
  891. Result := DefaultInterface.GetCertInfo(pszCertType, lInfoType, pszOID);
  892. end;
  893. function TJITDSign.SetAlgorithm(const lpstrSignAlgo: WideString; const lpstrEncAlgo: WideString): Integer;
  894. begin
  895. Result := DefaultInterface.SetAlgorithm(lpstrSignAlgo, lpstrEncAlgo);
  896. end;
  897. function TJITDSign.AttachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString;
  898. begin
  899. Result := DefaultInterface.AttachSign(lpstrDN, pszSrcData);
  900. end;
  901. function TJITDSign.AttachSignEx(const pszDN: WideString; const pszFileName: WideString;
  902. const pszFileNameOut: WideString): WideString;
  903. begin
  904. Result := DefaultInterface.AttachSignEx(pszDN, pszFileName, pszFileNameOut);
  905. end;
  906. function TJITDSign.VerifyAttachedSign(const bstrSignedData: WideString): Integer;
  907. begin
  908. Result := DefaultInterface.VerifyAttachedSign(bstrSignedData);
  909. end;
  910. function TJITDSign.VerifyAttachedSignEx(const bstrFileNameAttached: WideString): Integer;
  911. begin
  912. Result := DefaultInterface.VerifyAttachedSignEx(bstrFileNameAttached);
  913. end;
  914. function TJITDSign.DetachSign(const lpstrDN: WideString; const pszSrcData: WideString): WideString;
  915. begin
  916. Result := DefaultInterface.DetachSign(lpstrDN, pszSrcData);
  917. end;
  918. function TJITDSign.DetachSignEx(const pszDN: WideString; const pszFileName: WideString;
  919. const pszFileNameOut: WideString): WideString;
  920. begin
  921. Result := DefaultInterface.DetachSignEx(pszDN, pszFileName, pszFileNameOut);
  922. end;
  923. function TJITDSign.VerifyDetachedSign(const pszSignedData: WideString; const pszSrcData: WideString): Integer;
  924. begin
  925. Result := DefaultInterface.VerifyDetachedSign(pszSignedData, pszSrcData);
  926. end;
  927. function TJITDSign.VerifyDetachedSignEx(const pszSignedData: WideString;
  928. const pszFileNameDetached: WideString;
  929. const pszFileName: WideString): Integer;
  930. begin
  931. Result := DefaultInterface.VerifyDetachedSignEx(pszSignedData, pszFileNameDetached, pszFileName);
  932. end;
  933. function TJITDSign.EncryptEnvelop(const pszDN: WideString; const pszSrcData: WideString): WideString;
  934. begin
  935. Result := DefaultInterface.EncryptEnvelop(pszDN, pszSrcData);
  936. end;
  937. function TJITDSign.EncryptEnvelopEx(const pszDN: WideString; const pszFileName: WideString;
  938. const pszFileNameOut: WideString): WideString;
  939. begin
  940. Result := DefaultInterface.EncryptEnvelopEx(pszDN, pszFileName, pszFileNameOut);
  941. end;
  942. function TJITDSign.DecryptEnvelop(const pszEvpContent: WideString): Integer;
  943. begin
  944. Result := DefaultInterface.DecryptEnvelop(pszEvpContent);
  945. end;
  946. function TJITDSign.DecryptEnvelopEx(const bstrEvpFile: WideString): Integer;
  947. begin
  948. Result := DefaultInterface.DecryptEnvelopEx(bstrEvpFile);
  949. end;
  950. function TJITDSign.CreateSignedEnvelop(const bstrSignCertDN: WideString;
  951. const bstrEncCertDN: WideString;
  952. const pVarSrcData: WideString): WideString;
  953. begin
  954. Result := DefaultInterface.CreateSignedEnvelop(bstrSignCertDN, bstrEncCertDN, pVarSrcData);
  955. end;
  956. function TJITDSign.CreateSignedEnvelopEx(const bstrSignCertDN: WideString;
  957. const bstrEncCertDN: WideString;
  958. const pbstrFileName: WideString;
  959. const bstrFileNameOut: WideString): WideString;
  960. begin
  961. Result := DefaultInterface.CreateSignedEnvelopEx(bstrSignCertDN, bstrEncCertDN, pbstrFileName,
  962. bstrFileNameOut);
  963. end;
  964. function TJITDSign.VerifySignedEnvelop(const bstrEnvelop: WideString): Integer;
  965. begin
  966. Result := DefaultInterface.VerifySignedEnvelop(bstrEnvelop);
  967. end;
  968. function TJITDSign.VerifySignedEnvelopEx(const bstrEvpFile: WideString): Integer;
  969. begin
  970. Result := DefaultInterface.VerifySignedEnvelopEx(bstrEvpFile);
  971. end;
  972. function TJITDSign.GetBase64Encode(const bstrSrcData: WideString): WideString;
  973. begin
  974. Result := DefaultInterface.GetBase64Encode(bstrSrcData);
  975. end;
  976. function TJITDSign.GetBase64Decode(const bstrBase64Data: WideString): WideString;
  977. begin
  978. Result := DefaultInterface.GetBase64Decode(bstrBase64Data);
  979. end;
  980. function TJITDSign.GetErrorCode: Integer;
  981. begin
  982. Result := DefaultInterface.GetErrorCode;
  983. end;
  984. function TJITDSign.GetBase64HashEnCode(const bstrSrcData: WideString): WideString;
  985. begin
  986. Result := DefaultInterface.GetBase64HashEnCode(bstrSrcData);
  987. end;
  988. function TJITDSign.GetErrorMessage: WideString;
  989. begin
  990. Result := DefaultInterface.GetErrorMessage;
  991. end;
  992. function TJITDSign.GetData: WideString;
  993. begin
  994. Result := DefaultInterface.GetData;
  995. end;
  996. function TJITDSign.GetFile(const bstrFileSavePath: WideString): WideString;
  997. begin
  998. Result := DefaultInterface.GetFile(bstrFileSavePath);
  999. end;
  1000. function TJITDSign.AddData(const bstrSrcData: WideString): Integer;
  1001. begin
  1002. Result := DefaultInterface.AddData(bstrSrcData);
  1003. end;
  1004. function TJITDSign.AddFile(const bstrSrcFile: WideString): Integer;
  1005. begin
  1006. Result := DefaultInterface.AddFile(bstrSrcFile);
  1007. end;
  1008. function TJITDSign.SetCSP(const pszProvider: WideString): Integer;
  1009. begin
  1010. Result := DefaultInterface.SetCSP(pszProvider);
  1011. end;
  1012. function TJITDSign.SetPIN(const pszPIN: WideString): Integer;
  1013. begin
  1014. Result := DefaultInterface.SetPIN(pszPIN);
  1015. end;
  1016. function TJITDSign.GetCertList(const lpszType: WideString; const lpszDN: WideString;
  1017. const lpszSN: WideString; const lpszEmail: WideString;
  1018. const lpszIssuer: WideString; lInfoType: Integer): WideString;
  1019. begin
  1020. Result := DefaultInterface.GetCertList(lpszType, lpszDN, lpszSN, lpszEmail, lpszIssuer, lInfoType);
  1021. end;
  1022. function TJITDSign.SetErrMsgLanguage(const lpzLangType: WideString): Integer;
  1023. begin
  1024. Result := DefaultInterface.SetErrMsgLanguage(lpzLangType);
  1025. end;
  1026. function TJITDSign.ClearPIN: Integer;
  1027. begin
  1028. Result := DefaultInterface.ClearPIN;
  1029. end;
  1030. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1031. constructor TJITDSignProperties.Create(AServer: TJITDSign);
  1032. begin
  1033. inherited Create;
  1034. FServer := AServer;
  1035. end;
  1036. function TJITDSignProperties.GetDefaultInterface: IJITDSign;
  1037. begin
  1038. Result := FServer.DefaultInterface;
  1039. end;
  1040. {$ENDIF}
  1041. procedure Register;
  1042. begin
  1043. RegisterComponents(dtlServerPage, [TJITVCTK, TJITDSign]);
  1044. end;
  1045. end.