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.4 Secure and Trusted Channel Protocol Service Provider<br />

148 System . arraycopy ( this . SPDHChanllenger . getValueBytes ( ) , 0 ,<br />

149 temp , 0 , this . SPDHChanllenger . getValueLength<br />

150 ( ) ) ;<br />

151 System . arraycopy ( this . SPRandomNumber . getValueBytes ( ) , 0 , temp ,<br />

152 this . SPDHChanllenger . getValueLength ( ) ,<br />

153 this . SPRandomNumber . getValueLength ( ) ) ;<br />

154 System . arraycopy ( this . SCIP , 0 , temp , temp . l e n g t h −<br />

155 this . SCIP . length , this . SCIP . l e n g t h ) ;<br />

156 byte [ ] r e s u l t = new byte [ 1 6 ] ;<br />

157 this . myProtocolHelperObject . GenerateMac ( temp , 0 , temp . length ,<br />

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

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

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

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

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

163 " Error ProtocolHandler . inMessageProcessing<br />

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

164 }<br />

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

166 try {<br />

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

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

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

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

171 this . myProtocolHelperObject . SignatureMethod<br />

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

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

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

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

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

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

178 this . myProtocolHelperObject . GenerateEncryption<br />

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

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

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

182 this . mySessionEncryptionKey ) ;<br />

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

184 this . myProtocolHelperObject . GenerateMac<br />

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

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

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

188 this . mySessionMacKey ) ;<br />

189 this . MessageHandler . i n i t i a l i s a t i o n C T L V<br />

190 ( this . MessageHandlerTagTwo ) ;<br />

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

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

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

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

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

196 " Error ProtocolHandler . inMessageProcessing<br />

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

307

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

Saved successfully!

Ooh no, something went wrong!