Hello,

Candy Ho Pui Shan wrote:
> I am new in writing JavaCard.  I have modified a Java
> application (OPPurse) given by Gemplus.  It works even
> I did not download any Java Communication package,
> [...]
> Could anyone tell me why that there is no need to use
> the communication package for Java application?  I
> don't know why it needn't, as it still needs to use a
> serial port for the smart card reader.
> 

I would advice to have a look at the Fig 1 of the following URL:

http://www.gemplus.fr/developers/technologies/opencard/doc/prerequisites.html

It explains why you need "at least" one way to access the OS serial
port layers. You wouldn't need the Comm API in case you were using a 
CardTerminal that is a wrapper arround PC/SC or the CTAPI (as one
was posted very recently), but you need it in case you are using
a CardTerminal that accesses javax.comm (you bet! :-). We call that
a "pure-java" CardTerminal, even if Comm is also using JNI, because
in this case the API is standardized and so your CardTerminal is
fully portable on all platforms.

Now there is also a fourth possibility: GemXpresso RAD includes
yet another CardTerminal that is using neither javax.comm nor
PC/SC: it uses sockets to send commands to a JavaCard simulator
process instead of the reader/card! So this might also be what you
have used in the first tests (or it might be PC/SC).

In any case, it all depends on the type of CardTerminalFactory
you are specifying in your opencard.properties. In order to find
which opencard.properties is used, you can compile and run the
small program below (contributed by Jan Peter Hecking from IBM;
I modified it slightly to see "/" instead of "\" on Linux! :-D).

findOCP.java:
 - - - - - - cut here - - - - - - 

import java.io.File;
import java.util.Properties;

public class findOCP {
    public static void main(String[] argv) {
        final String sep = File.separator;
        Properties props = System.getProperties();
        String JavaHome  = props.getProperty("java.home");
        String UserHome  = props.getProperty("user.home");
        String UserDir   = props.getProperty("user.dir");

        System.out.println("Looking for OpenCard Properties file
in:\n\t"
                           + JavaHome + sep + "lib" + sep 
                           + "opencard.properties\n\t"
                           + UserHome + sep + ".opencard.properties\n\t"
                           + UserDir  + sep + "opencard.properties\n\t"
                           + UserDir  + sep + ".opencard.properties\n");
    }
}
 - - - - - - cut here - - - - - - 

Hope it'll help to clarify why or why not Comm is needed.


Candy Ho Pui Shan wrote:
> When using Java Communication API with Swing, I have
> discovered an error saying that I missed a file
> permission about the "delete" of the file
> "javax.comm.properties".  After I modified the
> "java.policy" file, the codes work and the properties
> file has not been deleted. Do you know why I have to
> provide the delete permission?

This is a problem with the Comm API. I actually had to also
specify "read,write,delete" in my policy file for applets :-(.

In fact there are other problems with the Comm API and Java2
security, like the exception at init phase (the well known
"name can't be null" error message), see my previous message
from Aug. 21 on this topic. 

The problem is that the current implementation has been written
in 98 with the Java1 security model in mind and we are waiting
for a new realase adapted for Java2 (there is actually one version
for Solaris that has been out for a few weeks, I haven't tried it
yet, maybe it solves these problems).

Cheers,
Christophe.

 = On the side of the software box, in the system requirements =
 = section it said "Requires Windows 95 or better." ...        =
 = So I installed FreeBSD.     -- [EMAIL PROTECTED]            =
--
-------------------------------------------------------------
[EMAIL PROTECTED] - Gemplus Research Lab
Phone: +33 4-42-36-57-83 | Disclaimer: I don't speak for Gemplus
Gemplus doesn't speak for me... it is better that way!
-------------------------------------------------------------


---
> 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