What if the datalen is more? i study a datapacket as per
http://msdn.microsoft.com/en-us/library/cc240519%28v=prot.10%29.aspx[
^] .. following are my bytes.
- serverCertBytes {byte[376]} byte[]
1,0,0,0,-- dwVersion
1,0,0,0,-- dwSigAlgId
1,0,0,0,-- dwKeyAlgId
6,0,--wPublicKeyBlobType
28,1,-- wPublicKeyBlobLen(i got it 284 bytes)
RSA_PUBLIC_KEY (284 bytes)
82,83,65,49,-magic
8,1,0,0-keylen(264 bytes)
,0,8,0,0-bitlen(2048 bits)
,255,0,0-datalen(255 bytes)
,0,1,0,1 - pubExp
(264 bytes of modulus)
,0,137,190,64,171,40,184,132,120,155,35,166,235,51,241,219,17,79,73,74,133,66,218,184,120,132,239,138,37,143,168,247,223,161,99,94,159,225,122,144,160,62,210,203,241,248,51,35,152,209,24,70,244,59,5,190,141,251,204,168,187,72,92,202,42,12,90,67,33,107,82,132,40,69,215,122,204,97,171,35,155,60,137,182,23,67,124,86,243,120,75,202,78,95,251,152,51,216,111,235,189,186,11,177,117,109,77,23,224,254,13,189,190,154,229,32,200,104,201,31,170,55,12,200,212,24,236,137,164,38,0,166,222,128,107,236,83,191,14,174,60,248,73,128,141,16,141,139,199,144,82,24,176,3,122,66,3,63,168,107,56,255,98,36,186,124,228,89,100,239,126,46,230,132,17,217,86,45,200,83,134,81,6,13,66,255,193,30,112,190,225,78,58,1,44,194,152,35,200,143,136,250,193,202,31,21,162,164,79,89,28,133,61,90,209,236,170,238,126,108,84,197,106,187,87,90,70,139,85,145,18,86,17,90,98,242,73,232,41,229,128,12,155,77,43,217,131,167,124,98,76,64,189,213,141,145,204,0,0,0,0,0,0,0,0,
...RSA_PUBLIC_KEY over...
8,0 -- wSignatureBlobType
,72,0,-- wSignatureBlob(72 bytes)
(signatureblob)
162,66,43,141,202,44,3,186,56,9,170,154,11,79,96,20,164,184,123,218,8,157,125,190,72,119,18,91,109,146,245,173,60,253,135,193,70,63,193,63,141,96,249,155,87,95,33,84,174,7,240,231,29,12,27,231,170,169,202,127,241,58,128,25,0,0,0,0,0,0,0,0,
I study my packet its datalen 255 bytes and bitlen 2048 bits.
I also Calculate the signature as per
http://msdn.microsoft.com/en-us/library/cc240778%28v=prot.10%29.aspx[
^] ,
I took hash as , First 16 bytes as MD5 hash, 17th byte(index 16) set to 0x00 and last byte (255 Index) to 0x01 and rest were 0xff.
I got signature length 255 bytes long. but as per the packet received its of 72 bytes only. I don't know where was my mistake.?