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

173 ( short ) 0 ,<br />

( short ) this . SC<strong>User</strong>CertificateTag . l e n g t h ) ;<br />

174 this . shortToBytes ( this . S C U s e r C e r t i f i c a t e , ( short ) 4 , ( short )<br />

175 ( this . S C U s e r C e r t i f i c a t e . l e n g t h − ( short ) 7) ) ;<br />

176 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic ( this . ExponentTag ,<br />

177 ( short ) 0 , this . S C U s e r C e r t i f i c a t e , ( short ) ( i n i t i a l P o i n t e r +<br />

178 ( short ) 3) , ( short ) this . ExponentTag . l e n g t h ) ;<br />

179 RSAPublicKey myPublic = ( RSAPublicKey )<br />

180 this . ph<strong>User</strong>KeyPair . g e t P u b l i c ( ) ;<br />

181 short kLen = myPublic . getExponent ( this . S C U s e r C e r t i f i c a t e ,<br />

182 ( short ) ( i n i t i a l P o i n t e r + ( short ) 2) ) ;<br />

183 this . shortToBytes ( this . S C U s e r C e r t i f i c a t e , i n i t i a l P o i n t e r , kLen ) ;<br />

184 i n i t i a l P o i n t e r += ( short ) ( kLen + ( short ) 2) ;<br />

185 this . S C U s e r C e r t i f i c a t e [6]++;<br />

186 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic ( this . ModulusTag ,<br />

187 ( short ) 0 , this . S C U s e r C e r t i f i c a t e , ( short ) ( i n i t i a l P o i n t e r ) ,<br />

188 ( short ) this . ModulusTag . l e n g t h ) ;<br />

189 kLen = myPublic . getModulus ( this . S C U s e r C e r t i f i c a t e , ( short )<br />

190 ( i n i t i a l P o i n t e r + ( short ) 2) ) ;<br />

191 this . shortToBytes ( this . S C U s e r C e r t i f i c a t e , i n i t i a l P o i n t e r , kLen ) ;<br />

192 this . S C U s e r C e r t i f i c a t e [6]++;<br />

193 this . SPIdentity = JCSystem . makeTransientByteArray ( ( short ) 24 ,<br />

194 JCSystem .MEMORY_TYPE_TRANSIENT_RESET) ;<br />

195 SPVerificationKey = ( RSAPublicKey ) KeyBuilder . buildKey<br />

196 ( KeyBuilder .TYPE_RSA_PUBLIC,<br />

197 KeyBuilder .LENGTH_RSA_512, f a l s e ) ;<br />

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

199 ISOException . throwIt ( ( short ) 0xCCCC) ;<br />

200 }<br />

201 try {<br />

202 this . S C C e r t i f i c a t e = JCSystem . makeTransientByteArray ( ( short ) 86 ,<br />

203 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

204 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic ( this . SCCertificateTag ,<br />

205 ( short ) 0 , this . S C C e r t i f i c a t e , ( short ) 0 ,<br />

( short )<br />

206 this . SCCertificateTag . l e n g t h ) ;<br />

207 this . shortToBytes ( this . S C C e r t i f i c a t e , ( short ) 4 , ( short )<br />

208 ( this . S C C e r t i f i c a t e . l e n g t h − ( short ) 7) ) ;<br />

209 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic ( this . ExponentTag ,<br />

210 ( short ) 0 , this . S C C e r t i f i c a t e ,<br />

( short ) ( i n i t i a l P o i n t e r + ( short )<br />

211 3) , ( short ) this . ExponentTag . l e n g t h ) ;<br />

212 RSAPublicKey myPublic = ( RSAPublicKey )<br />

213 this . phSCKeyPair . g e t P u b l i c ( ) ;<br />

214 short kLen = myPublic . getExponent ( this . S C C e r t i f i c a t e , ( short )<br />

215 ( i n i t i a l P o i n t e r + ( short ) 2) ) ;<br />

216 this . shortToBytes ( this . S C C e r t i f i c a t e , i n i t i a l P o i n t e r , kLen ) ;<br />

217 i n i t i a l P o i n t e r += ( short ) ( kLen + ( short ) 2) ;<br />

218 this . S C C e r t i f i c a t e [6]++;<br />

219 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic ( this . ModulusTag ,<br />

294

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

Saved successfully!

Ooh no, something went wrong!