Hi, > -----Original Message----- > From: NdK [mailto:ndk.cla...@gmail.com] > > On 15/02/2011 11:17, Toni Sjoblom - Aventra wrote: > > > Current MyEID cards are 80K, but some of this space is used by the MyEID > > applet itself. > > > > The file size you see in the 3F00 file is the remaining free space, > but due > > to a limitation of java cards in general, as Martin mentioned, 32k is the > > largest number for signed short. > > This only shows that you have at least this amount o space left. To > get to > > know how much space you actually have left, you could create a file > that is > > 32k, and the see how much space is left. Then if you still get the > maximum > > (32k), then create another 32k file and then see the results. By > > adding these values together you get the actual space. > Now testing has started. > Actual free space available is about 60K (~20k of the 80k are used by > Aventra's app, as you said). > After init w/ my modified sizes, I could create 3 files of 16384bytes > and there were about 10K still free. > > > A single key (private or public) needs typically 70-90 bytes in the > dir file > > (index file). The actual amount depends on the label length. > > One 1024bit RSA key pair takes 512bytes and one 2048bit key pair takes > > 960bytes. > I have 4 client certs, all from StartSSL (so they have one common "root" > CA and 2 different "intermediate" CAs). pkcs15-init, rightfully, stores > a single copy of the duplicate certs. > > After loading those certs, I have: > $ opensc-explorer > OpenSC Explorer version 0.12.0 > Using reader with a card: Gemalto GemPC Twin 00 00 > OpenSC [3F00]> cd 5015 > OpenSC [3F00/5015]> info > > Dedicated File ID 5015 > > File path: 3F00/5015 > File size: 28548 bytes > DF name: \xA0\x00\x00\x00cPKCS-15 > ACL for SELECT: N/A > ACL for LOCK: N/A > ACL for DELETE: CHV1 > ACL for CREATE: CHV1 > ACL for REHABILITATE: N/A > ACL for INVALIDATE: N/A > ACL for LIST FILES: N/A > ACL for CRYPTO: N/A > ACL for DELETE SELF: N/A > Proprietary attributes: 00 02 > Security attributes: 11 1F FF > > OpenSC [3F00/5015]> ls > FileID Type Size > 4401 wEF 384 > 5031 wEF 256 > 5032 wEF 57 > 4946 wEF 128 > 4B01 iEF 2048 > 4402 wEF 2880 > 4301 wEF 1682 > 4404 wEF 8640 > 4302 wEF 1997 > 4303 wEF 2022 > 4B02 iEF 2048 > 4304 wEF 1700 > 4305 wEF 1592 > 4B03 iEF 2048 > 4306 wEF 1700 > 4B04 iEF 2048 > 4307 wEF 1740 > 4308 wEF 1592 > OpenSC [3F00/5015]> > > Now I generate a keypair (rsa/2048) and I see only 24052 bytes free. So > a 2048bit key requires 4496 bytes, that's quite a lot more than 960 > bytes Toni said... But that's partially explained by the fact that these > are the new files I find: > 4B05 iEF 2048 > 5501 wEF 270 > 4403 wEF 2880 > So there are 2880 bytes less to consider. > But 2048+270 remains a lot more than 960... > > Seems the private key uses 1 byte for every bit. If I use -G rsa/1024 > its EF 4Bxx is 1024 bytes. Is that normal?
The private key files sizes are shown in bits not bytes. A 1K private key uses approx. 960 bytes and 2K respectively approx. 1296 bytes. This consists of both the private and public parts. The DIR files do not grow when creating new files, they are created once during initialization with a size that's defined in the driver's profile. Kind regards, Toni > BYtE! _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel