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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C.3 Attestation Protocol<br />

252 <strong>for</strong> ( byte b : inArray ) {<br />

253 int v = b & 0xFF ;<br />

254 hex [ index++] = HEX_CHAR_TABLE[ v >>> 4 ] ;<br />

255 hex [ index++] = HEX_CHAR_TABLE[ v & 0xF ] ;<br />

256 }<br />

257 try {<br />

258 return new S t r i n g ( hex , "ASCII" ) ;<br />

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

260 System . out . p r i n t l n ( " Exception in bytesToString : " +<br />

cE . getMessage ( ) )<br />

261 ;<br />

262 }<br />

263 return " Error " ;<br />

264 }<br />

265 void childExtractionFromCTLV ( ConstructedTLV inCTLV) {<br />

266 try {<br />

267 int c h i l d s = inCTLV . getChildNumbers ( ) ;<br />

268 PrimitiveTLV pTemp = null ;<br />

269 ConstructedTLV cTemp = null ;<br />

270 while ( c h i l d s > 0) {<br />

271 switch (inCTLV . nextType ( ) ) {<br />

272 case 1 :<br />

273 pTemp = ( PrimitiveTLV )inCTLV . getNext ( ) ;<br />

274 i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

275 this . SCRandomNumber . getTagName ( ) ) ) {<br />

276 this . SCRandomNumber = pTemp ;<br />

277 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

278 this . MACedData . getTagName ( ) ) ) {<br />

279 this . MACedData = pTemp ;<br />

280 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

281 this . CMCookie . getTagName ( ) ) ) {<br />

282 i f ( Arrays . e q u a l s (pTemp . getBytesTlvRepresentation ( ) ,<br />

283 this . CMCookie . getBytesTlvRepresentation ( ) ) ) {}<br />

284 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

285 this . SCIdentity . getTagName ( ) ) ) {<br />

286 this . SCIdentity = pTemp ;<br />

287 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

288 this . SignedData . getTagName ( ) ) ) {<br />

289 this . SignedData = pTemp ;<br />

290 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

291 this . PublicExponent . getTagName ( ) ) ) {<br />

292 this . PublicExponent = pTemp ;<br />

293 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

294 this . PublicModulus . getTagName ( ) ) ) {<br />

295 this . PublicModulus = pTemp ;<br />

296 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

297 this . Plat<strong>for</strong>mHash . getTagName ( ) ) ) {<br />

298 this . Plat<strong>for</strong>mHash = pTemp ;<br />

299 } else i f ( Arrays . e q u a l s (pTemp . getTagName ( ) ,<br />

300 this . U s e r I d e n t i t y . getTagName ( ) ) ) {<br />

301 this . U s e r I d e n t i t y = pTemp ;<br />

288

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

Saved successfully!

Ooh no, something went wrong!