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.9 Plat<strong>for</strong>m Binding Protocol<br />

149 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

150 SCBRandomNumberArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

151 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

152 U t i l . arrayCopyNonAtomic ( this . SCBRandomNumberTag , ( short )<br />

153 i n i t i a l P o i n t e r , this . SCBRandomNumberArray ,<br />

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

155 this . SCBRandomNumberTag . l e n g t h ) ;<br />

156 this . shortToBytes ( this . SCBRandomNumberArray , ( short ) 4 , ( short ) (<br />

157 ( short ) this . SCBRandomNumberArray . l e n g t h − ( short )<br />

158 PTLVDataOffset ) ) ;<br />

159 try {<br />

160 this . SCBCertificate = JCSystem . makeTransientByteArray ( ( short ) 86 ,<br />

161 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

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

163 ( short ) 0 , this . SCBCertificate , ( short ) 0 ,<br />

( short )<br />

164 this . SCBCertificateTag . l e n g t h ) ;<br />

165 this . shortToBytes ( this . SCBCertificate , ( short ) 4 , ( short )<br />

166 ( this . SCBCertificate . l e n g t h − ( short ) 7) ) ;<br />

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

168 ( short ) 0 , this . SCBCertificate ,<br />

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

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

170 RSAPublicKey myPublic = ( RSAPublicKey )<br />

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

172 short kLen = myPublic . getExponent ( this . SCBCertificate , ( short )<br />

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

174 this . shortToBytes ( this . SCBCertificate , i n i t i a l P o i n t e r , kLen ) ;<br />

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

176 this . SCBCertificate [6]++;<br />

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

178 ( short ) 0 , this . SCBCertificate ,<br />

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

179 this . ModulusTag . l e n g t h ) ;<br />

180 kLen = myPublic . getModulus ( this . SCBCertificate , ( short )<br />

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

182 this . shortToBytes ( this . SCBCertificate , i n i t i a l P o i n t e r , kLen ) ;<br />

183 this . SCBCertificate [6]++;<br />

184 SCAVerificationKey = ( RSAPublicKey ) KeyBuilder . buildKey<br />

185 ( KeyBuilder .TYPE_RSA_PUBLIC,<br />

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

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

188 ISOException . throwIt ( ( short ) 0 x6666 ) ;<br />

189 }<br />

190 }<br />

191 public void p r o c e s s (APDU apdu )throws ISOException {<br />

192 byte [ ] apduBuffer = apdu . g e t B u f f e r ( ) ;<br />

193 i f ( s e l e c t i n g A p p l e t ( ) ) {<br />

194 this . i n i t i a l i s e P r o t o c o l ( ) ;<br />

195 return ;<br />

196 }<br />

421

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

Saved successfully!

Ooh no, something went wrong!