Dear Jeff,

>From my first level of understanding, it looks like GemSAFE crypto 
>modules(PKCS#11/CSP) 'compress' the certificate before actually storing it onto the 
>card. This is evident from the fact that the actual size of the content(Certificate) 
>stored on the card is slightly less that the BER/DER size.

To confirm, you can do a card->information from Card Details Tool. 
You should be seeing something like this

Real Size: 1671 bytes, Size occupied in the card: 1269 bytes

----------
Shared grief is half the sorrow, but happiness when shared, is doubled.
- Anonymous 


>-----Original Message-----
>From: Jeff Undercoffer [mailto:[EMAIL PROTECTED]]
>Sent: Monday, March 26, 2001 8:37 PM
>To: [EMAIL PROTECTED]
>Subject: [OCF] GPK card - Reading certificate
>
>
>I am attempting to read a Verisign certificate from a GPK card, write the
>certificate to disk, then view the certificate.
>
>I believe the certificate to be located at 3F00:0200:0004 and am reading
>with the following code:
>
>
>CardRequest cr = new CardRequest(FileAccessCardService.class);
>SmartCard sc = SmartCard.waitForCard(cr);
>FileAccessCardService facs = (FileAccessCardService)
>sc.getCardService(FileAccessCardService.class, true);
>CardFile file = new CardFile(facs, ":0200:0004");
>byte[] data = facs.read(file.getPath(), 0,  file.getLength());
>
>I am writing it with the following code:
>
>File to_file = new File("some.cer");
>FileOutputStream out = new FileOutputStream(to_file);
>out.write(data, 0, file.getLength());
>sc.close();
>
>Accordingly, I read 1595 bytes from the card and write 1595 bytes to the
>file, however, the certificate view in Windows reports that the file is an
>invalid security certificate file.
>
>Can anyone offer some advise on how to correct this?
>



---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe 
! in the body.

Reply via email to