You are on page 1of 167

2549

ISBN 974-11-6256-1

DEVELOPMENT OF EMPLOYMENT CERTIFICATE SERVICE
USING SMART CARD

By
Noppadon Phumeechanya

A Masters Report Submitted in Partial Fulfillment of the Requirements for the Degree
MASTER OF SCIENCE
Department of Computing
Graduate School
SILPAKORN UNIVERSITY
2006
ISBN 974-11-6256-1


..................
( . )

. ....... .....

.
( . )
..../.../.

.
( . )
..../.../.

.
( . )
..../.../.
K 46307307 :
: / /
:
(DEVELOPMENT OF EMPLOYMENT CERTIFICATE SERVICE USING SMART
CARD ) : . . . 151 . ISBN 974-11-6256-1



(Java Card Applet)



PIN

(Digital Certificate)



Java Card

(NECTEC)


_________________________________________________________________________________
2549
...............................................................
.......................................................


K 46307307: MAJOR: COMPUTER SCIENCE
KEY WORD: SMART CARD/AUTHENTICATION/ENCRYPTION
NOPPADON PHUMEECHANYA : DEVELOPMENT OF EMPLOYMENT
CERTIFICATE SERVICE USING SMART CARD . MASTERS REPORT ADVISOR:
ASST.PROF. PANJAI TANTATSANAWONG, Ph.D. 151 pp. ISBN 974-11-6256-1

This research aimed to develop an employment certificate service using smart card. The
development consists of two parts. The first part is java card applet for storing employee data and
security data, and the second part is host application for employee card registration and
employment certificate printing services.
There are two parts of the security system: personal authentication and data encryption.
The personal authentication consists of personal identification number (PIN) and digital
certificate. The data encryption is used for communicating between smart card and host
application using key exchange method which based on the public key infrastructure (PKI).
This development used java programmable smart cards (Java Card), and designed
database system by referring employee database from National Electronics and Computer
Technology Center (NECTEC).
The results of development provided the high security employee cards, the employee
card registration system and employment certificate printing services.

Department of Computing Graduate School, Silpakorn University Academic Year 2006


Students signature .................................................
Masters Report Advisors signature .................................................


.
.

. . .





...............................................................................................................
..........................................................................................................
................................................................................................................
.......................................................................................................................
.........................................................................................................................

1 ........................................................................................................................ 1
.......................................................... 1
............................................................................................ 3
................................................................................ 3
.............................................................................................. 3
............................................................................................... 4
............................................................................. 4
2 ................................................................................... 6
...................................................... 6
........................................................................................... 6
............................................................................ 8
.................................................................. 10
............................................... 10
..................................................... 10
......................................................... 11
(Java Card Technology ) ................................... 12
Global Platform .................................................................................... 16
PC/SC (Personal Computer/Smart Card) .............................................. 16
...................... 17
(Cryptography) ....................................................... 17
Certification Authority (CA) .................... 19
(Digital Certificate) ...................................... 19


PIN (Authentication by PIN) ......................... 20

(Digital Signature) ................................................................... 20
Secure Socket Layer (SSL) .................................................................. 22
Web Services .................................................................................................. 23
................................................... 23
......................... 23
............................. 23
.......................................... 26
3 ................................................................................................ 28
................................................................................... 28
......................................................................................... 29
...................................................................... 30
...................................................................... 30
Java Card Applet ...................................................................... 31
........................................................ 31
Java Card Applet ..................................................... 32
Command APDU ........................................................... 32
...................................................... 34

(CA Web Services) ..................................................................... 35
CA Web Services ............................................... 35
CA Web Services ...................... 36
Host Application ...................................................................... 37
............................................................... 37
................................................. 40
................................................................... 41
................................................... 41
................................................. 42


(Key Exchange).......... 44
........................................................ 46
................................................................... 49
4 ................................................................................................. 51
(Java Card Applet) .................. 51
PIN ................................................................................ 52
PIN .............................................................................. 52
PIN .............................................................................. 52
( Private Key , Public Key ) ..................................... 53
Public Key ................................................ 53
(Sign) .................................................. 54
Secret Key Private Key ........................................... 54
............................ 55
........................... 55
.................................................... 56
.................................................... 56
.............................................. 57
............................................. 57
Host Application ..................... 58
(Digital Certificate) ............................. 58
(Key Exchange) ............... 59
Host Application ....................... 61
.................................. 63
..................... 63
Host Application ............................................................................ 64
....................................... 64
................................................................ 72
........................................................................................ 76
......................................... 77


5 ...................................................................................................... 78
....................................................................... 78
......................................................................................... 79
................................................................................................... 79
................................................................................................................... 80
................................................................................................................... 83
........................................................... 84
................................................. 106
................................................................................................................... 151




1 Command APDU ...................................................... 32
2 ........................................................ 34
3 Card ........................................................................................... 46
4 Employee ................................................................................... 46
5 Positions .................................................................................... 47
6 Division .................................................................................... 47
7 Education .................................................................................. 48
8 Service ....................................................................................... 48
9 IBM JCOP SLE4428 .. 77
10 Class OfficialCard ...................................................................... 107
11 Class CardApplet ........................................................................ 109
12 Class CardInfo ............................................................................ 110
13 Class Init ..................................................................................... 111
14 Class InsertDataToDB ................................................................ 112
15 Class MainReg ........................................................................... 112
16 Class Module .............................................................................. 112
17 Class MyUtil .............................................................................. 113
18 Class ShowDatainCard .............................................................. 114
19 Class Tab .................................................................................... 115
20 Class Terminal ............................................................................ 115
21 Class TestCard .......................................................................... 115
22 Class UpdateDatainCard ............................................................ 116
23 Class UseService ........................................................................ 117
24 Class Intro .................................................................................. 137
25 Class Keyboard .......................................................................... 137
26 Class MainClassKiosk ................................................................ 138
27 Class OfficialInfo ....................................................................... 139
28 Class PrintInfo ............................................................................ 139


29 Class Service .............................................................................. 139




1 ..................................................................... 7
2 (Contact Cards) ....................................................... 8
3 (Contactless smart cards) RF Cards) ....... 9
4 (Combi card) ............................................................. 9
5 ............................................................... 10
6 Command APDU ................................................................................................... 11
7 Response APDU ..................................................................................................... 12
8 ...................................................................... 14
9 Java Card Application .............................................................. 15
10 (Symmetric-key cryptography)............................. 17
11 (Asymmetric-key cryptography or Public Key
Technology) .................................................................................................... 18
12 (Digital Signature) ..................................... 21
13 SSL ...................... 22
14 .................................................................. 24
15 ......................................................................................... 25
16 Warranty Plus Card ........................................................................... 26
17 ................................................................................. 29
18 Flow chart ........................................................ 37
19 (Certificate Request) ............................................ 38
20 ....................................................... 39
21 Flow chart ................. 40
22 PIN ....................................................................... 42
23 ................. 43
24 (Key exchange) ........................... 45
25 ER Diagram ..................................... 49
26 Public Key ........................................... 54
27 .................................. 59


