diff --git a/hwb1/src/hwb1/MyApplet.java b/hwb1/src/hwb1/MyApplet.java index a43e9e6..7dc89d5 100644 --- a/hwb1/src/hwb1/MyApplet.java +++ b/hwb1/src/hwb1/MyApplet.java @@ -12,8 +12,11 @@ import javacard.framework.*; * @author */ public class MyApplet extends Applet { + final static byte PIN_TRY_LIMIT =(byte)0x03; + final static byte MAX_PIN_SIZE =(byte)0x08; private byte[] authorName = new byte[] { 'M', 'a', 'n', 'u', 'e', 'l' }; private byte[] storage = new byte[] {}; + OwnerPIN pin; /** * Installs this applet. @@ -23,13 +26,19 @@ public class MyApplet extends Applet { * @param bLength the length in bytes of the parameter data in bArray */ public static void install(byte[] bArray, short bOffset, byte bLength) { - new MyApplet(); + new MyApplet(byte[] bArray, short bOffset, byte bLength); } /** * Only this class's install method should create the applet object. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray */ - protected MyApplet() { + protected MyApplet(byte[] bArray, short bOffset, byte bLength) { + pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE); + pin.update(bArray, bOffset, bLength); register(); }