Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc - 26.02.02 - page 1 Programming.

Slides:



Advertisements
Similar presentations
JAVA Revision Lecture Electronic Voting System Marina De Vos.
Advertisements

Java Card Programming: Overview Presented by: Raman Sharykin PISCES Group: Soumyadeb Mitra, Sruthi Bandhakavi, Ragib Hasan, Raman Sharikyn University.
Java Card Technology Ch04: Java Card Object
AITI Lecture 19 Linked List Adapted from MIT Course 1.00 Spring 2003 Lecture 26 and Tutorial Note 9 (Teachers: Please do not erase the above note)
Core Java Lecture 4-5. What We Will Cover Today What Are Methods Scope and Life Time of Variables Command Line Arguments Use of static keyword in Java.
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Java Card Technology Ch07: Applet Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer Science & Engineering.
Written by: Dr. JJ Shepherd
Programming Smart Cards Rajnish Kumar Comp527.. Expect to learn Cardlet Development Installation Coke Machine Interface Implementation Basic Cryptography.
Java Card Technology Ch06: Exception and Exception Handling Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
Introduction to Object-Oriented Programming CS 21a: Introduction to Computing I First Semester,
Java review and more. Class Header  Public class Welcome  Case sensitive  Body of the class must be enclosed by braces.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
Java Syntax Primitive data types Operators Control statements.
1 Further OO Concepts II – Java Program at run-time Overview l Steps in Executing a Java Program. l Loading l Linking l Initialization l Creation of Objects.
March 2005Java Programming1. March 2005Java Programming2 Why Java? Platform independence Object Oriented design Run-time checks (fewer bugs) Exception.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Programming Languages and Paradigms Object-Oriented Programming.
Java. Why Java? It’s the current “hot” language It’s almost entirely object-oriented It has a vast library of predefined objects It’s platform independent.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Assertions Program correctness. Assertions Java statement – enables you to assert an assumption about your program. – An assertion contains a Boolean.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
CSC 213 – Large Scale Programming. Why Do We Test?
Java: Chapter 1 Computer Systems Computer Programming II.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Global Platform Presentation C:\Path - filename - san page 1 Open Platform on Java Card Introduction by Ingeborg Sandow.
The Java Programming Language
Using Client-Side Scripts to Enhance Web Applications 1.
Java Card Technology Ch09: Applet Firewall and Object Sharing Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Page: 1 การโปรแกรมเชิงวัตถุด้วยภาษา JAVA บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 15 มิถุนายน 2552 Keyword & Data Type มหาวิทยาลัยเนชั่น.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Programming with Assertions © Allan C. Milne v
11/28/2015B.Ramamurthy1 Object-Oriented Design and Java B.Ramamurthy.
CSC 212 Object-Oriented Programming and Java Part 2.
Java Card Technology Ch08: Working with APDUs
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
Creating a Java Application and Applet
Overview of Servlets and JSP
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Written by: Dr. JJ Shepherd
Java Card Technology Ch05: Atomicity and transactions Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Introduction to Microprocessor Cards 하남수
1. Presentation Agenda  Identify Java Card Technology  Identify Elements of Java Card applications  Communicating with a Java Card Applet  Java Card.
C++ Lesson 1.
3 Introduction to Classes and Objects.
Yanal Alahmad Java Workshop Yanal Alahmad
Yanal Alahmad Java Workshop Yanal Alahmad
University of Central Florida COP 3330 Object Oriented Programming
Objects, Classes, Program Constructs
Java RMI (more) CS-328 Internet Programming.
Potential Risks for Smart Cards Firmware
Chapter 3 Introduction to Classes, Objects Methods and Strings
null, true, and false are also reserved.
Introduction to Java Programming
An Introduction to Java – Part I, language basics
An overview of Java, Data types and variables
JavaScript Reserved Words
Object Oriented Programming in java
Instructor: Alexander Stoytchev
Comparing Data & the ‘switch’ Statement
Comparing Data & the ‘switch’ Statement
Agenda Types and identifiers Practice Assignment Keywords in Java
Presentation transcript:

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 1 Programming a Java Card The Applet Model –Installation Create an applet instance Register the applet with the JCRE –Selection Select the applet, do some initialization –Processing Process commands send from the host –Deselection Clean up and state saving – get SIO Deliver the reverence of the own instance Applet Install Select Process Deselect getShareableInterfaceObject

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 2 Programming a Java Card (2) Installation –Create an Applet instance –Call the Constructor –Create Applet objects –Register the Applet with the JCRE –Do Error Handling package com.gieseckedevrient.applets.myfirst; import javacard.framework.*; public class MyFirst extends Applet { // // Constructor // private MyFirst () { register (); } // -- END - static elements // // Install method // public static void install(byte[] buffer, short offset, byte length) { new MyFirst(); } // -- END - Public static void install(... )

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 3 Programming a Java Card (3) Selection / Deselection –When an ISO select command is received –JCRE checks if the AID corresponds to an registered applet –If so, the active applet is first deselected and the applet with the correct AID is selected –Otherwise the command is transfered to the selected applet for processing Command Processing – Get the APDU buffer –Decode the command header –Receive command data if needed –Perform command –Send response –Throw ISOException if status is not 90 00

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 4 Programming a Java Card (8) - Processing (1) public void process(APDU o_apdu) throws ISOException { if( selectingApplet() ) { m_sz_Verified = false; return; } byte[] ba_buffer = o_apdu.getBuffer(); //Examination of the buffer. switch( ba_buffer[ ISO7816.OFFSET_INS ] ) { //PIN Verification as defined in ISO case VERIFY: // s_databytes = receive( o_apdu ); s_dataoffset = Util.getShort( ba_buffer, ISO7816.OFFSET_P1 ); b_result = Util.arrayCompare( ba_buffer, (short) (ISO7816.OFFSET_CDATA & 0x00FF), m_sba_aPin, (short)0, s_databytes );

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 5 Programming a Java Card (8) - Processing (2) if( b_result == (byte)0x00 ) { m_sz_Verified = true; } else ISOException.throwIt( ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED ); break; case READ: // if( !m_sz_Verified ) ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED); o_apdu.setOutgoing(); o_apdu.setOutgoingLength( (short) 80 ); o_apdu.sendBytesLong( m_sba_userdata, (short)0, (short)80 ); break; default : // ISOException.throwIt( ISO7816.SW_INS_NOT_SUPPORTED ); } } // -- END - public void process(... ) throws ISOException

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 6 Programming a Java Card (1) The ISO-7816 APDU communication model Command APDU Response APDU Host Java Card

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 7 Programming a Java Card (2) Command APDU –CLA - indicates the type of command (ISO, prop.) –INS - specifies the instruction to be performed –P1 and P2 - instruction parameters –Lc - number of bytes in the data field –Data - command optional data –Le - number of bytes expected in the response Header (mandatory) CLAINSP1P2 Body (optional) LcDATALe

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 8 Programming a Java Card (3) Response APDU –Data - command optional response –SW1 and SW2 - status word Trailer (mandatory)Body (optional) SW1DATASW2

Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 9 Programming a Java Card (4) Naming conventions in Java Card All named resources use ISO AIDs Named resources are –Packages (for loading, linking and deletion) –Applet Classes (for installation of applets) –Applet Instances (the real card applications) 0 to 11 bytes PIX proprietary identifier extension RID register identifier 5 bytes