28 Secret Key ............................................. 60
29
Host Application ............................................................................................. 62
30 .................. 64
31 .......................................................... 65
32 ........................................ 66
33 ......................... 67
34 ............................. 68
35 ................................... 69
36 ............................. 70
37 ................................ 70
38 .......................................................... 71
39 ............................................... 72
40 ........................ 72
41 PIN ......................................................................... 73
42 ................................................................................................ 74
43 PIN .............................................................................. 74
44 ..................................................... 75
45 .................................................... 75
46 ...................................................... 76
47 ....................................... 87
48 PIN ................................................................................................ 88
49 ................................................... 88
50 .............................................................................................. 89
51 ................................................................. 89
52 ............................................................................................ 89
53 ................................................ 90
54 ........................................................ 90



55 ......................................................................... 91
56 Public Key .................................................................................................. 92
57 Key ...................... 92
58 ............................................... 93
59 .............................................................................................. 94
60 ......................................................................................... 94
61 .................................................................................. 94
62 ................................................................ 95
63 .................................................................. 96
64 ..................................................................... 97
65 ....................................................... 97
66 ......................................................................... 98
67 Root Certificate CA ......................................................................... 100
68 Root Certificate ........................................................................... 100
69 ..................................................................................... 101
70 PIN ................................................................................................ 101
71 ....................... 102
72 ................................................................................................ 103
73 PIN .............................................................................. 104
74 ................................................................ 104
75 UML Class CardApplet ................................................................................. 118
76 UML Class CardInfo ..................................................................................... 119
77 UML Class Init .............................................................................................. 120
78 UML Class InsertDataToDB ......................................................................... 122
79 UML Class MainReg ..................................................................................... 124
80 UML Class Module ....................................................................................... 125
81 UML Class MyUtil ........................................................................................ 126
82 UML Class ShowDatainCard ........................................................................ 128
83 UML Class Tab ............................................................................................. 130


84 UML Class Terminal ..................................................................................... 131
85 UML Class TestCard ..................................................................................... 132
86 UML Class UpdateDatainCard ...................................................................... 134
87 UML Class UseService ................................................................................. 136
88 UML Class Intro ............................................................................................ 140
89 UML Class Keyboard .................................................................................... 141
90 UML Class MainClassKiosk ......................................................................... 142
91 UML Class OfficialInfo ................................................................................. 144
92 UML Class PrintInfo .................................................................................... 145
93 UML Class Service ........................................................................................ 146




CPU

( Key )

1. (Confidentiality)

2. (Integrity)

1
2

3. (Availability)

4. (Non Repudiation)

(Java Card)
(Open Source)






1.
(Open Source)
2.
( Write Once , Run Anywhere)




(Kiosk)


PIN

(Digital Certificate)

1.

2.
( Kiosk )

1.
(Java Card Applet )
2.
( Host Application )
3.
4.
(Kiosk)

1.
( NECTEC )
2.

3. (Java Card Applet)



4.

5. PIN
( Digital Certificate )
6.
( Kiosk )

1.
2. ( Java Card
Technology)

3. (Java Card Applet)

4.

5.
(Kiosk)
6.
7.
8.
9.
10.

1.
2
1.1
1.2
PIN
2.

3.
PIN

4.

2

2.1
2.1.1
Joint
Technical Committee 1 (JTC1) (International Standards
Organization (ISO)) ( International Electronic
Committee (IEC)) ISO/IEC 7816
.. 1987 .. 2003


(C. Enrique Ortiz 2003)

1

6
7





RSA , DES Triple DES


1. (SIM
Card)
2.

3.

4.

5.

6.

8

2.1.2

2.1.2.1 (Contact Cards)

(Smart Card Reader)

2 (Contact Cards)
: Alpha Card Systems, Smart Cards [Online] , accessed 15 December 2005. Available from
http://www.alphacard.com/id-cards/smart-cards.shtml

2.1.2.2 (Contactless smart cards)


3

2
Radio Frequency ID (RFID)


(Transactions)

9

3 (Contactless smart cards)


: Alpha Card Systems, RFID Cards - Contactless Smart Cards [Online] , accessed 15
December 2005. Available from http://www.alphacard.com/id-cards/rfid-cards.shtml

2.1.2.3 (Combi card)




4

4 (Combi card)
: Alpha Card Systems, RFID Cards - Contactless Smart Cards [Online] , accessed 15
December 2005. Available from http://www.alphacard.com/id-cards/rfid-cards.shtml
10

2.1.3
8 ( Uwe Hansmann et al 2000 : 19)
5

- Vcc
- RST

- CLK (Clock)
- GND
- Vpp
- I/O
- RFU

2.1.4 (Smart Card CPU)


8 bit 16
bit 5 MHz

2.1.5
3 1. ROM
2. EEPROM
3. RAM
11

2.1.6



APDU (Application Protocol Data Units) ( Zhiqun Chen 2000 : 18 )
APDU (Application Protocol Data Units)
2
1. Command APDU
(Header) (Body) 6

Command APDU
Header (required) Body (optional)
Data
CLA INS P1 P2 Lc Le
Field

6 Command APDU

- CLA (1 byte)
- INS (1 byte )

- P1 (1 byte) P2 (1 byte )

- Lc (1 byte)
- Data field
- Le (1 byte)
Response APDU
12

2. Response APDU
Command APDU 7

Response APDU
Body (optional) Trailer (required)
Data Field SW1 SW2

7 Response APDU

- Data field
- SW1 (1 byte) SW2 (1 byte)
APDU

2.1.7 (Java Card Technology )


( Zhiqun Chen 2000 : 27 )

(Sun Microsystems, Inc. )
Java
Card Applet
(CPU) 8 16
3.7 MHz (RAM) 1 K byte
(EEPROM) 16 K byte

Java Card
1. Java Card
(Applet)

2. Java Card
PIN Code
13

3.
(Applet )
4.

2.1.7.1 Java Card Applet


Java Card Applet

Java Card Applet Applet


(Java Card API) install()
process() install() Applet
process() APDU
Java Card Applet
Applet APDU
Java Card Applet
14

2.1.7.2
(C. Enrique Ortiz
2003) 8

8
: C. Enrique Ortiz , An Introduction to Java Card Technology [Online], accessed 1
December 2005. Available from http://developers.sun.com/techtopics/mobility/javacard/articles
/javacard1/


Java Card Virtual Machine
Java Card Framework and APIs
Application Programming Interface (API)
Vendor and/or Industry Specific Extensions

Applet

Applet Applet
15

2.1.7.3

9

9 Java Card Application


: C. Enrique Ortiz , An Introduction to Java Card Technology [Online], accessed 1
December 2005. Available from http://developers.sun.com/techtopics/mobility/javacard/articles
/javacard1/

Java Card Application (C. Enrique


Ortiz 2003)
1. Back-End Application and Systems

Applets Back-end application

2. Reader-Side Host Application


Host Application
(Terminal)
16

Host Application
Java Card applet Back-End Application
3. Reader-Side Card Acceptance Device
Card Acceptance Device (CAD) host
application Java Card CAD CAD

