06.11.2014 Views

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.6 Application Acquisition and Contractual Agreement Protocol<br />

424 }<br />

425 try {<br />

426 this . myProtocolHelperObject . GenerateMac ( macInputValue , 0 ,<br />

427 macInputValue . length , this . mySessionEncryptionKey , 0 , keyGenKey ) ;<br />

428 } catch ( Exception cE ) {<br />

429 System . out . p r i n t l n ( " Exception at ProtocolHandler . GenerateKeys : " +<br />

430 cE . g e t C l a s s ( ) . getName ( ) ) ;<br />

431 }<br />

432 <strong>for</strong> ( int i = 4 8 ; i < 6 4 ; i ++) {<br />

433 macInputValue [ i ] = ( byte ) 0x03 ;<br />

434 }<br />

435 try {<br />

436 this . myProtocolHelperObject . GenerateMac ( macInputValue , 0 ,<br />

437 macInputValue . length , this . mySessionMacKey , 0 , keyGenKey ) ;<br />

438 } catch ( Exception cE ) {<br />

439 System . out . p r i n t l n ( " Exception at ProtocolHandler . GenerateKeys : " +<br />

440 cE . g e t C l a s s ( ) . getName ( ) ) ;<br />

441 }<br />

442 }<br />

443 }<br />

C.6.3<br />

Administrative Authority Implementation<br />

Below is the code related to the administrative authority's implementation <strong>for</strong> the STCP ACA .<br />

1 package ACAPTerminal ;<br />

2<br />

3 import java . math . B i g I n t e g e r ;<br />

4 import java . s e c u r i t y . ∗ ;<br />

5 import java . s e c u r i t y . i n t e r f a c e s . RSAPublicKey ;<br />

6 import java . s e c u r i t y . spec . RSAPublicKeySpec ;<br />

7 import java . u t i l . Arrays ;<br />

8 public class TSMProtocolHandler {<br />

9 private byte [ ] AppAct = {<br />

10 ( byte ) 0x7d , ( byte ) 0xD5 , ( byte ) 0xB7 , ( byte ) 0xD0 , ( byte ) 0xB6 , ( byte )<br />

11 0xC1 , ( byte ) 0x2e , ( byte ) 0x07 , ( byte ) 0xe9 , ( byte ) 0x69 , ( byte ) 0x8D ,<br />

12 ( byte ) 0x11 , ( byte ) 0xB6 , ( byte ) 0xC1 , ( byte ) 0x2e , ( byte ) 0x07 ,<br />

13 ( byte ) 0xe9 , ( byte ) 0x69 , } ;<br />

14 private byte [ ] AppActTag = {<br />

15 ( byte ) 0x9A , ( byte ) 0x9B } ;<br />

16 private byte [ ] CardIDTag = {<br />

17 ( byte ) 0x5F , ( byte ) 0x05 } ;<br />

18 private byte [ ] EncryptedDataTag = {<br />

19 ( byte ) 0xFE , ( byte ) 0x01 } ;<br />

20 private byte [ ] LongTermEncryptionKey = new byte [ 1 6 ] ;<br />

21 private byte [ ] LongTermMacKey = new byte [ 1 6 ] ;<br />

22 private byte [ ] MACedDataTag = {<br />

23 ( byte ) 0x5D , ( byte ) 0x01 } ;<br />

24 private byte [ ] MessageHandlerTSMSC = {<br />

25 ( byte ) 0xF1 , ( byte ) 0xF1 } ;<br />

26 private byte [ ] PublicExponentTag = {<br />

27 ( byte ) 0xEE , ( byte ) 0x01 } ;<br />

359

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!