From: Hal F. <hal...@gm...> - 2007-09-24 16:35:13
|
Hi Davide - What you received is a TPM_PUBKEY blob. A "blob" is a serialized struct in which pointers are replaced by inline storage of the data. The struct is defined in tpm.h. If all you want is the RSA modulus you can get it from a key handle with: BYTE *modulus; UINT32 modulusLen; Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO, TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &modulusLen, &modulus); Hal On 9/24/07, Davide Vernizzi <dav...@po...> wrote: > Hi all, > > I've experienced this strange problem: > > I've this AIK in a file (it's a 2048 bits key). I load the key from blob > and everything is fine. Then I try to get the public part of the AIK; > the function Tspi_Key_getPubKey returns a TSS_SUCCESS, but when I look > at the size of the key it is 284 byte, which means 2272 bits... why do I > have 224 bits more than expected? > > I add the hexdump of the pubKey: > > key size: 284 > 0000000 0000 0100 0100 0200 0000 0c00 0000 0008 > 0000010 0000 0200 0000 0000 0000 0001 3f8d 1236 > 0000020 8bae 8cab 1ff0 44ea 80e0 7ffc 331f 3212 > 0000030 6dad 65ed 8ccc aad0 518b 03e7 229c 3f53 > 0000040 e3e6 41f9 c31b 089f a5d9 f744 5deb 6c3c > 0000050 5b2d a4e2 2e9f ef38 b109 21b2 5c81 179f > 0000060 4de0 1971 3ed4 044d 8e65 78a3 eaf0 4b46 > 0000070 8a54 cb21 1d3f 601a 94e1 8a17 e7da 7c1a > 0000080 5909 626f 63e2 75f8 c28e 2a47 25e6 ecf3 > 0000090 1b40 f965 e36f 76d8 6eab 8871 f159 19c0 > 00000a0 3e9c 90bd 4910 2dde 89b9 5460 0ebe 7186 > 00000b0 4da8 d3ce 0fd2 d9cf 9221 9be1 046d 6e42 > 00000c0 67f1 db16 7e5d 6c06 f807 ae12 ce2e 1457 > 00000d0 953a b658 be2d 0167 5913 de75 50a2 b470 > 00000e0 8187 acf7 96b7 ee83 30a5 93eb 6ec3 18db > 00000f0 99c1 2421 ad2f 9b0b 6b38 9dba c14f bd2d > 0000100 158e 4eaf cfac af6f d861 711b 39ba 885e > 0000110 b75f d73c 32f6 ce0f 9836 91f4 > > I suspect that the first 28 bytes are the exceeding bytes. > > Any clue? > > Regards. > > -- > Davide |