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 />

79 ( this . PublicExponentTag ) ;<br />

80 private ConstructedTLV MessageHandler =<br />

81 ConstructedTLV . getConstructedTLV (TempTag) ;<br />

82 private PrimitiveTLV MACedData = PrimitiveTLV . getPrimitiveTLV<br />

83 ( this . MACedDataTag) ;<br />

84 private ConstructedTLV EncryptedData =<br />

85 ConstructedTLV . getConstructedTLV ( this . EncryptedDataTag ) ;<br />

86 private PrimitiveTLV CardID = PrimitiveTLV . getPrimitiveTLV<br />

87 ( CardIDTag ) ;<br />

88 private PrimitiveTLV AppActTLV = PrimitiveTLV . getPrimitiveTLV<br />

89 ( this . AppActTag , this . AppAct ) ;<br />

90 private P r o t o c o l H e l p e r C l a s s myProtocolHelperObject = new<br />

91 P r o t o c o l H e l p e r C l a s s ( ) ;<br />

92 public TSMProtocolHandler ( ) {<br />

93 myProtocolHelperObject . p r o t o c o l I n i t i a l i s e ( ) ;<br />

94 RSAPublicKey tempKey = ( RSAPublicKey )<br />

95 myProtocolHelperObject . getPublicKey ( ) ;<br />

96 byte [ ] tempExponent = tempKey . getPublicExponent ( ) . toByteArray ( ) ;<br />

97 this . PublicExponent . i n i t i a l i s a t i o n P T L V ( this . PublicExponentTag ,<br />

98 tempExponent . l e n g t h ) ;<br />

99 this . PublicExponent . setTlvValues ( tempExponent ) ;<br />

100 byte [ ] tempModulus = tempKey . getModulus ( ) . toByteArray ( ) ;<br />

101 this . PublicModulus . i n i t i a l i s a t i o n P T L V ( this . PublicModulusTag ,<br />

102 ( tempModulus . l e n g t h − 1) ) ;<br />

103 this . PublicModulus . setTlvValues ( tempModulus , 1 ,<br />

104 ( tempModulus . l e n g t h − 1) ) ;<br />

105 TSMSignatureCertificate . addPTLV( this . PublicExponent ) ;<br />

106 TSMSignatureCertificate . addPTLV( this . PublicModulus ) ;<br />

107 }<br />

108 public void i n i t i a l i s e P r o t o c o l ( ) {<br />

109 try {}<br />

110 catch ( Exception cE ) {<br />

111 System . out . p r i n t l n (<br />

112 " Error ProtocolHandler . i n i t i a l i s e P r o t o c o l Option<br />

= 1 , : " + cE . g e t C l a s s ( ) . getName ( ) ) ;<br />

113 }<br />

114 }<br />

115 public byte [ ] outMessageProcessing ( ) {<br />

116 try {<br />

117 this . EncryptedData . r e s e t ( ) ;<br />

118 this . EncryptedData . i n i t i a l i s a t i o n C T L V ( this . EncryptedDataTag ) ;<br />

119 this . EncryptedData . addPTLV( this .TSMID) ;<br />

120 this . EncryptedData . addPTLV( this . SCIdentity ) ;<br />

121 this . TSMRandomNumber . setTlvValues<br />

122 ( this . myProtocolHelperObject . getRandomNumber ( ) ) ;<br />

123 this . EncryptedData . addPTLV( this . TSMRandomNumber) ;<br />

124 this . EncryptedData . addPTLV( this . SCRandomNumber) ;<br />

125 this . EncryptedData . addPTLV( this . U s e r I d e n t i t y ) ;<br />

126 this . EncryptedData . addPTLV( this . AppActTLV) ;<br />

127 this . myProtocolHelperObject . SignatureMethod<br />

128 ( this . EncryptedData . getValueBytes ( ) , 0 ,<br />

361

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

Saved successfully!

Ooh no, something went wrong!