Terminal .
CAD Application Protocol Data Unit (APDU) Host Application
Host Application
4. Card-Side Applets and Environment
Java Card Java Card
Applet Java Card Runtime Environment (JCRE)
Java Card Applet Java Card Runtime Environment (JCRE)
Java Card VM , Java Card Framework and APIs API

2.1.8 Global Platform



Visa International Service Association (VISA)
Open Platform
(Terminal)
Global Platform ( GlobalPlatform 2006 )

2.1.9 PC/SC (Personal Computer/Smart Card)


PC/SC
Windows
( PC/SC workgroup
2006)
17

2.2
2.2.1 (Cryptography)
(Cryptography) ( 2547 )

(Key)

(Encryption)
(Decryption)
2
(Symmetric-key cryptography)
(Asymmetric-key cryptography or Public Key Technology)

2.2.1.1 (Symmetric-key cryptography)




(Secret Key) 10

Hello @%$*& Hello

Mr. A Mr. B

Secret Key Secret Key

10 (Symmetric-key cryptography)
18

Data Encryption Standard


(DES)
Data Encryption Standard (DES)
National Institute of Standards
and Technology ( NIST )
(National Institute of Standards and Technology 1993)
DES IBM (International Business Machines
Corporation) Lucifer
(Block Algorithm) DES
Lucifer 16 56

2.2.1.2 (Asymmetric-key cryptography


or Public Key Technology)

(Private Key) (Public Key)

11

Hello @%$*& Hello

Mr. A Mr. B

Mr.As Private Key Mr.As Public Key

- Mr.As Private Key - Mr.As Public Key


- Mr.As Public Key

11 (Asymmetric-key cryptography or Public Key


Technology)
19

Rivest-Shamir-Adelman
Encryption (RSA)
Rivest-Shamir-Adelman Encryption (RSA)
(Ron Rivest)
(Adi Shamir) (Leonard Adleman) .. 1978
Public Key (Whitfield Diffie) (Martin Hellman)
RSA

(Prime Number) 1024
(Encryption ) (Digital
Signature) (R.L. Rivest, A. Shamir, and L. Adlemman 1978 : 120-126)
RSA

2.2.2 Certification Authority (CA)




(Public Key
Infrastructure - PKI) (Private Key)
(Public Key)

2.2.3 (Digital Certificate)




X.509
( 2547)
1. (Serial Number)
2. (Algorithm)
3. (Issuer)
20

