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

123 KeyBuilder .LENGTH_RSA_512) ;<br />

124 phCipherKey = (AESKey) KeyBuilder . buildKey<br />

125 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

126 KeyBuilder .LENGTH_AES_128, f a l s e ) ;<br />

127 syCipher = Cipher . g e t I n s t a n c e ( Cipher .ALG_AES_BLOCK_128_CBC_NOPAD,<br />

128 f a l s e ) ;<br />

129 randomDataGen = RandomData . g e t I n s t a n c e<br />

130 (RandomData .ALG_SECURE_RANDOM) ;<br />

131 pkCipher = Cipher . g e t I n s t a n c e ( Cipher .ALG_RSA_NOPAD, f a l s e ) ;<br />

132 d h I n i t i a l i s a t i o n ( ) ;<br />

133 phSCKeyPair . genKeyPair ( ) ;<br />

134 ph<strong>User</strong>KeyPair . genKeyPair ( ) ;<br />

135 }<br />

136 public s t a t i c void i n s t a l l ( byte bArray [ ] , short bOffset , byte<br />

137 bLength ) throws ISOException {<br />

138 new ProtocolHandler ( ) . r e g i s t e r ( ) ;<br />

139 }<br />

140 public void i n i t i a l i s e P r o t o c o l ( ) {<br />

141 short i n i t i a l P o i n t e r = 0 ;<br />

142 SCDHData = JCSystem . makeTransientByteArray ( ( short ) ( ( short )<br />

143 this . ClassDH . dhModulus . l e n g t h + PTLVDataOffset ) ,<br />

144 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

145 U t i l . arrayCopyNonAtomic ( this . SCDHChalleneTag , ( short )<br />

146 i n i t i a l P o i n t e r , this . SCDHData , ( short ) 0 ,<br />

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

148 this . shortToBytes (SCDHData , ( short ) 4 , ( short ) ( ( short )<br />

149 SCDHData . l e n g t h − ( short ) PTLVDataOffset ) ) ;<br />

150 this . dhKeyConGen( this . SCDHData , this . PTLVDataOffset ,<br />

151 ProtocolHandler .GEN_KEYCONTRIBUTION) ;<br />

152 SPDHChanllengerArray = JCSystem . makeTransientByteArray ( ( short ) (<br />

153 ( short ) this . ClassDH . dhModulus . l e n g t h + this . PTLVDataOffset ) ,<br />

154 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

155 SPRandomNumberArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

156 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

157 SPCookieArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

158 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

159 SCRandomNumberArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

160 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

161 U t i l . arrayCopyNonAtomic ( this . SCRandomNumberTag , ( short )<br />

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

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

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

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

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

167 PTLVDataOffset ) ) ;<br />

168 try {<br />

169 this . S C U s e r C e r t i f i c a t e = JCSystem . makeTransientByteArray ( ( short )<br />

170 86 , JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

171 i n i t i a l P o i n t e r = U t i l . arrayCopyNonAtomic<br />

172 ( this . SC<strong>User</strong>CertificateTag , ( short ) 0 ,<br />

this . S C U s e r C e r t i f i c a t e ,<br />

293

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

Saved successfully!

Ooh no, something went wrong!