`Interface
`
`Sun Microsystems, Inc.
`901 San Antonio Road
`Palo Alto, CA 94303 USA
`650 960-1300
`
`Final Revision 1.0, February 24, 1999
`
`SAMSUNG 1013
`
`1
`
`
`
`Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94043 USA.
`All rights reserved. Copyright in this document is owned by Sun Microsystems, Inc.
`
`Sun Microsystems, Inc. (SUN) hereby grants to you at no charge a nonexclusive, nontransferable, worldwide, limited license
`(without the right to sublicense) under SUN’s intellectual property rights that are essential to practice the Java Card API
`Specification ("Specification") to use the Specification for internal evaluation purposes only. Other than this limited license, you
`acquire no right, title, or interest in or to the Specification and you shall have no right to use the Specification for productive or
`commercial use.
`
`RESTRICTED RIGHTS LEGEND
`
`Use, duplication, or disclosure by the U.S. Government is subject to restrictions of FAR 52.227-14(g)(2)(6/87) and FAR 52.227-
`19(6/87), or DFAR 252.227-7015(b)(6/95) and DFAR 227.7202-1(a).
`
`SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER
`EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
`FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY
`DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE
`OR ITS DERIVATIVES.
`
`TRADEMARKS
`
`Sun, the Sun logo, Sun Microsystems, JavaSoft, JavaBeans, JDK, Java, Java Card, HotJava, HotJava Views, Visual Java, Solaris,
`NEO, Joe, Netra, NFS, ONC, ONC+, OpenWindows, PC-NFS, EmbeddedJava, PersonalJava, SNM, SunNet Manager, Solaris
`sunburst design, Solstice, SunCore, SolarNet, SunWeb, Sun Workstation, The Network Is The Computer, ToolTalk, Ultra,
`Ultracomputing, Ultraserver, Where The Network Is Going, Sun WorkShop, XView, Java WorkShop, the Java Coffee Cup logo,
`and Visual Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
`
`THIS PUBLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
`IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
`FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD
`INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY
`ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS
`OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN
`THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.
`
`2
`
`
`
`Java Card API
`
`Table of Contents
`Overview
`.
`.
`.
`.
`.
`.
`.
`.
`Class Hierarchy
`.
`.
`.
`.
`.
`.
`Package java.lang
`.
`.
`.
`.
`.
`.
`Class ArithmeticException
`.
`.
`.
`.
`Class ArrayIndexOutOfBoundsException
`Class ArrayStoreException
`.
`.
`.
`.
`Class ClassCastException
`.
`.
`.
`.
`Class Exception
`.
`.
`.
`.
`.
`.
`.
`Class IndexOutOfBoundsException
`.
`.
`Class NegativeArraySizeException
`.
`.
`Class NullPointerException
`.
`.
`.
`.
`Class Object
`.
`.
`.
`.
`.
`.
`.
`Class RuntimeException
`.
`.
`.
`.
`Class SecurityException
`.
`.
`.
`.
`.
`Class Throwable
`.
`.
`.
`.
`.
`.
`Package javacard.framework
`.
`.
`.
`Class AID
`.
`.
`.
`.
`.
`.
`.
`.
`Class APDU
`.
`.
`.
`.
`.
`.
`.
`Class APDUException
`.
`.
`.
`.
`.
`Class Applet
`.
`.
`.
`.
`.
`.
`.
`Class CardException
`.
`.
`.
`.
`.
`Class CardRuntimeException
`.
`.
`.
`Interface ISO7816
`.
`.
`.
`.
`.
`.
`Class ISOException
`.
`.
`.
`.
`.
`.
`Class JCSystem
`.
`.
`.
`.
`.
`.
`.
`Class OwnerPIN
`.
`.
`.
`.
`.
`.
`Interface PIN
`.
`.
`.
`.
`.
`.
`.
`Class PINException
`.
`.
`.
`.
`.
`.
`Interface Shareable
`.
`.
`.
`.
`.
`.
`Class SystemException
`.
`.
`.
`.
`.
`Class TransactionException
`.
`.
`.
`.
`Class UserException
`.
`.
`.
`.
`.
`Class Util
`.
`.
`.
`.
`.
`.
`.
`.
`Package javacard.security
`.
`.
`.
`.
`Class CryptoException
`.
`.
`.
`.
`.
`Interface DESKey
`.
`.
`.
`.
`.
`.
`Interface DSAKey
`.
`.
`.
`.
`.
`.
`Interface DSAPrivateKey
`.
`.
`.
`.
`Interface DSAPublicKey
`.
`.
`.
`.
`Interface Key
`.
`.
`.
`.
`.
`.
`
`.
`
`Java Card 2.1 API
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`1
`4
`6
`9
`11
`13
`15
`17
`19
`21
`23
`25
`27
`29
`31
`33
`35
`39
`51
`56
`63
`66
`69
`76
`78
`87
`92
`95
`98
`99
`103
`107
`110
`117
`119
`123
`125
`129
`131
`133
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. i
`
`3
`
`
`
`Java Card 2.1 API
`
`.
`
`Class KeyBuilder
`.
`.
`Class MessageDigest
`.
`.
`Interface PrivateKey
`.
`.
`Interface PublicKey
`.
`.
`.
`Interface RSAPrivateCrtKey
`Interface RSAPrivateKey
`.
`Interface RSAPublicKey
`.
`Class RandomData
`.
`.
`.
`Interface SecretKey
`.
`.
`.
`Class Signature
`.
`.
`.
`.
`Package javacardx.crypto
`.
`Class Cipher
`.
`.
`.
`.
`Interface KeyEncryption
`.
`Index
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`.
`
`135
`141
`146
`147
`148
`155
`158
`161
`164
`165
`176
`177
`186
`188
`
`ii Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`4
`
`
`
`Java Card 2.1 API
`
`Java Card TM 2.1 Platform API Specification
`Final Revision 1.0
`
`This document is the specification for the Java Card 2.1 Application Programming Interface.
`
`See:
` Description
`
`Packages
`
`java.lang
`
`Provides classes that are fundamental to the design of the Java Card technology
`subset of the Java programming language.
`
`javacard.framework
`
`Provides framework of classes and interfaces for the core functionality of a Java
`Card applet.
`
`javacard.security
`
`Provides the classes and interfaces for the Java Card security framework.
`
`javacardx.crypto
`
`Extension package containing security classes and interfaces for
`export-controlled functionality.
`
`
`
`
`
`This document is the specification for the Java Card 2.1 Application Programming Interface.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 1
`
`5
`
`
`
`Java Card 2.1 API
`
`Java Card 2.1 API Notes
`
`Referenced Standards
`
`ISO - International Standards Organization
`
`Information Technology - Identification cards - integrated circuit cards with contacts: ISO 7816
`Information Technology - Security Techniques - Digital Signature Scheme Giving Message
`Recovery: ISO 9796
`Information Technology - Data integrity mechanism using a cryptographic check function employing
`a block cipher algorithm: ISO 9797
`Information technology - Security techniques - Digital signatures with appendix : ISO 14888
`
`RSA Data Security, Inc.
`
`RSA Encryption Standard: PKCS #1 Version 2.0
`Password-Based Encryption Standard: PKCS #5 Version 1.5
`
`EMV
`
`The EMV ’96 ICC Specifications for Payments systems Version 3.0
`
`IPSec
`
`The Internet Key Exchange ( IKE ) document RFC 2409 (STD 1)
`
`Standard Names for Security and Crypto
`
`SHA (also SHA-1): Secure Hash Algorithm, as defined in Secure Hash Standard, NIST FIPS 180-1.
`MD5: The Message Digest algorithm RSA-MD5, as defined by RSA DSI in RFC 1321.
`RIPEMD-160 : as defined in ISO/IEC 10118-3:1998 Information technology -- Security techniques
`-- Hash-functions -- Part 3: Dedicated hash-functions
`DSA: Digital Signature Algorithm, as defined in Digital Signature Standard, NIST FIPS 186.
`DES: The Data Encryption Standard, as defined by NIST in FIPS 46-1 and 46-2.
`RSA: The Rivest, Shamir and Adleman Asymmetric Cipher algorithm.
`
`2 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`6
`
`
`
`Java Card 2.1 API
`
`Parameter Checking
`
`Policy
`All Java Card API implementations must conform to the Java model of parameter checking. That is, the
`API code should not check for those parameter errors which the VM is expected to detect. These include
`all parameter errors, such as null pointers, index out of bounds, and so forth, that result in standard
`runtime exceptions. The runtime exceptions that are thrown by the Java Card VM are:
`
`ArithmeticException
`ArrayStoreException
`ClassCastException
`IllegalArgumentException
`IllegalStateException
`IndexOutOfBoundsException
`ArrayIndexOutOfBoundsException
`NegativeArraySizeException
`NullPointerException
`SecurityException
`
`Exceptions to the Policy
`In some cases, it may be necessary to explicitly check parameters. These exceptions to the policy are
`documented in the Java Card API specification. A Java Card API implementation must not perform
`parameter checking with the intent to avoid runtime exceptions, unless this is clearly specified by the Java
`Card API specification.
`
`
`Note: If multiple erroneous input parameters exist, any one of several runtime exceptions will be
`thrown by the VM. Java programmers rely on this behavior, but they do not rely on getting a specific
`exception. It is not necessary (nor is it reasonable or practical) to document the precise error handling
`for all possible combinations of equivalence classes of erroneous inputs. The value of this behavior is
`that the logic error in the calling program is detected and exposed via the runtime exception
`mechanism, rather than being masked by a normal return.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 3
`
`7
`
`
`
`Java Card 2.1 API
`
`Hierarchy For All Packages
`
`Package Hierarchies:
`java.lang, javacard.framework, javacard.security, javacardx.crypto
`
`Class Hierarchy
`
`class java.lang.Object
`class javacard.framework.AID
`class javacard.framework.APDU
`class javacard.framework.Applet
`class javacardx.crypto.Cipher
`class javacard.framework.JCSystem
`class javacard.security.KeyBuilder
`class javacard.security.MessageDigest
`class javacard.framework.OwnerPIN (implements javacard.framework.PIN)
`class javacard.security.RandomData
`class javacard.security.Signature
`class java.lang.Throwable
`class java.lang.Exception
`class javacard.framework.CardException
`class javacard.framework.UserException
`class java.lang.RuntimeException
`class java.lang.ArithmeticException
`class java.lang.ArrayStoreException
`class javacard.framework.CardRuntimeException
`class javacard.framework.APDUException
`class javacard.security.CryptoException
`class javacard.framework.ISOException
`class javacard.framework.PINException
`class javacard.framework.SystemException
`class javacard.framework.TransactionException
`class java.lang.ClassCastException
`class java.lang.IndexOutOfBoundsException
`class java.lang.ArrayIndexOutOfBoundsException
`class java.lang.NegativeArraySizeException
`class java.lang.NullPointerException
`class java.lang.SecurityException
`class javacard.framework.Util
`
`4 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`8
`
`
`
`Java Card 2.1 API
`
`Interface Hierarchy
`
`interface javacard.security.DSAKey
`interface javacard.security.DSAPrivateKey(also extends javacard.security.PrivateKey)
`interface javacard.security.DSAPublicKey(also extends javacard.security.PublicKey)
`interface javacard.framework.ISO7816
`interface javacard.security.Key
`interface javacard.security.PrivateKey
`interface javacard.security.DSAPrivateKey(also extends javacard.security.DSAKey)
`interface javacard.security.RSAPrivateCrtKey
`interface javacard.security.RSAPrivateKey
`interface javacard.security.PublicKey
`interface javacard.security.DSAPublicKey(also extends javacard.security.DSAKey)
`interface javacard.security.RSAPublicKey
`interface javacard.security.SecretKey
`interface javacard.security.DESKey
`interface javacardx.crypto.KeyEncryption
`interface javacard.framework.PIN
`interface javacard.framework.Shareable
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 5
`
`9
`
`
`
`Java Card 2.1 API
`
`Package java.lang
`Provides classes that are fundamental to the design of the Java Card technology subset of the Java
`programming language.
`
`See:
` Description
`
`Class Summary
`Object
`Class Object is the root of the Java Card class hierarchy.
`
`Throwable
`
`The Throwable class is the superclass of all errors and exceptions in the Java Card subset of
`the Java language.
`
`
`
`6 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`10
`
`
`
`Java Card 2.1 API
`
`Exception Summary
`
`ArithmeticException
`
`ArrayIndexOutOfBoundsException
`
`ArrayStoreException
`
`ClassCastException
`
`Exception
`
`IndexOutOfBoundsException
`
`NegativeArraySizeException
`
`NullPointerException
`
`RuntimeException
`
`SecurityException
`
`
`
`A JCRE owned instance of ArithmethicException is
`thrown when an exceptional arithmetic condition has occurred.
`
`A JCRE owned instance of IndexOutOfBoundsException
`is thrown to indicate that an array has been accessed with an
`illegal index.
`
`A JCRE owned instance of ArrayStoreException is
`thrown to indicate that an attempt has been made to store the
`wrong type of object into an array of objects.
`
`A JCRE owned instance of ClassCastException is thrown
`to indicate that the code has attempted to cast an object to a
`subclass of which it is not an instance.
`
`The class Exception and its subclasses are a form of
`Throwable that indicates conditions that a reasonable applet
`might want to catch.
`
`A JCRE owned instance of IndexOutOfBoundsException
`is thrown to indicate that an index of some sort (such as to an
`array) is out of range.
`
`A JCRE owned instance of
`NegativeArraySizeException is thrown if an applet
`tries to create an array with negative size.
`
`A JCRE owned instance of NullPointerExceptionis
`thrown when an applet attempts to use null in a case where an
`object is required.
`
`RuntimeException is the superclass of those exceptions that
`can be thrown during the normal operation of the Java Card
`Virtual Machine. A method is not required to declare in its
`throws clause any subclasses of RuntimeException that
`might be thrown during the execution of the method but not
`caught.
`
`A JCRE owned instance of SecurityException is thrown
`by the Java Card Virtual Machine to indicate a security violation.
`This exception is thrown when an attempt is made to illegally
`access an object belonging to a another applet.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 7
`
`11
`
`
`
`Java Card 2.1 API
`
`Package java.lang Description
`
`Provides classes that are fundamental to the design of the Java Card technology subset of the Java
`programming language.
`
`8 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`12
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class ArithmeticException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.ArithmeticException
`
`public class ArithmeticException
`extends RuntimeException
`
`A JCRE owned instance of ArithmethicException is thrown when an exceptional arithmetic
`condition has occurred. For example, a "divide by zero" is an exceptional arithmentic condition.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`ArithmeticException()
` Constructs an ArithmeticException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 9
`
`13
`
`
`
`Java Card 2.1 API
`
`ArithmeticException
`
`public ArithmeticException()
`
`Constructs an ArithmeticException.
`
`10 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`14
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class ArrayIndexOutOfBoundsException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.IndexOutOfBoundsException
` |
` +--java.lang.ArrayIndexOutOfBoundsException
`
`public class ArrayIndexOutOfBoundsException
`extends IndexOutOfBoundsException
`
`A JCRE owned instance of IndexOutOfBoundsException is thrown to indicate that an array has
`been accessed with an illegal index. The index is either negative or greater than or equal to the size of the
`array.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`ArrayIndexOutOfBoundsException()
` Constructs an ArrayIndexOutOfBoundsException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 11
`
`15
`
`
`
`Java Card 2.1 API
`
`ArrayIndexOutOfBoundsException
`
`public ArrayIndexOutOfBoundsException()
`
`Constructs an ArrayIndexOutOfBoundsException.
`
`12 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`16
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class ArrayStoreException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.ArrayStoreException
`
`public class ArrayStoreException
`extends RuntimeException
`
`A JCRE owned instance of ArrayStoreException is thrown to indicate that an attempt has been
`made to store the wrong type of object into an array of objects. For example, the following code generates
`an ArrayStoreException:
`
` Object x[] = new AID[3];
` x[0] = new OwnerPIN( (byte) 3, (byte) 8);
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`ArrayStoreException()
` Constructs an ArrayStoreException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 13
`
`17
`
`
`
`Java Card 2.1 API
`
`ArrayStoreException
`
`public ArrayStoreException()
`
`Constructs an ArrayStoreException.
`
`14 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`18
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class ClassCastException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.ClassCastException
`
`public class ClassCastException
`extends RuntimeException
`
`A JCRE owned instance of ClassCastException is thrown to indicate that the code has attempted to
`cast an object to a subclass of which it is not an instance. For example, the following code generates a
`ClassCastException:
`
` Object x = new OwnerPIN( (byte)3, (byte)8);
` JCSystem.getAppletShareableInterfaceObject( (AID)x, (byte)5 );
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`ClassCastException()
` Constructs a ClassCastException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 15
`
`19
`
`
`
`Java Card 2.1 API
`
`ClassCastException
`
`public ClassCastException()
`
`Constructs a ClassCastException.
`
`16 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`20
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class Exception
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
`
`Direct Known Subclasses:
`CardException, RuntimeException
`
`public class Exception
`extends Throwable
`
`The class Exception and its subclasses are a form of Throwable that indicates conditions that a
`reasonable applet might want to catch.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`Exception()
` Constructs an Exception instance.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Exception
`
`public Exception()
`
`Constructs an Exception instance.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 17
`
`21
`
`
`
`Java Card 2.1 API
`
`18 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`22
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class IndexOutOfBoundsException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.IndexOutOfBoundsException
`
`Direct Known Subclasses:
`ArrayIndexOutOfBoundsException
`
`public class IndexOutOfBoundsException
`extends RuntimeException
`
`A JCRE owned instance of IndexOutOfBoundsException is thrown to indicate that an index of
`some sort (such as to an array) is out of range.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`IndexOutOfBoundsException()
` Constructs an IndexOutOfBoundsException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 19
`
`23
`
`
`
`Java Card 2.1 API
`
`IndexOutOfBoundsException
`
`public IndexOutOfBoundsException()
`
`Constructs an IndexOutOfBoundsException.
`
`20 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`24
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class NegativeArraySizeException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.NegativeArraySizeException
`
`public class NegativeArraySizeException
`extends RuntimeException
`
`A JCRE owned instance of NegativeArraySizeException is thrown if an applet tries to create an
`array with negative size.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`NegativeArraySizeException()
` Constructs a NegativeArraySizeException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 21
`
`25
`
`
`
`Java Card 2.1 API
`
`NegativeArraySizeException
`
`public NegativeArraySizeException()
`
`Constructs a NegativeArraySizeException.
`
`22 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`26
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class NullPointerException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.NullPointerException
`
`public class NullPointerException
`extends RuntimeException
`
`A JCRE owned instance of NullPointerExceptionis thrown when an applet attempts to use null
`in a case where an object is required. These include:
`
`Calling the instance method of a null object.
`Accessing or modifying the field of a null object.
`Taking the length of null as if it were an array.
`Accessing or modifying the slots of null as if it were an array.
`Throwing null as if it were a Throwable value.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`NullPointerException()
` Constructs a NullPointerException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 23
`
`27
`
`
`
`Java Card 2.1 API
`
`
`
`
`
`Constructor Detail
`
`NullPointerException
`
`public NullPointerException()
`
`Constructs a NullPointerException.
`
`24 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`28
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class Object
`
`java.lang.Object
`
`public class Object
`
`Class Object is the root of the Java Card class hierarchy. Every class has Object as a superclass. All
`objects, including arrays, implement the methods of this class.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`Object()
`
`
`
`
`
`
`Method Summary
` boolean equals(Object obj)
` Compares two Objects for equality.
`
`
`
`
`
`Constructor Detail
`
`Object
`
`public Object()
`
`Method Detail
`
`equals
`
`public boolean equals(Object obj)
`
`Compares two Objects for equality.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 25
`
`29
`
`
`
`Java Card 2.1 API
`
`The equals method implements an equivalence relation:
`It is reflexive: for any reference value x, x.equals(x) should return true.
`It is symmetric: for any reference values x and y, x.equals(y) should return true if and
`only if y.equals(x) returns true.
`It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and
`y.equals(z) returns true, then x.equals(z) should return true.
`It is consistent: for any reference values x and y, multiple invocations of x.equals(y)
`consistently return true or consistently return false.
`For any reference value x, x.equals(null) should return false.
`
`The equals method for class Object implements the most discriminating possible equivalence
`relation on objects; that is, for any reference values x and y, this method returns true if and only if
`x and y refer to the same object (x==y has the value true).
`Parameters:
`obj - the reference object with which to compare.
`Returns:
`true if this object is the same as the obj argument; false otherwise.
`
`26 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`30
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class RuntimeException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
`
`Direct Known Subclasses:
`ArithmeticException, ArrayStoreException, CardRuntimeException, ClassCastException,
`IndexOutOfBoundsException, NegativeArraySizeException, NullPointerException,
`SecurityException
`
`public class RuntimeException
`extends Exception
`
`RuntimeException is the superclass of those exceptions that can be thrown during the normal
`operation of the Java Card Virtual Machine.
`
`A method is not required to declare in its throws clause any subclasses of RuntimeException that
`might be thrown during the execution of the method but not caught.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`RuntimeException()
` Constructs a RuntimeException instance.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 27
`
`31
`
`
`
`Java Card 2.1 API
`
`RuntimeException
`
`public RuntimeException()
`
`Constructs a RuntimeException instance.
`
`28 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`32
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class SecurityException
`
`java.lang.Object
` |
` +--java.lang.Throwable
` |
` +--java.lang.Exception
` |
` +--java.lang.RuntimeException
` |
` +--java.lang.SecurityException
`
`public class SecurityException
`extends RuntimeException
`
`A JCRE owned instance of SecurityException is thrown by the Java Card Virtual Machine to
`indicate a security violation.
`
`This exception is thrown when an attempt is made to illegally access an object belonging to a another
`applet. It may optionally be thrown by a Java Card VM implementation to indicate fundamental language
`restrictions, such as attempting to invoke a private method in another class.
`
`For security reasons, the JCRE implementation may mute the card instead of throwing this exception.
`
`JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed
`from any applet context. References to these temporary objects cannot be stored in class variables or
`instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for
`details.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`SecurityException()
` Constructs a SecurityException.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 29
`
`33
`
`
`
`Java Card 2.1 API
`
`
`
`
`
`Constructor Detail
`
`SecurityException
`
`public SecurityException()
`
`Constructs a SecurityException.
`
`30 Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc.
`
`34
`
`
`
`Java Card 2.1 API
`
`java.lang
`Class Throwable
`
`java.lang.Object
` |
` +--java.lang.Throwable
`
`Direct Known Subclasses:
`Exception
`
`public class Throwable
`extends Object
`
`The Throwable class is the superclass of all errors and exceptions in the Java Card subset of the Java
`language. Only objects that are instances of this class (or of one of its subclasses) are thrown by the Java
`Card Virtual Machine or can be thrown by the Java throw statement. Similarly, only this class or one of
`its subclasses can be the argument type in a catch clause.
`
`This Java Card class’s functionality is a strict subset of the definition in the Java Platform Core API
`Specification.
`
`Constructor Summary
`Throwable()
` Constructs a new Throwable.
`
`
`
`
`
`Methods inherited from class java.lang.Object
`
`equals
`
`
`
`
`
`Constructor Detail
`
`Throwable
`
`public Throwable()
`
`Constructs a new Throwable.
`
`Final Revision 1.0 Copyright © February 24, 1999 Sun Microsystems, Inc. 31
`
`35
`
`
`
`Java Card 2.1 API
`
`32 Final Revision 1.0 Copyright © Febr