Your SlideShare is downloading. ×
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
78
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. SMART-CARD Smart-!"#$% 18 2001
  • 2. ; < ?DDKO C$>FGHD# "$CHMI!# $L!"?D!H QFD>T!O (% "#!PH @NK>? ), %U$C@V!U %C!D?G!AH">! N?EMFI?HGFW J!JP!$#H>F cdserv.dll. M!%$C!#"@ DH$JU$C!G?@ "LM?%$AD?@ !DQ$MG?T!@, "%HCHD!@ $ %$NG$IDKU $S!J>?U,%$ND!>?WV!U LM! M?J$#H QFD>T!O J!JP!$#H>!.DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 2 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 3. EP?%PHD!H1. ?@ ABCDCEAF A G9DCHBI@ CJCKB;L@BAF (EDC99; AN)..................................... 4 1.1 ........................................................................................................................................... 4 1.2 Y Z ............................................................................................................... 4 1.3 Z ] ................................................................................. 4 1.4 ^ .............................................................................................................................. 52. B;KB;L@BA@ JAJDAC?@QA CDSERV.DLL .............................................................................. 63. CJTA@ 9H@U@BAF ........................................................................................................................... 63. C A9;BA@ VGBQWAN JAJDAC?@QA CDSERV.DLL ............................................................ 7 3.1. VGBQWAF CDSERVINI ..................................................................................................................... 7 3.2. VGBQWAF CDOPENCARD ............................................................................................................... 8 3.3. VGBQWAF CDGETPURSEDATA ....................................................................................................... 8 3.4. VGBQWAF CDCHANGEDATES ......................................................................................................... 9 3.5. VGBQWAF CDUPDATEMAXAMOUNT............................................................................................ 10 3.6. VGBQWAF CDSERVCLOSE ............................................................................................................. 104. ADCb@BAF................................................................................................................................... 10 4.1. 9CCJT@BAF CJ CcAJQ;d........................................................................................................... 10 4.2. A @ HIKCH; VGBQWAN CUGDF AK CE ; I (BORLAND C++ V.5.01) ....................... 15DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 3 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 4. 1. ? : (E g)1.1 99G – !"#HG? FAH#? L$#MHJPHD!@ MH"FM"$% ! JHND?P!ADKU M?"AH#$% "!"L$PBN$%?D!HG smart->?M# (D?N%?D!H "!"#HGK).Payflex - D#HPPH>#F?PBD?@ (smart) >?M#? Q!MGK Schlumberger, >$#$M?@ L$P$IHD? %$"D$%F "!"#HG JHND?P!ADKU M?"AH#$%, M?NM?J?#K%?HGKU >$GL?D!HO Dekart S.R.L.SCR-60, Reflex 60, Reflex 72 (Schlumberger), TOWITOKO ChipDrive - "A!#K%?#HP!smart->?M#, !"L$PBNFWV!H"@ % $#CHPBDKU #HUD$P$E!AH">!U N%HDB@U . ?J$#?W##$PB>$ "$%GH"#D$ " >$GLBW#HM$G, ! FLM?%P@W#"@ LM$EM?GGDKG $JH"LHAHD!HG,M?J$#?WVHG D? >$GLBW#HMH.r - $ME?D!N?T!@, %KL$PD@WV?@ LHM"$D?P!N?T!W >?M# CHMI?#HPHO, %HCFV?@J?NK >?M#-"AH#$% CHMI?#HPHO ! $JM?J?#K%?WV?@ LP?#gIDKH #M?DN?>T!!. W - LM$TH""!DE$%KO THD#M. $CM?NCHPHD!H (FA?"#D!>) "!"#HGK, % N?C?A! >$#$M$E$%U$C!# $J"PFI!%?D!H #HMG!D?PBD$E$ L$P@, "J$M #M?DN?>T!O $# #HMG!D?P$%, !U"$M#!M$%>F ! M?""KP>F hG!#HD#?G.W9 – THD#M "!"#HGK. ME?D!N?T!@, N?D!G?WV?@"@ LMHC%?M!#HPBD$OLHM"$D?P!N?T!HO >?M# CHMI?#HPHO ! !U LHMHC?AHO hG!#HD#?G (FA?"#D!>?G "!"#HGK).W9Q - THD#M "HM#!Q!>?T!! >PWAHO (Certificate authority). ME?D!N?T!@,$JH"LHA!%?WV?@ "HM#!Q!>?T!W >PWAHO FA?"#D!>$% "!"#HGK. !"# . QFD>T!! THD#M? "!"#HGK ! THD#M? "HM#!Q!>?T!! >PWAHO%KL$PD@H# $CD? $ME?D!N?T!@.U : - Q!N!AH">$H P!T$, !"L$PBNFWVHH >?M#F % >?AH"#%H LP?#gID$E$!D"#MFGHD#? LM! $LP?#H #$%?M? !P! F"PFE!. < – F"P$%D?@ #$%?M$-CHDHID?@ HC!D!T? (MFJP!, PH!, C$PP?MK,P!#MK, > #·A. ! #.C.), !"L$PBNFHG?@ % % >?AH"#%H "MHC"#%? LP?#HI?.1.2 9 :s tDES (Data Encryption Standard) - #?DC?M# S!QM$%?D!@ C?DDKU. !GGH#M!AD?@"!"#HG? S!QM$%?D!@ " CP!D$O >PWA? ! S!QMFHG$E$ JP$>? C?DDKU 64 J!#?.nQQH>#!%D?@ CP!D? >PWA? D? "?G$G CHPH M?%D? 56 ($C!D J!# >?IC$E$ J?O#?!"L$PBNFH#"@ % >?AH"#%H >$D#M$PBD$E$).RSA - "!"#HG? S!QM$%?D!@ D? $"D$%H $#>MK#KU >PWAHO. M!GHD@H#"@ % "!"#HGH CP@"#?#!AH">$O ?F#HD#!Q!>?T!! >?M# CHMI?#HPHO.SHS (Secure Hash Standard) - #?DC?M# D? UHS-QFD>T!W. #?DC?M# $LMHCHP@H#?PE$M!#G Secure Hash Algorithm (SHA-1), >$#$MKO G$IH# !"L$PBN$%?#B"@ CP@"$NC?D!@ ""I?#$E$" LMHC"#?%PHD!@ DH>$#$M$O L$"PHC$%?#HPBD$"#!. ?>$HLMHC"#?%PHD!H D$"!# D?N%?D!H $"%$& (" )*+ $*,"( +-#*( .1.3 Q : : t < uSAM (Secure Application Module) – "LHT!?PBD?@ >?M#?, >$#$M?@ $JH"LHA!%?H#JHN$L?"D$"#B LM! $LHM?T!@U CHJH#$%?D!@ ! >MHC!#$%?D!@.Q (!P! >?M#? LHM"$D?PBDKU >PWAHO) – "LHT!?PBD?@ >?M#?, >$#$M?@LMHCD?ND?AHD? CP@ N?V!VHDD$E$ UM?DHD!@ >PWA? (>PWAHO) C$"#FL? $#%H#"#%HDDKUP!T "!"#HGK. ?M#? C$"#FL? LM!D?CPHI!# >$D>MH#D$GF $#%H#"#%HDD$GF P!TF"!"#HGK ! N?V!VHD? HE$ LHM"$D?PBDKG !CHD#!Q!>?T!$DDKG D$GHM$G (PIN->$C$G).9 g :g : - DH!NGHD@HG?@, FD!>?PBD?@ CP@ >?IC$O >?M#K C%$!AD?@L$"PHC$%?#HPBD$"#B CP!D$O 8 J?O#, N?L!"K%?HG?@ D? >?M#F N?%$C$G !NE$#$%!#HPHG.DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 4 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 5. BIN (Bank Identification Number) – !CHD#!Q!>?T!$DDKO D$GHM hG!#HD#? (8 T!QM),"$"#?%PHDDKO % "$$#%H#"#%!! "$ "#?DC?M#$G ISO.PIN (Personal Identification Number) – LHM"$D?PBDKO !CHD#!Q!>?T!$DDKO D$GHML$PBN$%?#HP@ ($# 4 C$ 8 CH"@#!ADKU T!QM). P?CHPHT >?M#K $J@N?D CHMI?#B "%$O PIN- >$C % "H>MH#H.PAN (Primary Account Number) – D$GHM >?M#K (19 T!QM), LHM%KH 8 T!QM >$#$M$E$"$$#%H#"#%FW# BIN.ID (Identifier) – !CHD#!Q!>?#$M (8 T!QM), $LMHCHP@WV!O !GHD? Q?OP$%, % >$#$MKUN?L!"K%?W#"@ RSA >PWA! LM$TH""!DE$%$E$ THD#M? ! hG!#HD#?, N?LM$" D?"HM#!Q!>?T!W ! "HM#!Q!>?#, ? #?>IH PAN->$CK hG!#HD#?. $%L?C?H# " BIN.1.4 Q v :Q v – %DF#MHDD!H >PWA!, >$#$MKH UM?D@#"@ D? >?M#H C$"#FL? !LM!GHD@W#"@ CP@ «$#>MK#!@» M?NP!ADKU #HUD$P$E!AH">!U LM!P$IHD!O "!"#HGK,LM!AHG % J$PBS!D"#%H "PFA?H% $D! "PFI?# CP@ ?>#!%!N?T!! CMFE!U ("H>MH#DKU)>PWAHO "!"#HGK.U t < v - "M?"LKPHD!H" >PWA?. "L$PBNFH#"@ CP@!DC!%!CF?P!N?T!! %DF#MHDD!U >PWAHO >?M# CHMI?#HPHO. v - "H>MH#DKO >PWA "!GGH#M!AD$O "!"#HGK S!QM$%?D!@, !"L$PBNFHGKO% "!"#HGH CP@ C!%HM"!Q!>?T!! >PWAHO >?M# CHMI?#HPHO. - $#>MK#?@ A?"#B >PWA? "!"#HGK S!QM$%?D!@ RSA.r - $#>MK#?@ A?"#B >PWA? RSA. $IH# JK#B M?%D$O 3 P!J$ AH#%gM#$GFA!"PF ZHMG? (Fermat 4 = 2^2^4+1 = 65537). h>"L$DHD#? M?%D? 3.9 t - C%$!AD?@ L$"PHC$%?#HPBD$"#B, L$PFA?HG?@ "LHT!?PBDKG!>M!L#$EM?Q!AH">!G! GH#$C?G! ! "PFI?V?@ CP@ LM$%HM>! C$"#$%HMD$"#! DH>$#$M$OL$"PHC$%?#HPBD$"#! C?DDKU.9 g - L$"PHC$%?#HPBD$"#B C%$!ADKU C?DDKU, >$#$M?@"$NC?g#"@ "LHT!?PBDKG! GHU?D!NG?G! % >?M#?U ! #HMG!D?P?U CP@ G$C!Q!>?T!!"$$JVHD!O " THPBW !DC!%!CF?P!N?T!! LM$#$>$P? $JGHD? $# $CD$E$ "H?D"? > CMFE$GFDSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 5 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 6. 2. B cdserv.dll $CFPB cdserv.dll LMHCD?ND?AHD CP@ $J"PFI!%?D!@ >?M#K L$PBN$%?#HP@(L$PFAHD!@ !DQ$MG?T!! $ >?M#H ! !NGHDHD!@ M@C? L?M?GH#M$% - L$#$P>? >$SHPB>$%,"M$>? CHO"#%!@ >?M#K). !3. C w !D?G!AH">! N?EMFI?HG?@ J!JP!$#H>? cdserv.dll %>PWA?H# % "HJ@ "PHCFWV!HQFD>T!!: • CDservIni – !D!T!?P!N?T!@ LM$TH""?; • CDOpenCard – $#>MK#!H >?M#K L$PBN$%?#HP@ " $CD$%MHGHDDKG LM$%HCHD!HG ?F#HD#!Q!>?T!! ! A#HD!HG C?DDKU " >?M#K; • CDGetPurseData – A#HD!H L$PD$O !DQ$MG?T!! $ >$SHPB>?U >?M#K L$PBN$%?#HP@; • CDUpdateMaxAmount – !NGHDHD!H L$#$P>? >$SHPB>? >?M#K L$PBN$%?#HP@; • CDChangeDates – !NGHDHD!H "M$>? CHO"#%!@ >?M#K; • CDservClose – N?%HMSHD!H LM$TH""?. M!GHA?D!H. ?J$#? " G$CFPHG C$PID? D?A!D?#B"@ %KN$%$G QFD>T!! CDservIni !N?%HMS?#B"@ %KN$%$G QFD>T!! CDservClose.ZFD>T!!, %U$C@V!H % G$CFPB cdserv.dll, MH?P!N$%?DK D? @NK>?U LM$EM?GG!M$%?D!@ , C++. H$JU$C!G$H $J$MFC$%?D!H:• $GLBW#HM IBM PC (486 ! %KSH), !GHWV!O "%$J$CDKH L$"PHC$%?#HPBDKH L$M#K;• Smart->?M#K: >?M#? C$"#FL? hG!#HD#?, >?M#? L$PBN$%?#HP@;• A!#K%?#HPB smart->?M# $CD$E$ !N "PHCFWV!U #!L$%: SCR-60, Reflex 60, Reflex 72 (Schlumberger), TOWITOKO ChipDrive. H$JU$C!G$H LM$EM?GGD$H $JH"LHAHD!H:• LHM?T!$DD?@ "!"#HG? MS Windows 9x, NT;• CT API CP@ "A!#K%?#HPHO TOWITOKO ChipDrive ! Schlumberger Reflex 72;• Z?OP >PWAHO hG!#HD#? ID_hG!#HD#?.se3 (#MH#B@ EMFLL?);• Z?OP "HM#!Q!>?#? $#>MK#$E$ >PWA? ID_hG!#HD#?.crt. "#?D$%>? G$CFP@ cdserv.dll $"FVH"#%P@H#"@ LM$"#KG HE$ >$L!M$%?D!HG %"$$#%H#"#%FWV!O >?#?P$E (SYSTEM, SYSTEM32) "!"#HGK Windows.DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 6 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 7. 3. C t < g cdserv.dll 3.1. V < CDservIni."/,"# : CDservIni."/#"! # : ZFD>T!@ $JH"LHA!%?H# !D!T!?P!N?T!W LM$TH""? $J"PFI!%?D!@ >?M#K L$PBN$%?#HP@.0+*, 1 ) # # 1: H$JU$C!G$ D?P!A!H >?M#K C$"#FL? hG!#HD#?, Q?OP? " #MH#BHO EMFLL$O >PWAHO hG!#HD#? ! Q?OP? " "HM#!Q!>?#$G $#>MK#$E$ >PWA? hG!#HD#?.3 #("4 : #include "CDserv.h" int CDservIni (char *Port, short ReaderType, char *Iss_KeyFile, char *PIN, char *Iss_ID, char *CRTfile, char *IccNo)56*$#7 $"##7 : Port – F>?N?#HPB D? "#M$>F "$CHMI?VFW !G@ >$GGFD!>?T!$DD$E$ L$M#? (D?LM!GHM, COM1, COM2, COM3, COM4). ReaderType – THP$H A!"P$, F>?NK%?WVHH #!L "A!#K%?#HP@. $CCHMI!%?W#"@ 4 #!L? "A!#K%?#HPHO: ˆ L.L. M$!N%$C!#HPB / ?N%?D!H ReaderType 1 Schlumberger / SCR 60 0 2 Schlumberger / Reflex 60 1 3 TOWITOKO / ChipDrive 2 4 Schlumberger / Reflex 72 3 Iss_KeyFile – F>?N?#HPB D? "#M$>F, "$CHMI?VFW LF#B ! !G@ Q?OP? " #MH#BHO EMFLL$O >PWAHO hG!#HD#? (C$ 256 "!G%$P$%). PIN – F>?N?#HPB D? "#M$>F, "$CHMI?VFW PIN–>$C >?M#K C$"#FL?. PIN– >$C G$IH# "$"#$@#B $# 4 C$ 8 CH"@#!ADKU T!QM. Iss_ID - F>?N?#HPB D? "#M$>F, "$CHMI?VFW !CHD#!Q!>?#$M (BIN) hG!#HD#? (8 CH"@#!ADKU T!QM). CRTfile – F>?N?#HPB D? "#M$>F, "$CHMI?VFW LF#B ! !G@ Q?OP? " "HM#!Q!>?#$G $#>MK#$E$ >PWA? hG!#HD#? (C$ 256 "!G%$P$%).576*$#7 $"##7 : IccNo – F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD "HM!ODKO D$GHM >?M#K C$"#FL?. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 33 J?O#$%.5*/, "8" * /#"! # : 1 – % "PFA?H F"LHSD$E$ N?%HMSHD!@ LM$EM?GGK, !D?AH $#M!T?#HPBD$H ND?AHD!H >$C? $S!J>! ("G. >$CK $S!J$> L. 4.1).9: "# ! # 1: H$JU$C!G$ "$JPWCHD!@ "#M$E$E$ "$$#%H#"#%!@ #!L? "A!#K%?#HP@ (ReaderType) " MH?PBDKG "A!#K%?#HPHG, L$C>PWAgDDKG > C?DD$GF L$"PHC$%?#HPBD$GF L$M#F. H"$JPWCHD!H h#$E$ $EM?D!AHD!@ LM!%$C!# > DHLMHC">?NFHGKG MHNFPB#?#?G. ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.2DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 7 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 8. 3.2. V < CDOpenCard."/,"# : CDOpenCard."/#"! # : ZFD>T!@ $#>MK%?H# >?M#F L$PBN$%?#HP@ ! LM$%$C!# HH ?F#HD#!Q!>?T!W. M$GH #$E$, QFD>T!@ $JH"LHA!%?H# A#HD!H C?DDKU " >?M#K L$PBN$%?#HP@.0+*, 1 ) # # 1: H$JU$C!G$ D?P!A!H >?M#K L$PBN$%?#HP@.3 #("4 : #include "CDserv.h" int CDOpenCard (char *PANcode, char *SerNo, char *USRname, char *StartDate, char *EndDate)56*$#7 $"##7 : #"F#"#%FW#576*$#7 $"##7 : PANcode – F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD PAN->$C >?M#K L$PBN$%?#HP@. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 20 J?O#$%. SerNo - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD "HM!ODKO D$GHM >?M#K L$PBN$%?#HP@. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 33 J?O#$%. USRname - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD$ !G@ L$PBN$%?#HP@. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 40 J?O#$%. StartDate - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? C?#? D?A?P? CHO"#%!@ >?M#K. Z$MG?# ŠŠ. EndDate - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? C?#? $>$DA?D!@ CHO"#%!@ >?M#K. Z$MG?# ŠŠ.5*/, "8" * /#"! # : 1 – LM! F"LHSD$G N?%HMSHD!! LM$EM?GGK, !D?AH $#M!T?#HPBD$H ND?AHD!H >$C? $S!J>! ("G. >$CK $S!J$> % L. 4.1) ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.2 3.3. V < CDGetPurseData."/,"# : CDGetPurseData."/#"! # : ZFD>T!@ LM$%HM@H# D?P!A!H >?M#K L$PBN$%?#HP@ % "A!#K%?#HPH ! $JH"LHA!%?H# L$PFAHD!H L$PD$O !DQ$MG?T!! $ %KJM?DD$G hPH>#M$DD$G >$SHPB>H >?M#K L$PBN$%?#HP@.0+*, 1 ) # # 1: H$JU$C!G$ D?P!A!H >?M#K L$PBN$%?#HP@.3 #("4 : #include " CDserv.h" int CDGetPurseData (int PurseNo, char *CurCode, char *AccountNo, char *MaxAmount, char *LastDebitDate, char *LastCreditDate, char *PurseBalance, char *OperationHistory)56*$#7 $"##7 :DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 8 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 9. PurseNo - D$GHM hPH>#M$DD$E$ >$SHPB>? >?M#K L$PBN$%?#HP@ (1, 2 !P! 3).576*$#7 $"##7 : CurCode - D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD >$C %?PW#K L$ ISO, LMHC"#?%PHDDKO % ASCII >$CH (4 J?O#?) AccountNo – F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD D$GHM "AH#? >$SHPB>?. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 20 J?O#$%. MaxAmount - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VgD L$#$P$> %KJM?DD$E$ >$SHPB>? >?M#K L$PBN$%?#HP@. ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 5 J?O#$%. OperationHistory - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? !DQ$MG?T!@ $ 4 L$"PHCD!U $LHM?T!@U " >$SHPB>$G. ?DD?@ "#M$>? "$"#$!# !N 4 "#M$> (" DFPH%KG L$"PHCD!G "!G%$P$G), >?IC?@ !N >$#$MKU "$CHMI!#: • ?#F $LHM?T!! (3 J?O#?, Q$MG?# ŠŠ); • $C >$GGHM"?D#? (4 J?O#?); • FGGF $LHM?T!! (3 J?O#?). ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 100 J?O#$%. PurseBalance - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? !DQ$MG?T!@ $ J?P?D"?U L$"PH >?IC$O !N 4 L$"PHCD!U $LHM?T!O " >$SHPB>$G. ?DD?@ "#M$>? "$"#$!# !N 4 "#M$> (" DFPH%KG L$"PHCD!G "!G%$P$G), >?IC?@ !N >$#$MKU "$CHMI!# J?P?D" >$SHPB>? (4 J?O#?). ?NGHM JFQHM? C$PIHD JK#B DH GHDHH 40 J?O#$%. LastDebitDate - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? C?#? L$"PHCDHO $LHM?T!! CHJH#$%?D!@. Z$MG?# ŠŠ. LastCreditDate - F>?N?#HPB D? JFQHM ("#M$>F), % >$#$M$G JFCH# %$N%M?VHD? C?#? L$"PHCDHO $LHM?T!! >MHC!#$%?D!@. Z$MG?# ŠŠ.5*/, "8" * /#"! # : 1 – LM! F"LHSD$G N?%HMSHD!! LM$EM?GGK, !D?AH $#M!T?#HPBD$H ND?AHD!H >$C? $S!J>! ("G. >$CK $S!J$> % L. 4.1) ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.2 3.4. V < CDChangeDates."/,"# : CDChangeDates."/#"! # : ZFD>T!@ $JH"LHA!%?H# !NGHDHD!H "M$>? CHO"#%!@ >?M#K L$PBN$%?#HP@.0+*, 1 ) # # 1: H$JU$C!G$ D?P!A!H >?M#K L$PBN$%?#HP@.3 #("4 : #include "CDserv.h" int CDChangeDates (char * NewStartDate, char * NewEndDate)56*$#7 $"##7 : NewStartDate - F>?N?#HPB D? "#M$>F, "$CHMI?VFW D$%FW C?#F D?A?P? CHO"#%!@ >?M#K. Z$MG?# ŠŠ. NewEndDate - F>?N?#HPB D? "#M$>F, "$CHMI?VFW D$%FW C?#F $>$DA?D!@ CHO"#%!@ >?M#K. Z$MG?# ŠŠ.576*$#7 $"##7 : #"F#"#%FW#DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 9 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 10. 5*/, "8" * /#"! # : 1 – LM! F"LHSD$G N?%HMSHD!! LM$EM?GGK, !D?AH $#M!T?#HPBD$H ND?AHD!H >$C? $S!J>! ("G. >$CK $S!J$> % L. 4.1) ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.2 3.5. V < CDUpdateMaxAmount."/,"# : CDUpdateMaxAmount."/#"! # : ZFD>T!@ $JH"LHA!%?H# "GHDF L$#$P>? hPH>#M$DD$E$ >$SHPB>? >?M#K L$PBN$%?#HP@.0+*, 1 ) # # 1: H$JU$C!G$ D?P!A!H SAM->?M#K.3 #("4 : #include "Cdserv.h" int CDUpdateMaxAmount (int PurseNo, unsigned long MaxAmount)56*$#7 $"##7 : PurseNo - D$GHM hPH>#M$DD$E$ >$SHPB>? >?M#K L$PBN$%?#HP@ (1, 2 !P! 3). MaxAmount - CP!DD$H THP$H, $LMHCHP@WVHH D$%$H ND?AHD!H L$#$P>? %KJM?DD$E$ >$SHPB>?576*$#7 $"##7 : #"F#"#%FW#.5*/, "8" * /#"! # : 1 – LM! F"LHSD$G N?%HMSHD!! LM$EM?GGK, !D?AH $#M!T?#HPBD$H ND?AHD!H >$C? $S!J>! ("G. >$CK $S!J$> % L. 4.1) ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.2 3.6. V < CDservClose."/,"# : CDservClose."/#"! # : ZFD>T!@ N?%HMS?H# LM$TH"" $J"PFI!%?D!@ >?M#K L$PBN$%?#HP@ ! $"%$J$IC?H# "A!#K%?#HPB smart->?M#.3 #("4 : #include "CDserv.h" void CDservClose (void)56*$#7 $"##7 : #"F#"#%FW#.5*/, "8" * /#"! # : #"F#"#%FH#. ,7/*," ;<#4= / ) *: " 7 (BC++ v.5.01) "G. L. 4.14. 4.1. 9 w s u Q B s Q g s 9G8 4*$7 ,*/, "(" 0 NOK HD$MG?PBD$H N?%HMSHD!H LM$EM?GGK. $ND!>P? $S!J>? LM!DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 10 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 11. M?J$#H " >?M#$O. 1 OK $MG?PBD$H N?%HMSHD!H LM$EM?GGK. 9H G4 *G8 :* 6" "4( " -1 ERR_PC_TIME_OUT S!J>? %KN%?D? "J$HG % M?J$#H >$GLBW#HM? -2...-7 HNHM% I ( "#+ < 7 4*$7 *H G4 #( ; %" CT-API -8 ERR_CT_API_NOT_ACC CT-API DHC$"#FLHD -10 ERR_CT_API_TRANSMIS S!J>? LHMHC?A! -11 ERR_CT_API_MEM_ASIGN S!J>? N?U%?#? L?G@#! 9H G4 , ,*/# 4"O8 ) "G*( ;<#4= 1 *$<+1 -12 ERR_FILE_NOT_FOUND S!J>? %KN%?D? $#"F#"#%!HG Q?OP? " >PWA?G! "!"#HGK -13 ERR_READING_FILE S!J>? LM! A#HD!! Q?OP? " >PWA?G! "!"#HGK -14 ERR_BAD_READER $@%PHD!H C?DD$O $S!J>! G$IH# E$%$M!#B $ "PHCFWVHG: • $#"F#"#%FH# "A!#K%?#HPB, !P! • #!L "A!#K%?#HP@ F>?N?D DHLM?%!PBD$, !P! • $S!J>? LM! M?J$#H "A!#K%?#HP@, !P! • F>?N?D DH%HMDKO -L$M#. -15 ERR_NO_CARD_ON_READER S!J>? %KN%?D? $#"F#"#%!HG >?M#K % "A!#K%?#HPH -16 ERR_BAD_ACCESS_CARD S!J>? LM! M?J$#H " >?M#$O C$"#FL?, %$NG$ID$, %"#?%PHD? DH >?M#? C$"#FL?, ? !D?@. -17 ERR_INVALID_PIN_LEN HLM?%!PBD?@ CP!D? PIN->$C? -18 ERR_INVALID_PIN_CHR M! %%$CH PIN->$C? JKP! !"L$PBN$%?DK DH #$PB>$ CH"@#!ADKH T!QMK -19 ERR_BAD_PIN_VERIFY PIN->$C DH %HM!Q!T!M$%?D -20 ERR_BAD_PASSWORD H%HMDKO L?M$PB C$"#FL? > "H>MH#DKG >PWA?G "!"#HGK -21 ERR_BAD_SAM_CARD S!J>? LM! M?J$#H " SAM >?M#$O, %$NG$ID$, %"#?%PHD? DH SAM >?M#?, ? !D?@. -22 ERR_BAD_USR_CARD S!J>? LM! M?J$#H " >?M#$O L$PBN$%?#HP@, %$NG$ID$, %"#?%PHD? DH >?M#? L$PBN$%?#HP@, ? !D?@.DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 11 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 12. -23 ERR_INV_REC_LEN HLM?%!PBD?@ CP!D? N?L!"! -24 ERR_DNOT_FOUND_KEY #"F#"#%FH# >PWA -25 ERR_APP_NOT_FOUND #"F#"#%FH# LM!P$IHD!H -26 ERR_READ_CARD_FILE S!J>? A#HD!@ Q?OP? D? >?M#H -27 ERR_IDENT_NOT_FOUND ? >?M#H $#"F#"#%FH# Q?OP 8000 -28 ERR_BAD_ISS_CERT H%HMDKO "HM#!Q!>?# $#>MK#$E$ >PWA? hG!#HD#? -29 ERR_BAD_ISS_IDEND H%HMDKO hG!#HD# -30 ERR_AUTH_NOT_FOUND ? >?M#H $#"F#"#%FH# Q?OP 8300 -31 ERR_UNKNOWN_AUTH_ALG H!N%H"#DKO ?PE$M!#G ?F#HD#!Q!>?T!! -32 ERR_SN_NOT_FOUND ? >?M#H $#"F#"#%FH# Q?OP 2F00 -33 ERR_SAM_NOT_FOUND #"F#"#%FH# SAM->?M#? -34 ERR_USR_NOT_FOUND #"F#"#%FH# >?M#? L$PBN$%?#HP@ -35 ERR_USR_PURS_NOTFOUND ? >?M#H L$PBN$%?#HP@ $#"F#"#%FH# Q?OP " >$SHPB>$G -36 ERR_SAM_PURS_NOTFOUND ? SAM->?M#H $#"F#"#%FH# Q?OP " >$SHPB>$G -37 ERR_USR_IS_BAD « ?L$MAHD?» >?M#? L$PBN$%?#HP@ – L$CPHI!# !NŒ@#!W -38 ERR_SAM_IS_BAD « ?L$MAHD?» SAM->?M#? – L$CPHI!# !NŒ@#!W -39 ERR_USR_CUR_NOT_MATCH M! %KN$%H QFD>T!! F>?N?D DH%HMDKO #!L %?PW#K % >$SHPB>H >?M#K L$PBN$%?#HP@ -40 ERR_SAM_CUR_NOT_MATCH M! %KN$%H QFD>T!! F>?N?D DH%HMDKO #!L %?PW#K % >$SHPB>H SAM->?M#K -41 ERR_READ_USR_CARD S!J>? LM! A#HD!! >?M#K L$PBN$%?#HP@ -42 ERR_READ_SAM_CARD S!J>? LM! A#HD!! SAM->?M#K -43 ERR_USR_DEBIT_PURSE S!J>? LM! CHJH#$%?D!! >$SHPB>? >?M#K L$PBN$%?#HP@ -44 ERR_USR_CREDIT_PURSE S!J>? LM! >MHC!#$%?D!! >$SHPB>? >?M#K L$PBN$%?#HP@ -45 ERR_SAM_DEBIT_PURSE S!J>? LM! CHJH#$%?D!! >$SHPB>? SAM->?M#K -46 ERR_INV_ID_LEN H%HMD?@ CP!D? !CHD#!Q!>?#$M?-47...-50 HNHM% 9H G4 , ,*/# 4"O8 ) "G*( G G+ *( 4*% mirlib ( "G*(" G*+-H ! +" ) -51 ERR_BASE_TOO_BIG "D$%?D!H A!"P? $AHDB J$PBS$H CP@ LMHC"#?%PHD!@ -52 ERR_DIV_BY_ZERO HPHD!H D? D$PB (% J!JP!$#H>HDSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 12 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 13. J$PBS!U A!"HP) -53 ERR_OVERFLOW HMHL$PDHD!H – A!"P$ $AHDB J$PBS$H -54 ERR_NEG_RESULT M! %KA!"PHD!! L$PFAHD$ $#M!T?#HPBD$H ND?AHD!H -55 ERR_BAD_FORMAT H%HMDKO %U$CD$O Q$MG?# A!"P? -56 ERR_BAD_BASE H%HMD$H $"D$%?D!H A!"P? -57 ERR_BAD_PARAMETERS H%HMD$H !"L$PBN$%?D!H L?M?GH#M? -58 ERR_OUT_OF_MEMORY HC$"#?#$AD$ $LHM?#!%D$O L?G@#! -59 ERR_NEG_ROOT H#DKO >$MHDB !N $#M!T?#HPBD$E$ A!"P? -60 ERR_NEG_POWER $N%HCHD!H A!"P? % $#M!T?#HPBDFW "#HLHDB -61 ERR_BAD_ROOT $LK#>? L$PFA!#B DH%HMDKO >$MHDB -62 ERR_INT_OP H%HMD?@ $LHM?T!@ D?C Flash A!"P$G -63 ERR_FLASH_OVERFLOW Flash LHMHL$PDHD!H -64 ERR_TOO_BIG !"P? $AHDB J$PBS!H -65 ERR_NEG_LOG $E?M!QG !N $#M!T?#HPBD$E$ A!"P? -66 ERR_DOUBLE_FAIL S!J>? LMH$JM?N$%?D!@ double % flash -67 ERR_IO_OVERFLOW HMHL$PDHD!H JFQHM? %%$C?/%K%$C? -68 ERR_NO_MIRSYS !JP!$#H>? J$PBS!U A!"HP DH LM$!D!T!?P!N!M$%?D? -69 ERR_BAD_MONT_MOD H%HMDKO $D#E$GHM! G$CFPB (C$PIHD JK#B DHAH#DKG) -70 ERR_NO_MONT_MOD H $LMHCHPHD $D#E$GHM! G$CFPB -71 ERR_EXP_TOO_BIG P!S>$G J$PBS?@ h>"L$DHD#? -72 ERR_NBASE_MBP_P2 "D$%?D!H C$PID$ JK#B "#HLHDBW 2-73...–80 HNHM% -81 ERR_KEYFILE_NOT_FOUND #"F#"#%FH# Q?OP " >PWA?G! ] /] -82 ERR_READING_KEYFILE S!J>? A#HD!@ Q?OP? >PWAHO -83 ERR_PARFILE_NOT_FOUND #"F#"#%FH# Q?OP " L?M?GH#M?G! sPRPERS.PAR -84 ERR_BAD_NUM_OF_PARAM S!J$AD$H A!"P$ L?M?GH#M$% % Q?OPH sPRPERS.PAR -85 ERR_BAD_PARAM_FMT H%HMDKH ND?AHD!@ L?M?GH#M$% % Q?OPH sPRPERS.PAR -86 ERR_BAD_CA_ID_FMT H%HMD$H ND?AHD!H !CHD#!Q!>?#$M? ] -87 ERR_BAD_ISS_ID_FMT H%HMD$H ND?AHD!H !CHD#!Q!>?#$M? hG!#HD#? -88 ERR_CRTFILE_NOT_FOUND #"F#"#%FH# Q?OP " "HM#!Q!>?#$G $#>MK#$E$ >PWA? hG!#HD#? -89 ERR_CRT_ISS_NOT_CMP CHD#!Q!>?#$M hG!#HD#? DHDSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 13 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 14. "$%L?C?H# " F>?N?DDKG % "HM#!Q!>?#H -90 ERR_CRT_DATE_EXPIRED "#H> "M$> CHO"#%!@ "HM#!Q!>?#? -91 ERR_CRT_CA_NOT_CMP CHD#!Q!>?#$M hG!#HD#? DH "$%L?C?H# " F>?N?DDKG % "HM#!Q!>?#H -92 ERR_CRT_LEN H%HMD?@ CP!D? "HM#!Q!>?#? -93 ERR_BAD_PUBLIC_LEN H%HMD?@ CP!D? $#>MK#$E$ >PWA? ] -94 ERR_BAD_AUTH_OF_CARD S!J>? ?F#HD#!Q!>?T!! -95 ERR_INV_LUHN_CODE HLM?%!PBD$H ND?AHD!H luhn->$C? -96 ERR_NOT_FREE_MEM HC$"#?#$AD$ "%$J$CD$E$ GH"#? -97 ERR_TRANS_KEY_VERIFY S!J>? %HM!Q!>?T!! #M?D"L$M#D$E$ >PWA? -98 ERR_CREATE_CARDFILE S!J>? LM! "$NC?D!! Q?OP? D? >?M#H -99 ERR_WRITE_CARD_FILE S!J>? N?L!"! Q?OP? D? >?M#F -100 ERR_BAD_IDENT_CONTENT H%HMD$H "$CHMI!G$H Q?OP? 8000 D? >?M#H -101 ERR_PERFILE_NOT_FOUND #"F#"#%FH# PER-Q?OP -102 ERR_SERNO_DONT_COMPAR H "$%L?C?H# MH?PBDKO "HM!ODKO D$GHM >?M#K ! D$GHM, F>?N?DDKO % PER-Q?OPH -103 ERR_BAD_START_DATE H%HMD?@ C?#? D?A?P? CHO"#%!@ SAM- >?M#K -104 ERR_BAD_END_DATE H%HMD?@ C?#? $>$DA?D!@ CHO"#%!@ SAM->?M#K -105 ERR_DATES_CONFLICT ?#? $>$DA?D!@ CHO"#%!@ SAM->?M#K LMH%KS?H# C?#F $>$DA?D!@ CHO"#%!@ "HM#!Q!>?#? $#>MK#$E$ >PWA? hG!#HD#? -106 ERR_PURSE_NOT_EMPTY $SHPH> DH LF"#$O -107 ERR_KEY_VERIFICATION S!J>? %HM!Q!>?T!! >PWA? -108 ERR_UPDATE_CARD_FILE S!J>? LHMHN?L!"! Q?OP? D? >?M#H -109 ERR_CHANGE_KEY S!J>? !NGHDHD!@ >PWA? -110 ERR_DEBIT_AMT_GRATE FGG? CHJH#? LMH%KS?H# $"#?#$> >$SHPB>? SAM->?M#K -111 ERR_CREDIT_AMT_GRATE HNFPB#?# "P$IHD!@ $"#?#>? >$SHPB>? ! "FGGK "MHC!#? LMH%KS?H# L$#$P$> >$SHPB>? SAM- >?M#K -112 ERR_UNBLOCK_KEY S!J>? CHJP$>!M$%?D!@ >PWA? -113 ERR_MAX_AMNT_LES_PURS $%$H ND?AHD!H L$#$P>? >$SHPB>? SAM->?M#K GHDBSH #H>FVHE$ $"#?#>? % >$SHPB>H -114 ERR_UPDATE_MAX_AMOUNT S!J>? "GHDK L$#$P>? >$SHPB>? SAM->?M#K -123 ERR_NOT_INITIALIZED H JKP? %KL$PDHD? !D!T!?P!N?T!@DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 14 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 15. -124 ERR_UNKNOWN_ERROR H!N%H"#D?@ $S!J>? -125 ERR_FUNC_NOT_RELEASED -126 ERR_USR_ABORT ?J$#? LM$EM?GGK $"#?D$%PHD? L$PBN$%?#HPHG /* Rest of CT-API */ -127 ERR_CT_API_ABORT ?J$#? LM$EM?GGK $"#?D$%PHD? "HM%HM$G -128 ERR_CT_API_HTSI S!J>? D!IDHE$ FM$%D@ 4.2. : t < g : (Borland C++ v.5.01)//----------------------------------------------------------------------------//// BC++ built 32-bit DLLs (Example of CDserv.DLL call).//// Copyright (c) Dekart Ltd. All Rights Reserved//// This application tests calling into a 32-bit DLL built with Borland C++.// Code was verified with Borland C++ 5.02////----------------------------------------------------------------------------//#include <mfc/afxwin.h> // For GetDlgItemText() + windows.h#include <windows.h>#include <stdio.h> // stdio.h#include "CDserv.h" // functions from CDserv.dll#include <stdlib.h>#include <sys/stat.h>#include <io.h>#include <conio.h>#include <dir.h>#include <fstream.h>#include <string.h>//// Declaration of DLL - functions//int ( __stdcall *pCDservIni)(char *Port, short ReaderType, char *Iss_KeyFile, char *PIN, char *Iss_ID, char *CRTfile, char *IccNo);int ( __stdcall *pCDOpenCard)(char *PANcode, char *SerNo, char *USRname, char *StartDate, char *EndDate);int ( __stdcall *pCDGetPurseData)(int PurseNo, char *CurCode, char *AccountNo, char *MaxAmount, char *LastDebitDate, char *LastCreditDate, char *PurseBalance, char *OperationHistory);int ( __stdcall *pCDUpdateMaxAmount)(int PurseNo, unsigned long MaxAmount);int ( __stdcall *pCDChangeDates)(char *NewStartDate, char *NewEndDate);void ( __stdcall *pCDservClose)(void);char xDll[] = "CDserv.dll";///////////////////////////////////////////////////////////////////////////////int main(){//// Declaration & Initial Values of variables// int status, purse, i, j; char cardnum[33]=" "; char port[20]=" ", pan_code[20]=" " ; char cardpin[32]=" ", name[40]=" ", curs[4]=" ", acc_no[20]=" ";DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 15 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 16. char iss_id[10]=" ", max_sum[5]=" "; char date_d[7]=" ", date_c[7]=" ", date_s[7]=" ", date_e[7]=" "; char history[256]=" ", balance[256], hist[4][64]; short reader; char iss_key_file[MAX_PATH], iss_crt_file[MAX_PATH]; long int sum_c, sum_d;//// Load the Dynamic Link LIbrary xcdata.DLL// HINSTANCE hLib = LoadLibrary(xDll); if ( (unsigned)hLib <= HINSTANCE_ERROR ) { printf("Failure loading library: %sn", xDll); return 0; }//// Get all the entry points for the functions we wish to test. Typedefs can// be used to simplify casting the retrun value from GetProcAddress.//pCDservIni = (int ( __stdcall* )(char *Port, short ReaderType, char *Iss_KeyFile, char *PIN, char *Iss_ID, char *CRTfile, char *IccNo))GetProcAddress(hLib, "CDservIni");pCDOpenCard = (int ( __stdcall* )(char *PANcode, char *SerNo, char *USRname, char *StartDate, char *EndDate))GetProcAddress(hLib, "CDOpenCard");pCDGetPurseData = (int ( __stdcall* )(int PurseNo, char *CurCode, char *AccountNo, char *MaxAmount, char *LastDebitDate, char *LastCreditDate, char *PurseBalance, char*OperationHistory))GetProcAddress(hLib, "CDGetPurseData");pCDUpdateMaxAmount= (int ( __stdcall* )(int PurseNo, unsigned longMaxAmount))GetProcAddress(hLib, "CDUpdateMaxAmount");pCDChangeDates = (int ( __stdcall* )(char *NewStartDate, char*NewEndDate))GetProcAddress(hLib, "CDChangeDates");pCDservClose = (void ( __stdcall* )(void))GetProcAddress(hLib, "CDservClose");//// GetProcAddress returns null on failure// if( pCDservIni == NULL) { printf("1 - Failure locating procedures.n"); return 0; } if (pCDservIni == NULL) { printf("2 - Failure locating procedures.n"); return 0; } if( pCDGetPurseData == NULL) { printf("3 - Failure locating procedures.n"); return 0; } if( pCDUpdateMaxAmount == NULL) { printf("4 - Failure locating procedures.n"); return 0; } if( pCDChangeDates == NULL) { printf("5 - Failure locating procedures.n"); return 0; } if( pCDservClose == NULL) { printf("6 - Failure locating procedures.n"); return 0; }//// Load INI parametersDSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 16 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 17. //// port - name of com-port connected to reader// reader - reader type// cardpin - PIN-code to access card (issuer)// iss_id - issuer identifier// iss_key_file - name of file with keys of issuer// iss_crt_file - name of file with issuer certificate// per_file_path - path to file with parameters reader=0; strcpy(iss_key_file,".94980001.SE3"); strcpy(iss_crt_file,".94980001.CRT"); strcpy(port,"COM2"); strcpy(cardpin,"1111"); strcpy(iss_id,"94980001");/*printf("n %s n %s n %s n %s n %s n %s ",iss_key_file, per_file_path, iss_crt_file, port, cardpin, iss_id); *///// Test of CDserv// printf("n Test of CDserv");// CDserv operation printf("nn Session initialization"); printf("n Insert Acces Card of issuer in Reader"); getch(); status = pCDservIni(port, reader, iss_key_file, cardpin, iss_id, iss_crt_file, cardnum); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else {printf("n status: %d ", status); printf("n IssNo: %s ", cardnum); // printing of card serial number }// CD card open printf("nn User card openning"); printf("n Insert User Card in Reader"); getch(); status = pCDOpenCard(pan_code, cardnum, name, date_s, date_e); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else {printf("n status: %d ", status); printf("n User_No: %s ", cardnum); // printing of user card serial number printf("n PAN: %s ", pan_code); // printing of user card PAN code printf("n Name: %s ", name); // printing of name printf("n Start date: %s ", date_s); // printing of start date printf("n End date: %s ", date_s); // printing of start date }// user card reading #1 printf("nn User card reading"); for(purse=1; purse<4; purse++) { printf("nn Purse %d", purse); status = pCDGetPurseData(purse, curs, acc_no, max_sum, date_d, date_c, balance, history); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else {printf("n status: %d ", status); printf("n cur_code: %s ", curs); // printing of cur_code printf("n Account: %s ", acc_no); // printing of account_number printf("n MaxAmount: %s ", max_sum); // printing of MaxAmount printf("n Last debit date: %s ", date_d); // printing of debit date printf("n Last credit date: %s ", date_c); // printing of credit date printf("n Purse balances: n"); // printing of balance history j=0; //printf("n"); for(i=0; i<256; i++) { if(balance[i]!=0) printf("%c", balance[i]); else {if(j>3) break; printf("n"); j++;} } printf("n Purse history: n"); // printing of operations history j=0; //printf("n"); for(i=0; i<256; i++) { if(history[i]!=0) printf("%c", history[i]); else {if(j>3) break; printf("n"); j++;} }DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 17 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .
  • 18. } printf("n ...."); getch(); }// UpdateMaxAmount operation printf("nn UpdateMaxAmount operation"); sum_c=20000; for(purse=1; purse<4; purse++) { printf("n Purse %d", purse); status = pCDUpdateMaxAmount(purse, sum_c); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else printf("n status: %d ", status); // printing of result sum_c-=5000; }// user card reading #2 printf("nn User card reading after UpdateMaxAmount operation"); for(purse=1; purse<4; purse++) { printf("nn Purse %d", purse); status = pCDGetPurseData(purse, curs, acc_no, max_sum, date_d, date_c, balance, history); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else {printf("n Status: %d ", status); printf("n Cur_code: %s ", curs); // printing of cur_code printf("n Account: %s ", acc_no); // printing of account_number printf("n MaxAmount: %s ", max_sum); // printing of MaxAmount printf("n Last debit date: %s ", date_d); // printing of debit date printf("n Last credit date: %s ", date_c); // printing of credit date printf("n Purse balance: %s ", balance); // printing of balance printf("n last Purse Operation: %s ", history); // printing of history } printf("n ...."); getch(); }// Dates change printf("nn User card Dates change"); strcpy(date_s,"160201"); strcpy(date_e,"160204"); status = pCDChangeDates(date_s, date_e); if(status<0) {printf("n error: %d ", status); return 0;} // status printing else printf("n status: %d ", status);// pCDservClose operation printf("nn Session closing"); pCDservClose(); printf("n"); if((unsigned)hLib>HINSTANCE_ERROR) FreeLibrary(hLib); cout << endl <<"done." <<endl; return 0;}DSSSCT File : cdserv.doc Ref : CDSERVPG0000 Revision:2.0 18 / 18 Copyright © Dekart S.R.L (www.dekart.com) - 2001 This document shall not be disclosed to a third party without prior written consent of Dekart S.R.L. !>?>?@ A?"#B C?DD$E$ C$>FGHD#? DH G$IH# JK#B %$"LM$!N%HCHD? % >?>$O JK #$ D! JKP$ Q$MGH ! >?>!G! JK, #$ D! JKP$ "MHC"#%?G! JHN L!"BGHDD$E$ M?NMHSHD!@ %P?CHPBT? ?%#$M">!U LM?%. 9 : .

×