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