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.5 Secure and Trusted Channel Protocol Smart Card<br />

136 r e s u l t , 0 , this . myProtocolHelperObject . myLongTermMacKey) ;<br />

137 this . SPCookie . setTlvValues ( r e s u l t ) ;<br />

138 this . MessageHandler . addPTLV( this . SPCookie ) ;<br />

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

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

141 " Error ProtocolHandler . inMessageProcessing<br />

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

142 }<br />

143 } else i f ( Counter == 2) {<br />

144 try {<br />

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

146 this . EncryptedData . addPTLV( this . SPIdentityTLV ) ;<br />

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

148 this . EncryptedData . addPTLV( this . SPRandomNumber) ;<br />

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

150 this . myProtocolHelperObject . SignatureMethod<br />

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

152 this . EncryptedData . getValueBytes ( ) . length ,<br />

153 this . SignedData . getBytesTlvRepresentation ( ) , 6 , null ,<br />

154 P r o t o c o l H e l p e r C l a s s .SIGN_MODE_GENERATION) ;<br />

155 this . EncryptedData . addPTLV( this . SignedData ) ;<br />

156 this . EncryptedData . addCTLV( this . S P S i g n a t u r e C e r t i f i c a t e ) ;<br />

157 this . myProtocolHelperObject . GenerateEncryption<br />

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

159 this . EncryptedData . getValueBytes ( ) . length ,<br />

160 this . EncryptedData . getBytesTlvRepresentation ( ) , 7 ,<br />

161 this . mySessionEncryptionKey ) ;<br />

162 this . MACedData . i n i t i a l i s a t i o n P T L V ( this . MACedDataTag , 16) ;<br />

163 this . myProtocolHelperObject . GenerateMac<br />

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

165 this . EncryptedData . getTagValueLength ( ) ,<br />

166 this . MACedData . getBytesTlvRepresentation ( ) , 6 ,<br />

167 this . mySessionMacKey ) ;<br />

168 this . MessageHandler . i n i t i a l i s a t i o n C T L V ( this . MessageHandlerTagTwo ) ;<br />

169 this . MessageHandler . addCTLV( EncryptedData ) ;<br />

170 this . MessageHandler . addPTLV( this . MACedData) ;<br />

171 this . MessageHandler . addPTLV( this . SPCookie ) ;<br />

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

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

174 " Error ProtocolHandler . inMessageProcessing<br />

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

175 }<br />

176 } else {<br />

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

178 " P r o t o c o l Stoped : I l l e g a l Message Value<br />

( ProtocolHanlder . inMessageProcessing ( ) " ) ;<br />

179 }<br />

180 return this . MessageHandler . getBytesTlvRepresentation ( ) ;<br />

181 }<br />

182 public boolean inMessageProcessing ( byte [ ] inMessage , int Counter ) {<br />

183 try {<br />

328

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

Saved successfully!

Ooh no, something went wrong!