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

98 private PrimitiveTLV PublicExponent = PrimitiveTLV . getPrimitiveTLV<br />

99 ( this . PublicExponentTag ) ;<br />

100 private PrimitiveTLV Plat<strong>for</strong>mHash = PrimitiveTLV . getPrimitiveTLV<br />

101 ( this . Plat<strong>for</strong>mHashTag ) ;<br />

102 public ConstructedTLV MessageHandler =<br />

103 ConstructedTLV . getConstructedTLV ( MessageHandlerTagOne ) ;<br />

104 private PrimitiveTLV MACedData = PrimitiveTLV . getPrimitiveTLV<br />

105 ( this . MACedDataTag) ;<br />

106 private ConstructedTLV EncryptedData =<br />

107 ConstructedTLV . getConstructedTLV ( this . EncryptedDataTag ) ;<br />

108 private P r o t o c o l H e l p e r C l a s s myProtocolHelperObject = new<br />

109 P r o t o c o l H e l p e r C l a s s ( ) ;<br />

110 private byte [ ] mySessionEncryptionKey = new byte [ 1 6 ] ;<br />

111 private byte [ ] mySessionMacKey = new byte [ 1 6 ] ;<br />

112 public ProtocolHandler ( ) {<br />

113 myProtocolHelperObject . p r o t o c o l I n i t i a l i s e ( ) ;<br />

114 RSAPublicKey tempKey = ( RSAPublicKey )<br />

115 myProtocolHelperObject . getPublicKey ( ) ;<br />

116 byte [ ] tempExponent = tempKey . getPublicExponent ( ) . toByteArray ( ) ;<br />

117 this . PublicExponent . i n i t i a l i s a t i o n P T L V ( this . PublicExponentTag ,<br />

118 tempExponent . l e n g t h ) ;<br />

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

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

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

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

123 this . PublicModulus . setTlvValues ( tempModulus , 1 ,<br />

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

125 S P S i g n a t u r e C e r t i f i c a t e . addPTLV( this . PublicExponent ) ;<br />

126 S P S i g n a t u r e C e r t i f i c a t e . addPTLV( this . PublicModulus ) ;<br />

127 }<br />

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

129 try {<br />

130 this . SPDHChanllenger . setTlvValues<br />

131 ( this . myProtocolHelperObject . GenerateDHPublicValue ( ) ) ;<br />

132 this . MessageHandler . addPTLV( this . SPDHChanllenger ) ;<br />

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

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

135 " Error ProtocolHandler . i n i t i a l i s e P r o t o c o l Option<br />

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

136 }<br />

137 }<br />

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

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

140 try {<br />

141 this . SPRandomNumber . setTlvValues<br />

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

143 this . MessageHandler . addPTLV( this . SPRandomNumber) ;<br />

144 byte [ ] temp = new byte [ ( this . SCIP . l e n g t h +<br />

145 this . SPDHChanllenger . getValueLength ( )<br />

146 + this . SPRandomNumber . getValueLength ( )<br />

147 ) ] ;<br />

306

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

Saved successfully!

Ooh no, something went wrong!