4. (Starting Time)
(Expiring Time)
5. (Subject)
, e-mail Address
6. (Subject ' s Public Key)
7. (CA Signature)

2.2.4 PIN (Authentication by PIN)


PIN (Personal Identification Number)
PIN ATM
( , 2547 )

2.2.5 (Digital Signature)




(Private Key)
(Public Key)
12 ( () 2549 )
21

- Mr.As Private Key - Mr.As Public Key


- Mr.As Public Key

Mr. A Mr. B

Message Message Message Hash

Signature Signature

Hash
Digest
Equal ?
Digest Digest

Encrypt with Decrypt with


Mr.As Private Key Mr.As Public Key

12 (Digital Signature)


1.
(Hash Function)
(Digest)
2.


3.

(Hash Function) (Digest) 1
1
2

Verify
22

2.2.6 Secure Socket Layer (SSL)


SSL
Netscape Client Server
SSL Public
Key (Key Exchange) Client Server
13 ( , 2547 )

C
}
,
{K S
b C
Pu

KS
,C {da
ta }

t a}
{da
K S,C

13 SSL


- Client Public Key Client ( PubC ) Server
- Server Secret Key ( K S,C )
- Server Secret Key Public Key Client ( PubC{K S,C} )
Client
- Client Secret Key Private Key Client ( K S,C = PriC{PubC{K S,C}} )
23

- Client Secret Key


Client Server

2.3 Web Services


Web Services (Service)
RPC (Remote Procedure Call)

XML
HTTP World Wide Web
( 2549 )

2.4
2.4.1



SLE4428 Memory Smartcard (Advanced Card
Systems Ltd 2006) EEPROM
1 Kbyte Java

2.4.2




24

1.

14
: , [], 15
2549. http://www.borathailand.org/smart_card.htm

Smart Card ( 2549)





25

2.

15
: , [] ,
15 2549. http://www.thaismartcard.co.th/corporate/th/what_is_smart_purse
/index.jsp

( 2549)




Contact Contactless

26

3. Warranty Plus Card

16 Warranty Plus Card


: , Waranty Plus Card [] , 2
2549. http://www.toyota.co.th/red/th/warranty_plus.asp

Warranty Plus Card ( 2549)





2.5

2.5.1 Integrating Smart Card Access to Web-based Medical Information


System




World Wide Web
WebCard Model (Alvin T. S. Chan 2003 : 246-250)
27

2.5.2 A Java OpenCard Framework based Medical SmartCard system



OpenCard Framework 2 1

2 PIN

DES (Data Encryption Standard) PC

(David Gildea and Tom Dowling 2003 : 99103)

2.5.3 Developing Smart Card Applications Using the OpenCard Framework



OpenCard Framework
(Mark Burge 2004 : 19-24)

2.5.4 Multi Purpose Student Card System Using Smart Card Technology




(Omar S. and Djuhari H. 2004 : 527-532 )

2.5.5 The Implementation of Electronic Money for E-commerce using Java


Card
E-commerce
(simulation)
( Insik Hong and Ingook Chun 2001 : 1369
1372 )
3



(Java Card Applet)

3.1

1.




2. (Java Card Applet)
(Java
Card Applet )


3.

28
29

4.

5.

3.2
2
2
(CA Web Services)
17

CA Web Services

17
30

3.2.1


- PIN
- Private Key Public Key

Java Card Applet
-
- Public Key (Digital
Certificate) (CA Web Services )

-

-


3.2.2

- PIN
-
(Digital Certificate)
(CA Web Services )
- PIN
-
-
31

-
-

3.3 Java Card Applet


Java Card Applet

3.3.1


-
-
- PIN (Personal Identification Number)

- Private Key Public Key
- ( Digital Certificate)


-
-
-
-
-
-
-
-
-
-
32

3.3.2 JAVA Card Applet


JAVA Card Applet

1. PIN Code
PIN Code
2. (Private Key)
(Public Key)
3. (Public Key)
4. Secret Key Private Key
5. Secret Key

6.

7. (Digital Certificate)

JAVA Card Applet


PIN Code Private Key Public Key

3.3.3 Command APDU


Command APDU
Command APDU JAVA Card Applet

1 Command APDU

Command APDU

CLA INS P1 P2 Lc Data Le
Verify PIN Code 80 40 00 00 PIN Length PIN Code -
Set PIN Code 80 50 00 00 PIN Length PIN Code -
Key Pair 80 11 00 00 00 00 -
Public Key 80 12 00 00 00 00 -
33

1 ()

Command APDU

CLA INS P1 P2 Lc Data Le
Sign Data 80 31 00 00 Data Length Sign -

- 80 10 01 00 Data Length -
- - 80 10 02 00 Data Length - -
- 80 10 03 00 Data Length -
- 80 10 04 00 Data Length -
- 80 10 05 00 Data Length -
- 80 10 06 00 Data Length -
- 80 10 07 00 Data Length -
- 80 10 08 00 Data Length -
- 80 10 09 00 Data Length -
- 80 10 0A 00 Data Length -
- 80 10 0B 00 Data Length -
- 80 10 0C 00 Data Length -
- 80 2A 00 00 Data Length -
- 80 1A 00 Data Length -
- 80 2C 00 00 Data Length -
- 80 1C 00 Data Length -
80 20 P1 -
80 30 P1 -
34

3.3.4
Host Application


2


3
- 3
3
3
3
3
3
3
3
3
3
3
2
2

: 3
2
35

3.4 (CA Web Services )



( 2549)
(CA)

-
-
-
- Certificate Request
-
-
-

3.4.1 CA Web Services


CA Web Services

- String [] getCAS()
CA
CA AdminCA1
- String getRootCert(String casname)
CA CA
getCAS()
- byte [] getUserLastCert(String userSubject)
DN
getUserLastCert(CN=000001)
- String [] getUserList()
(DN)
- String [] getLoginList()
36

Login
- String [] getNewUserList()

- String revokeLogin(String login)
Login
- String findLogin(String login)
Login
- String addUser(String login , String pwd , String DN , String email , String
ca)
Login Password DN email
ca
- String requestCert(String user , String pwd , String certReg)
Login , Pwd Certificate Request

3.4.2 CA Web Services

- addUser CA
- requestCert
- getUserLastCert CA Server

- getRootCert

- deleteLogin

- getRootCert

37

3.5 Host Application


Host Application
2
3.5.1


CA
Web Services 18 Flow chart

18 Flow chart
38


-
-
-

-
-

-

3.5.1.1 (Certificate Request)



( CA Web Services )
19

CA Server

CA Web Services

Certificate Certificate
Request
Generate Key Pair

Public key
Private Key

Public Key
Certificate

Smart Card

19
39


1. addUser() CA Web Services

2. Public Key Certificate Request
Certificate Request Sign
3. Certificate Request CA Web Services
requestCert() CA Web Services
4. CA Web Services
getUserLastCert() CA Web Services

3.5.1.2



20

20
40

3.5.2
(Kiosk)
PIN
21 Flow chart

21 Flow chart
41


-
- PIN
- PIN PIN

-


-
PIN


-
-

3.6




3.6.1
(Public Key
Cryptography)
Private Key Public Key
RSA 1024


-
Private Key

42

- 1024

3.6.2

2
3.6.2.1 PIN
PIN
PIN

PIN PIN PIN


PIN
22

PIN XXXX

Verify PIN 1 2 3
Yes or No Verify Result 4 5 6
7 8 9
0

Smart Card

22 PIN
43

3.6.2.2 (Digital Certificate)





23

23


(Digital Signature)



44

1. (CA Root Certificate)



2.
(CA
Signature)
3. (Verify)

(CA Public Key )
4.

3.6.3 (Key Exchange)


SSL

Host Application
2
RSA (Rivest-Shamir-Adelman
Encryption ) (R.L. Rivest, A. Shamir, and L. Adlemman 1978 : 120-126)
DES (Data Encryption Standard) (National Institute of Standards and
Technology 1993) RSA
Host Application

DES
Host Application RSA
24
45

24 (Key Exchange )

(Key Exchange)

1. Host Application Secret Key ( KeyC,H) Key

2. Host Application Public Key (PubC)
3. Public Key (PubC) Host
Application
4. Host Application Secret Key Public Key
( PubC{KeyC,H } )
5. Host Application Secret Key Public Key
( PubC{KeyC,H } )
46

6. Secret Key Private Key


Secret Key ( KeyC,H = PriC{ PubC{KeyC,H }} )

7. Host Application Secret Key
( KeyC,H {Data} )
Host Application

3.7

3 Card

: Card
:

CardID (PK) 7
EmpID (FK) 6
CardStatus 1 1 , 0
DateIssue -
DateCancel -

4 Employee

: Employee
:

EmpID (PK) 6
TitTha 10
NameFir 70
47

4 ()


NameSec 70
Sex 1
DateBir -
Address 200
Tel 50
Salary 6
Image -
DatStrWrk -
CodPos (FK) 3
CodDiv (FK) 2
CodEdu (FK) 2

5 Positions

: Positions
:

CodPos (PK) 3
PosDes 200

6 Division

: Division
:

CodDiv (PK) 2
DivDes 150
48

7 Education

: Education
:

CodEdu (PK) 2
EduDes 200

8 Service

: Service
:

EmpID (PK)(FK) 6
ServiceDate (PK) -
UseService 4 4
T , F
TTFT
1 PIN
2
3
4
49

25 ER Diagram

3.8

3.8.1 Java Card API


Java Card Applet Java Card API 2.2.1
2.2.1 Java Card API
Java Card JCOP (Java Card Open Platform)

3.8.2 JCOP Tools (Eclipse plugin)


JCOP Tools Java Card Applet
IMB JCOP Tools
Eclipse IDE
50

3.8.3 JCOP Off Card API


JCOP Off Card API API JCOP
Host Application

3.8.4 My SQL
My SQL

3.8.5

ISO 7816 Global
Platform
- IBM JCOP-SmartCard (International Business Machines Corporation 2006)
- JavaCard 2.2.1 OS
- 32 kB EEPROM
- Triple-DES Coprocessor
- RSA Coprocessor
- Default clock rate of 3.57 MHz: 9600 bit/sec

3.8.6 Smart Card Reader


PC/SC


(Java Card Applet)
(Host Application) 2




4.1 (Java Card Applet)




- PIN
- PIN
- PIN
- ( Private Key , Public Key )
- Public Key
- (Sign)
- Secret Key Private Key
-
-
-
-
-
-
51
52


4.1.1 PIN
PIN PIN
OwnerPIN PIN PIN
1234 PIN

pin = new OwnerPIN(PIN_TRY_LIMIT,MAX_PIN_SIZE);


pin.update(pArray,(short) pOffset , pLen;

4.1.2 PIN
PIN
pin.check PIN PIN

byte[] buf = apdu.getBuffer();


byte byteRead = (byte)(apdu.setIncomingAndReceive());
if ( pin.check(buf,ISO7816.OFFSET_CDATA,byteRead)==false )
ISOException.throwIt(SW_VERIFICATION_FAILED);


PIN PIN 3

4.1.3 PIN
PIN PIN
PIN pin.update PIN

if (PIN_TRY_LIMIT!=(byte)0)
pin.update(buf, ISO7816.OFFSET_CDATA, byteRead);
53

4.1.4 ( Private Key , Public Key )


Java Card
Applet KeyPair keyPair.genKeyPair
RSA 1024 Private Key
Public Key Public Key

KeyPair keyPair = new KeyPair(KeyPair.ALG_RSA_CRT,


KeyBuilder.LENGTH_RSA_1024);
keyPair.genKeyPair();


Java Card Applet

4.1.5 Public Key


Public Key keyPair.getPublic
Respond APDU

RSAPublicKey pKey = (RSAPublicKey)keyPair.getPublic();


pKey.getExponent(buf,(short)(ISO7816.OFFSET_CDATA+4));
pKey.getModulus(buf,(short)(ISO7816.OFFSET_CDATA+4+size);
...
apdu.setOutgoing();
apdu.setOutgoingLength((short)(size+size2+4));
apdu.sendBytes((short)ISO7816.OFFSET_CDATA,(short)(size+size2+4));
54

26 Public Key

4.1.6 (Sign)
Certificate Request
CA Webservice

RSAPrivateCrtKey rsaPrivateKey = (RSAPrivateCrtKey) keyPair.getPrivate();


Signature RSASig = Signature.getInstance(Signature.ALG_RSA_SHA_PKCS1, false);
RSASig.init(rsaPrivateKey, Signature.MODE_SIGN);
RSASig.sign(buf, offData, lc, msg2,(short) 0);

4.1.7 Secret Key Private Key


Secret Key Public Key Secret Key
Host Application
Class Cipher Secret Key DESKey

byte[] buffer = apdu.getBuffer();


RSAPrivateCrtKey rsaPrivateKey =(RSAPrivateCrtKey)keyPair.getPrivate();
Cipher cipherRSA = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
cipherRSA.init(rsaPrivateKey, Cipher.MODE_DECRYPT);
cipherRSA.doFinal(buf, offData, lc, keyDESData,(short) 0);
DESKey = (DESKey)KeyBuilder.buildKey
(KeyBuilder.TYPE_DES,KeyBuilder.LENGTH_DES,false);
55

DESKey.setKey(keyDESData,(short) 0);

4.1.8
(CA)
Command APDU
255

byte[] buffer = apdu.getBuffer();


apdu.setIncomingAndReceive();
short len_data = (short)255;
short bOff = (short)0;
bOff = (short)buffer[ISO7816.OFFSET_P1];
bOff *= (short)255;
Util.arrayCopy(buffer,offData,CertArray,(short)bOff,len_data);

4.1.9

byte[] buffer = apdu.getBuffer();


short len_data = (short)255;
short bOff = (short)0;
bOff = (short)buffer[ISO7816.OFFSET_P1];
bOff *= (short)255;
56

apdu.setOutgoing();
apdu.setOutgoingLength((short)len_data);
apdu.sendBytesLong(CertArray, (short)bOff, (short)len_data);

4.1.10

DESKey cipher

byte[] buffer = apdu.getBuffer();


apdu.setIncomingAndReceive();
...
cipherDES.init(DESKey,Cipher.MODE_DECRYPT);
...
cipherDES.doFinal(buffer,(short)offData,(short)lc,DataArray,(short)0x00);
...
Del(apdu);
...
Util.arrayCopy(DataArray,(short)0,Name_Array,(short)0,lc;

4.1.11
DESKey
cipher Respond APDU

cipherDES.init(DESKey,Cipher.MODE_ENCRYPT);
...
cipherDES.doFinal(Name_Array,(short)0x00,(short)Name_Array.length,DataArray,(short)0x00);
len_text = (short)Name_Array.length;
...
57

apdu.setOutgoing();
apdu.setOutgoingLength((short)len_text);
apdu.sendBytesLong(DataArray, (short)0, (short)len_text);

4.1.12

byte[] buffer = apdu.getBuffer();


apdu.setIncomingAndReceive();
short offData = ISO7816.OFFSET_CDATA;
short len_data = (short)255;
short bOff = (short)0;
bOff = (short)buffer[ISO7816.OFFSET_P1];
bOff *= (short)255;
Util.arrayCopy(buffer,offData,ImageArray,(short)bOff,len_data);

4.1.13
Host
Application

byte[] buffer = apdu.getBuffer();


short len_data = (short)255;
short bOff = (short)0;
58

bOff = (short)buffer[ISO7816.OFFSET_P1];
bOff *= (short)255;
apdu.setOutgoing();
apdu.setOutgoingLength((short)len_data);
apdu.sendBytesLong(ImageArray, (short)bOff, (short)len_data);

4.2 Host Application


Host Application

Host Application
Host Application

4.2.1 (Digital Certificate)



Class EJBCA addUser() CA
Certificate Request Module.getCertRequest()
Certificate Request requestCert()
CA getUserLastCert ()

ejbca.addUser(EmpID,EmpID,userDN,email, cas[0]);
String certReq = Module.getCertRequest(userDN,OfficialCardApp);
ejbca.requestCert(EmpID,EmpID,certReq);
byte[] vcert = ejbca.getUserLastCert(userDN);
59

27

4.2.2 (Key Exchange)


Secret Key Host Application

- Public Key
pKey = OfficialCardApp.getPublicKey();

- Secret Key
sKey = kg.generateKey();

- Key Secret Key


keyByte = sKey.getEncoded();

- RSA Public Key


cp = Cipher.getInstance("RSA");
cp.init(Cipher.ENCRYPT_MODE, pKey);

- Secret Key Public Key


encKey = cp.doFinal(keyByte);
60

- Secret Key

OfficialCardApp.decryptForDesKey(encKey);

28 Secret Key


- Secret Key
A4BC2F51018676A1
- Secret Key Public Key
B263186FA2BDFBFA2A5450A1D45AEC28F7CDA608BBBFE359E3727F1CC6B9B4
E0CB644301C6EE6F5A615A0F95C0BB3D475AD078D9CD130B87BB57B918C8CF5F1C34ED
A99DE2DF6CA2B8B6A41E48D8295012B17C629E12E8B2301B83E99799C51630D0A65DB54
7B143566DA09BBEB632F2CDCCEB7F0867C57F85F47D887EF90AB1
- Secret Key Private Key
A4BC2F51018676A1
61

4.2.3 Host Application



DES Secret Key

Cipher cp = Cipher.getInstance("DES");
cp.init(Cipher.ENCRYPT_MODE, sKey);
Tmp = cp.update(DataToEncypt,0, DataToEncypt.length);

Tmp


DES Secret Key

Cipher cp = Cipher.getInstance("DES");
cp.init(Cipher.DECRYPT_MODE, sKey);
Tmp = cp.update(bytein,0, bytein.length);

Tmp
29
62

29 Host
Application

Host Application
-

-
2F6301CFB5EA5904D8D30892419589A4601BE0C5BFED21DB7EE6CCACD9AD7D
71014FF12F508F320D1A10D1A63CF317EE
-
2F6301CFB5EA5904D8D30892419589A4601BE0C5BFED21DB7EE6CCACD9AD7D
71014FF12F508F320D1A10D1A63CF317EE1A10D1A63CF317EE1A10D1A63CF317EE1A10
D1A63CF317EE1A10D1A63CF317EE
-

63

4.2.4
CA Webservice
Class EJBCA

- CA ( Root Certificate ) CA
AdminCA1 X509

String rCert = ejbca.getRootCert("AdminCA1);


X509Certificate rootCert = (X509Certificate)
readCertificateFromByteArray(rCert.getBytes());

-
X509

CertByteFromCard = OfficialCardApp.getCertificate();
X509Certificate UserCert = (X509Certificate)
readCertificateFromByteArray(CertByteFromCard);

-
Public Key Root Certificate

UserCert.verify(rootCert.getPublicKey());

4.2.5




64

000001-06/10/2549-18:43-A

A
B

4.3 Host Application


4.3.1



Java
30

30
65


31

31
66


4.3.1.1

32

32



1.
2.
3.
4. (Digital Certificate)
5.

6.
67

4.3.1.2

Public Key
33

33
68

4.3.1.3

Secret Key Secret Key
Public Key Secret Key
Secret Key
Host Application 34

34
69

4.3.1.4


35

35
70

4.3.1.5


36

36

4.3.1.6

PIN

37

37
71

4.3.1.7

38

38
72

4.3.2

PIN
Java
39

PIN

39


40

40
73


PIN 4 41

41 PIN



42
PIN
1234 PIN
74

42

PIN 43

43 PIN
75

44

44


45

45
76


46

46

4.4


-
-
-
77

4.5
IBM JCOP Smart Card (International Business Machines
Corporation 2006) SLE4428
Memory Smartcard (Advanced Card Systems Ltd 2006)
9

9 IBM JCOP SLE4428

IBM JCOP SLE4428


32K byte EEPROM 1K byte EEPROM

Java
Command APDU
PIN
(Private Key , Public Key )


DES
RSA


5




(Host Application)

1.
(Java Card Applet )
2.

3.
4.
(Kiosk)

1. (Java Card Applet)


Java

RSA DES
2.

78
79

3. PIN

4.


-

- Java Card Applet
Java Card Applet Java Card
Applet




-

-

-

-
-

-

80

. [] . 15
2549. http://www.borathailand.org/smart_card.htm
. [].
15 2549. http://ws.cmsthailand.com/new3.html
. [] . 20 2549.
http://www.nextproject.net/article_detail.aspx?a_id=48
. Waranty Plus Card [] . 2 2549.
http://www.toyota.co.th/red/th/warranty_plus.asp
(). [] . 20
2549. http://www.ca.tot.co.th/knowledge_signing.html
_________ . []. 2 2549.
http://kitty.in.th
. [] . 15 2549.
http://www.thaismartcard.co.th/corporate/th/what_is_smart_purse /index.jsp
.
. 7
2549 ()
, .
[]. 10 2549.
http://www.thaicert.nectec.or.th/paper /authen/authentication_guide.php
. (Certificate
Profile) []. 20 2549. http://gca.thaigov.net/
whitepapers/certificate_profile.pdf

Alpha Card Systems. RFID Cards - Contactless Smart Cards [Online].Accessed 15 December
2005. Available from http://www.alphacard.com/id-cards/rfid-cards.shtml
81

Alvin T. S. Chan . Integrating Smart Card Access to Web-based Medical Information System.
In Proceedings of the 2003 ACM symposium on Applied computing , 246 250 .
Florida :ACM Press, 2003.
Advanced Card Systems Ltd. Smart Cards & Smart Card Operating System [Online]. Accessed 3
October 2006. Available from http://www.acs.com.hk/Products_Smart_Cards.asp
C. Enrique Ortiz . An Introduction to Java Card Technology [Online]. Accessed 1 December
2005. Available from http://developers.sun.com/techtopics/mobility/javacard/articles
/javacard1/
David Gildea ,Tom Dowling. A Java OpenCard Framework based Medical SmartCard system
In Proceedings of the 2nd international conference on Principles and practice of
programming in Java , 99 103. Ireland : Computer Science Press Inc., 2003.
GlobalPlatform. GlobalPlatform: The Standard for Smart Card Infrastructure[Online]. Accessed
15 December 2005. Available from http://www.globalplatform.org/showpage.asp?
code=whoweare
Insik Hong, Ingook Chun. The implementation of electronic money for E-Commerce using Java
card In Industrial Electronics, 2001. Proceedings. ISIE 2001. IEEE International
Symposium , 1369 1372 . Pusan : IEEE, 2001.
International Business Machines Corporation . JetZ white paper [Online]. Accessed 10 April
2006. Available from http://www.zurich.ibm.com/csc/infosec/jetz.html
Mark Burge. Developing smart card applications using the OpenCard Framework In
Proceedings of the 42nd annual Southeast regional conference , 19 24 . Alabama :
ACM, 2004.
National Institute of Standards and Technology. Data Encryption Standard , Federal Information
Processing Standard, FIPS PUB 46-2 [Online]. Accessed 20 December 2005.
Available from http://www.itl.nist.gov/fipspubs/fip46-2.htm
Omar S. , Djuhari H.. Multi Purpose Student Card System Using Smart Card Technology In
Information Technology Based Higher Education and Training, 2004. ITHET 2004.
Proceedings of the FIfth International Conference , 527 532 .IEEE ,2004.
PC/SC Workgroup .PC/SC Workgroup Specifications Overview [Online]. Accessed 15
January 2006. Available from http://www.pcscworkgroup.com/index.php?o
82

R. L. Rivest, A. Shamir, and L. Adleman . A Method for Obtaining Digital Signatures and
Public-Key Cryptosystems. Communications of the ACM 21 (Febuary
1918):120-126.
Uwe Hansmann et al. Smart Card Application Development Using Java . Germany :
Springer-verlag ,2000.
Zhiqun Chen. Java Card Technology for Smart Cards Architecture and Programmers Guide .
Boston : Addison Wesley , 2000.
83

84

85



- Java Card Applet Official.app
Class OfficialCard
-

- My SQL

Official
- CA Web Services CA Web Services
Linux CA EJBCA
Web Services EJBCA
Web Services WSDL
http://10.11.12.13:9090/axis/EJBCA.jws?wsdl



1. MySQL folder ProjectSmartCard
\Programs\EvironmentProgram\Database folder official
C:\Program Files\MySQL\MySQL Server 5.0\data
2. CA Webserviecs CA Webservices
NECTEC
Webservice IP 10.11.12.13 Webserviec IP
86

3. Java Card Applet Project OfficialCardNectec5 folder


ProjectSmartCard\SourceCode\JavaCardApplet import eclipes IDE
Java Card Applet Java Card Applet JCOP 41
4. Driver
5.

RegCard.jar folder
ProjectSmartCard\Programs\HostApplication\RegisterCard
Kiosk.jar
folder ProjectSmartCard\Programs\HostApplication\Kiosk

* dll
jct.dll , jpcsc.dll tcl.dll folder ProjectSmartCard\Programs\EvironmentProgram\dll
folder C:\WINDOWS

* Webservice Certificate
Certificate folder ProjectSmartCard\ExampleCertificate
- 000001.cer 000003.cer Certificate
- AdminCA1.crt Certificate Root CA
- khonthaica.cer Certificate
Verify Certificate
87

47

47


Tab
1.
2. PIN PIN 1234
PIN 48
88

48 PIN

PIN

3.
6
49 OK

49


50
89

50

4.
51

51

5. Digital Certificate
Certificate Request CA Webservice
52

52
90

6.

53

54

7.


Tab

1. PIN PIN 4
2. Key Key
Key
3.
55
91

55

4.


Tab



1. Public Key Get Public Key
Public Key 56
92

56 Public Key

2. Secret Key DES KEY


Secret Key
3. Secret Key Public Key
DES Pub
4. Secret Key Private Key DES
Pri Key 57

57 Key
93

Host Application

1.

Secret Key
2.
3. 58

58



CA WebService Verify
Certificate Verify Certificate OK 59
94

59

Verify Certificate FAIL 60

60



61

61
95


Tab
1. PIN 4
2.

3. 62

62
96

Tab
63

Refresh

63

Tab

64
Refresh
97

64


Tab
65

65
98



66

66





99



OK



OK
100


(Kiosk ) Webservice

CA (Root Certificate)
67

67 Root Certificate CA

Webservice Root
Certificate AdminCA1.crt 68

68 Root Certificate
101

CA
69

69


PIN 70

70 PIN
102

PIN 4 PIN
1234 PIN
PIN PIN 2
PIN PIN
PIN 15

71

71

PIN

72
103

72

PIN

PIN
PIN PIN 4
PIN
PIN 2 PIN PIN
73
104

73 PIN



74

74
105


106

107

Java Card Applet


Java Card Applet Java Operation

10 Class OfficialCard

Class : OfficialCard
:
Operation
install() Java Card Applet
Constructor
OfficialCard() Constructor PIN , ,
DES Key
select() Java Card Applet
deselect() Java Card Applet
process() Command APDU APDU
Operation
Set(apdu)
Get(apdu)
Del(apdu)
SetImage(apdu)
SetImageSize(apdu)
GetImage(apdu)
GetImageSize(apdu)
SetCertificate(apdu)
SetCertificateSize(apdu)
GetCertificate(apdu)
GetCertificateSize(apdu)
108

10 ()

Operation
GetPublicKey(apdu) Public Key
Sign(apdu)
DecyptForDESKey(apdu) Secret Key Private Key
VerifyPIN(apdu) PIN
Setpin(apdu) PIN

Host Application

Java
Class
- Class CardApplet Application
- Class CardInfo
- Class Init
- Class InsertDataToDB
- Class MainReg Class
- Class Module
- Class MyUtil Class
- Class ShowDatainCard
- Class Tab Calss tab
- Class Terminal
- Class TestCard
- Class UpdateDatainCard
- Class UseService
109

Class

11 Class CardApplet

Class : CardApplet
: Application
Operation
CardApplet(JCard c, byte[] aid) Constructor Applet
set(byte[] Data,int filedSelect)
byte[] filed
setCertificate(byte[] CertByte)
byte[]
byte[] getCertificate()
setImage(byte[] ImageByte)
byte[] getImage()
byte[] getByte(int filedSelect) filed

boolean verify(String DataIn) PIN
setpin(String DataIn) PIN
String byteToString(byte[] byte[] String
byteIn)
PublicKey getPublicKey() Public Key
byte[] signData(byte[] in)
byte[] decryptForDesKey(byte[] Secret Key Private Key
in)
110

12 Class CardInfo

Class : CardInfo
:
Operation
CardInfo() Constructor
setComponent() Component
ConnectDB()
CreateTable()
RefreshData()

13 Class Init

Class : Init
:
Operation
Init() Constructor
byte [] readBytesFromFile(String byte[]
filename)
Certificate byte[] Certificate
readCertificateFromByteArray(byte[]
ba)
ConnectDatabase()
doRegister() CA CA
selectDataFromDB()
AutoCardID()
AddNewCardToDB()
cancelOldCard()
readPic(BufferedImage image)
111

13 ()

Operation
loadDataToCard()
LoadCertToCard()
clear()
userHaveCert() CA
createKey() Secret Key
EnDESwithRSAandSendToCard() Secret Key
byte[] EnCrypt(String StringIn)
Certificate Certificate
readCertificateFile(String
filename)

14 Class InsertDataToDB

Class : InsertDataToDB
:
Operation
InsertDataToDB () Constructor
createComboPosition() Combo Box
createComboEducation() Combo Box
createComboDivision() Combo Box
ConnectDatabase()
Search()
ShowData()
readPic(BufferedImage image)
clear()
addData()
editData()
112

14 ()

Operation
DeleteData()
Init() Component
checkFieldData()
checkEmptyTextField()
CheckDateOK()
CheckSelectImageOK()
matchCombo() Combo Box

15 Class MainReg

Class : MainReg
: Class
Operation
MainReg () Constructor
main()

16 Class Module

Class : Module
:
Operation
Module () Constructor
checkJavaVersion() JAVA
reportError()
String getCertRequest(String Certificate Request
DN,CardApplet applet)
113

16 ()

Operation
byte [] readBytesFromFile(String byte[]
filename)
Certificate Certificate byte[]
readCertificateFromByteArray(byte[] ba)
String base64Encode(byte[] in) byte[] Base64
CA
byte[] base64Decode(String in) Base64 byte[]

17 Class MyUtil

Class : MyUtil
: Class
Operation
String ConvertDate(Calendar time) String
String ConvertDate(java.util.Date d) Date String
String ConvertDateToDB(Calendar String
time)
String ConvertDateToDB(String String String
dateIn)
String swapDate(String date)
String CalThaiday(String
dateOfBirth)
byte[] ImageToBytes(String byte[]
filename)
write(BufferedImage image, BufferedImage OutputStream
OutputStream out)
114

17 ()

Operation
BufferedImage ByteToImage(byte[] byte[]
ImageByte)
boolean
checkDateFormatOK(String dateIn)
String NumToBaht(String num)

18 Class ShowDatainCard

Class : ShowDatainCard
:
Operation
ShowDatainCard() Constructor
GetImage()
ShowCardInfo()
ShowEmpData()
ShowPublicKey() Public Key
ShowCartificate()
Certificate byte[] Certificate
readCertificateFromByteArray(byte[] ba)
RandomDESkey() Secret Key
EnDESwithRSAandSendToCard() Secret Key
String DeCyptData(byte[] bytein) Secret Key
String byteToString(byte[] byteIn) byte[] String
Init()
115

19 Class Tab

Class : Tab
: Calss tab
Operation
Tab() Constructor Class tab

20 Class Terminal

Class : Terminal
:
Operation
Terminal() Constructor
JCard connect()
boolean CardInReader()
boolean CardConnectStatus()
Disconnect()

21 Class TestCard

Class : TestCard
:
Operation
TestCard() Constructor
byte[] readBytesFromFile(String filename) byte[]
Certificate byte[] Certificate
readCertificateFromByteArray(byte[] ba)
String byteToString(byte[] byteIn) byte[] String
byte[] EnCrypt(byte[] Data)
116

21 ()

Operation
init()
Certificate readCertificateFile(String Certificate
filename)
* method actionPerformed()

22 Class UpdateDatainCard

Class : UpdateDatainCard
:
Operation
UpdateDataInCard () Constructor
ConnectDatabase()
selectDataFromDB()
readPic()
loadDataToCard()
clear()
createKey() Secret Key
EnDESwithRSAandSendToCard() Secret Key
byte[] EnCrypt(String StringIn)
getEmpID()

String DeCryptData(byte[] bytein)
String byteToString(byte[] byteIn) byte[] String
117

23 Class UseService

Class : UseService
:
Operation
UseService () Constructor
setComponent() Component
ConnectDB()
CreateTable()
RefreshData()
118

UML Class

75 UML Class CardApplet


119

76 UML Class CardInfo


120

77 UML Class Init


121

77 ()
122

78 UML Class InsertDataToDB


123

78 ()
124

79 UML Class MainReg


125

80 UML Class Module


126

81 UML Class MyUtil


127

81 ()
128

82 UML Class ShowDatainCard


129

82 ()
130

83 UML Class Tab


131

84 UML Class Terminal


132

85 UML Class TestCard


133

85 ()
134

86 UML Class UpdateDatainCard


135

86 ()
136

87 UML Class UseService


137


Java Class
- Class CardApplet Application
- Class Intro
- Class Keyboard PIN
- Class MainClassKiosk Class
- Class MyUtil Class
- Class OfficialInfo
- Class PrintInfo
- Class Service
- Class Terminal

Class ( Class
Class )

24 Class Intro

Class : Intro
:
Operation
Intro() Constructor

25 Class Keyboard

Class : Keyboard
: PIN
Operation
Keyboard() Constructor
String getPIN() PIN
138

25 ()

Operation
Settextinfo(String textinfo)
ClearPIN() PIN
fillPassword(String PINin)

26 Class MainClassKiosk

Class : MainClassKiosk
: Class
Operation
MainClassKiosk () Constructor
ConnectApplet Card Applet
ChangePIN PIN
Certificate byte[] Certificate
readCertificateFromByteArray(byte[] ba)
Certificate readCertificateFile(String
filename)
boolean verifyCer() CA
Init() Component
ClearUseService()
SaveUseService()
ConnectDatabase()
main()
139

27 Class OfficialInfo

Class : OfficialInfo
:
* Class method Class ShowDatainCard

28 Class PrintInfo

Class : PrintInfo
:
Operation
PrintInfo() Constructor Card Applet
setPrintSalary
getEmpData
showPrinter
CreateKey Secret Key
String DeCyptData(byte[] bytein)
String byteToString(byte[] byteIn) byte[] String

29 Class Service

Class : Service
:
Operation
Service() Constructor
140

UML Class

88 UML Class Intro


141

89 UML Class Keyboard


142

90 UML Class MainClassKiosk


143

90 ()
144

91 UML Class OfficialInfo


145

92 UML Class PrintInfo


146

93 UML Class Service


147

(Digital Certificate)

Version: V3
Subject: CN=000001
Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5

Key: Sun RSA public key, 1024 bits


modulus:
12735289808660918947434414202397759182153749703614213964459651032948108803910187011769938
83854183259843107887404591904362331065362598242517687734849147348337637834795267022954912
66522023739484916109506555963327989330650028301067822994582138258491688426763654654671309
918925332324662971286746207788776794220027
public exponent: 65537
Validity: [From: Fri Jun 30 14:31:51 GMT+07:00 2006,
To: Sun Jun 29 14:41:51 GMT+07:00 2008]
Issuer: C=SE, O=EJBCA Sample, CN=AdminCA1
SerialNumber: [ 4269b356 2c28d5a2]

Certificate Extensions: 5
[1]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 86 E6 ED 00 28 B8 91 85 D8 88 15 9D D7 CB D7 5F ....(.........._
0010: 90 A4 8A DF ....
]
]

[2]: ObjectId: 2.5.29.35 Criticality=false


AuthorityKeyIdentifier [
KeyIdentifier [
0000: 1D 8B 71 E2 1B 51 F8 75 23 10 75 C3 E0 89 83 43 ..q..Q.u#.u....C
0010: 71 EA 23 42 q.#B
]
]
148

[3]: ObjectId: 2.5.29.37 Criticality=false


ExtendedKeyUsages [
[1.3.6.1.5.5.7.3.1, 1.3.6.1.5.5.7.3.2, 1.3.6.1.5.5.7.3.4, 1.3.6.1.5.5.7.3.5, 1.3.6.1.5.5.7.3.7]]
[4]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
DigitalSignature
Key_Encipherment
]
[5]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:false
PathLen: undefined
]
]
Algorithm: [SHA1withRSA]
Signature:
0000: 4F F1 83 48 9D BF C0 A1 93 2A E1 D1 E7 B0 7C 0F O..H.....*......
0010: 22 06 AF 32 B0 AC D5 78 D0 EA 46 3C 24 B9 4B 73 "..2...x..F<$.Ks
0020: B8 79 32 4F 35 DD C4 86 14 88 BF 42 90 08 07 50 .y2O5......B...P
0030: 3A 72 2D E8 F8 D1 49 BF EE 35 CC D3 2F 7B 30 C9 :r-...I..5../.0.
0040: 2D C4 87 07 8B 6C 9E 7C 6F AB FA F8 B3 0C 69 4F -....l..o.....iO
0050: 3D D8 3E D8 EC E7 40 EB E2 7E 95 2B 09 1B 6E 71 =.>...@....+..nq
0060: EC D5 E8 B2 2C E4 B9 7B EC 13 22 FD 91 6E F8 54 ....,....."..n.T
0070: C9 E6 2C C3 A3 B2 38 67 4C 8F 1C 32 B8 F4 AE 7F ..,...8gL..2....
0080: 58 1F F1 84 A0 84 00 4C DF 90 11 0B 62 59 5F 1A X......L....bY_.
0090: 4F 7C 00 DA DE B5 64 B5 24 D9 C1 13 27 1F 11 EA O.....d.$...'...
00A0: 39 B2 63 0A F9 19 C4 65 11 0E D2 8E 96 E3 1D 58 9.c....e.......X
00B0: 36 5D DD 96 25 98 C1 13 BD 91 19 68 76 ED A3 65 6]..%......hv..e
00C0: 63 8B E8 29 4E 2E 4A 82 C8 A7 1C 11 84 A6 B6 B8 c..)N.J.........
00D0: 0B E7 6D 53 36 69 70 D5 D2 EB C5 A3 E7 B3 69 DA ..mS6ip.......i.
00E0: FA 70 82 47 8F 7C A4 8A 27 40 CE D3 9D 90 E9 23 .p.G....'@.....#
00F0: 67 F5 69 8D 14 45 CE 5D 00 44 C5 5C A2 D8 EE A8 g.i..E.].D.\....]
149

150

151

-
1 16 73000
034285237

.. 2544

.. 2546

You might also like