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.3 Attestation Protocol<br />

107 this . PublicExponent . setTlvValues ( tempExponent ) ;<br />

108 byte [ ] tempModulus = tempKey . getModulus ( ) . toByteArray ( ) ;<br />

109 this . PublicModulus . i n i t i a l i s a t i o n P T L V ( this . PublicModulusTag ,<br />

110 ( tempModulus . l e n g t h − 1) ) ;<br />

111 this . PublicModulus . setTlvValues ( tempModulus , 1 , ( tempModulus . l e n g t h −<br />

112 1) ) ;<br />

113 CMSignatureCertificate . addPTLV( this . PublicExponent ) ;<br />

114 CMSignatureCertificate . addPTLV( this . PublicModulus ) ;<br />

115 }<br />

116 public byte [ ] outMessageProcessing ( int Counter ) {<br />

117 i f ( Counter == 1) {<br />

118 try {<br />

119 this . CMRandomNumber . setTlvValues<br />

120 ( this . myProtocolHelperObject . getRandomNumber ( ) ) ;<br />

121 this . MessageHandler . addPTLV( this . CMRandomNumber) ;<br />

122 byte [ ] temp = new byte [ ( this . S C P r o t o c o l I n i t i a t o r . getValueBytes ( )<br />

123 . l e n g t h +<br />

124 this . CMRandomNumber . getValueLength ( ) ) ] ;<br />

125 System . arraycopy ( this . CMRandomNumber . getValueBytes ( ) , 0 , temp ,<br />

126 0 , this . CMRandomNumber . getValueLength ( ) ) ;<br />

127 System . arraycopy ( this . S C P r o t o c o l I n i t i a t o r . getValueBytes ( ) , 0 ,<br />

temp ,<br />

128 temp . l e n g t h −<br />

129 this . S C P r o t o c o l I n i t i a t o r . getValueBytes ( ) . length ,<br />

130 this . S C P r o t o c o l I n i t i a t o r . getValueBytes ( ) . l e n g t h ) ;<br />

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

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

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

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

135 this . MessageHandler . addPTLV( this . CMCookie ) ;<br />

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

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

138 " Error ProtocolHandler . inMessageProcessing<br />

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

139 }<br />

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

141 try {<br />

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

143 this . EncryptedData . addPTLV( this . CMIdentityTLV ) ;<br />

144 this . EncryptedData . addPTLV( this . SCIdentity ) ;<br />

145 this . EncryptedData . addPTLV( this . CMRandomNumber) ;<br />

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

147 this . myProtocolHelperObject . SignatureMethod<br />

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

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

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

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

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

153 this . EncryptedData . addCTLV( this . CMSignatureCertificate ) ;<br />

154 this . myProtocolHelperObject . GenerateEncryption<br />

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

285

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

Saved successfully!

Ooh no, something went wrong!