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.6 Application Acquisition and Contractual Agreement Protocol<br />

85 ConstructedTLV . getConstructedTLV ( this . SC<strong>User</strong>CertificateTag ) ;<br />

86 private ConstructedTLV S C C e r t i f i c a t e = ConstructedTLV . getConstructedTLV<br />

87 ( this . SCCertificateTag ) ;<br />

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

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

90 private PrimitiveTLV U s e r I d e n t i t y = PrimitiveTLV . getPrimitiveTLV<br />

91 ( this . <strong>User</strong>IdentityTag ) ;<br />

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

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

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

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

96 private PublicKey SC<strong>User</strong>VerificationKey = null ;<br />

97 private PublicKey SCVerificationKey = null ;<br />

98 public S e r v i c e P r o v i d e r P r o t o c o l H a n d l e r ( ) {<br />

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

100 RSAPublicKey tempKey = ( RSAPublicKey )<br />

101 myProtocolHelperObject . getPublicKey ( ) ;<br />

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

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

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

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

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

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

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

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

110 1) ) ;<br />

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

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

113 }<br />

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

115 try {<br />

116 this . SPDHChanllenger . setTlvValues<br />

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

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

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

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

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

122 }<br />

123 }<br />

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

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

126 try {<br />

127 this . SPRandomNumber . setTlvValues<br />

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

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

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

131 this . SPDHChanllenger . getValueLength ( ) +<br />

132 this . SPRandomNumber . getValueLength ( ) ) ] ;<br />

133 System . arraycopy ( this . SPDHChanllenger . getValueBytes ( ) , 0 , temp , 0 ,<br />

134 this . SPDHChanllenger . getValueLength ( ) ) ;<br />

352

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

Saved successfully!

Ooh no, something went wrong!