Table of Contents
Preface
Java Card technology combines a portion of the Java programming language with a runtime environment optimized for smart cards and related, small-memory embedded devices. The goal of Java Card technology is to bring many of the benefits of the Java programming language to the resource-constrained world of smart cards and secure elements.
The Classic Edition of the Java Card platform is defined by three specifications:
- Java Card Runtime Environment Specification, Java Card Platform, Version 3.2, Classic Edition
- Virtual Machine Specification, Java Card Platform, Version 3.2, Classic Edition
- Application Programming Interface, Java Card Platform, Version 3.2 with Preview Features, Classic Edition
This document describes the changes introduced in Version 3.2 of the specifications, as well as the Preview Features made available with this release.
Audience
This document is intended both for Oracle Java Card licensees who are implementing the Java Card Platform and for application developers who want an understanding of the changes introduced in this release of the Java Card specifications.
Before You Read This Document
Before reading this guide, you should be familiar with the Java programming language, the Java Card technology specifications, and smart card technology. A useful resource for learning about Java and Java Card technology is available at:
https://www.oracle.com/technetwork/java/embedded/javacard/overview/.
Related Documents
The following related documents may help you understand this document:
-
[JCAPI] - Application Programming Interface Specification, Version 3.2, with Preview Features, Classic Edition
-
[JCVM] - Virtual Machine Specification, Version 3.2, Classic Edition
-
[JCRE] - Runtime Environment Specification, Version 3.2, Classic Edition
-
[JLS] - The Java Language Specification Third Edition by James Gosling, Bill Joy, and Guy L. Steele (Addison-Wesley, 2005)
Introduction
Java Card technology enables secure elements, such as smart cards and other tamper-resistant security chips, to host applications called applets, which employ Java technology.
These release notes describe the changes introduced in Version 3.2 with Preview Features of the Java Card specifications.
This document is intended for both the Oracle Java Card licensees who are implementing the Java Card Platform and for the application developers who want to understand the changes introduced in this release.
What’s New
This section lists the important changes and features in Java Card specifications, Version 3.2, as well as the Preview Features made available with this release.
This section contains the following:
- What’s new in the Java Card Runtime Environment
- What’s new in the Java Card API
- What are the Preview Features
What’s new in the Java Card Runtime Environment
The following table outlines the new features in the Java Card Runtime Environment, Version 3.2.
Table - New Features in the Java Card Runtime Environment Specification
| Feature | Description |
|---|---|
| Logical Channel Configuration | A Java Card implementation must support one of the following configurations:
|
What’s new in the Java Card API
The following table outlines the new features in the Java Card Application Programming Interface (API) specification version 3.2.
Table - New Features in Java Card API Specification
| New Feature | Description |
|---|---|
| Logical channel encoding | Add an API to retrieve the supported logical channel encoding type used by the JCRE. |
| TLS1.3 and DTLS1.3 key schedule | Add key derivation algorithm and intermediate message digest mechanisms to perform TLS1.3 and DTLS1.3 key schedule operations. |
| Additional ISO9796 digital signature with message recovery paddings | Support the trailer field option 2 for all schemes defined in the ISO9796 digital signature with message recovery specification. |
| Extend support to EdDSA digital signature algorithm | Add capability to create a signature instance for predefined edwards25519 and edwards448 curves. |
| Extend support to SM2 key agreement with confirmation values | Add support for SM2 key exchange with and without confirmation values. |
| Configure RSA-OAEP cipher scheme | Add the configuration of the message digest algorithm of the Mask Generation function (MGF1) of the RSA OAEP cipher scheme. |
| Configure RSA-PSS digital signature scheme | Add the configuration of the message digest algorithm of the Mask Generation function (MGF1) of the RSA PSS digital signature scheme. |
| Retrieve available memory value as a byte array | Add an API to retrieve the memory available for a given type as a convenient byte array parameter. |
| Instantiate random generator with external access | Add an API to instantiate a random generator instance that can be used even if the current context is not the context of the currently selected Applet. |
| Clear a biometric template | Add an API to clear a biometric template. |
What are the Preview Features
This version of the Java Card specifications includes Preview Features, marking an important step in the process of releasing new capabilities for the Java Card platform.
A Java Card Preview Feature is a new feature of the Java Card Platform whose design, specification, and implementation are complete, and yet impermanent, which means that the feature may exist in a different form or not at all in future releases of the Java Card Platform Specification. The main purpose of introducing a preview feature is to enable application developers to use the feature in the context of their applications and provide feedback.
Table - Preview Features in Java Card API Specification
| Preview Feature | Status | Description |
|---|---|---|
| Elliptic Curve Blinded Diffie-Hellman | Final Preview | Add support for key agreement using the Blinded Diffie-Hellman (BDH) protocol (EMV® Contactless Book E Security and Key Management v1.1). |
| Elliptic Curve Schnorr Digital Signature Algorithm | Final Preview | Add support for generating and verifying digital signatures using the Elliptic Curve-based Schnorr Digital Signature Algorithm (ECSDSA) with appendix, in accordance with ISO/IEC 14888-3 specifications. |
| Key Encapsulation Mechanism | First Preview | Add an API for key encapsulation and decapsulation operations, including the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), as standardized in NIST FIPS 203, and Diffie-Hellman-based KEM (DHKEM), as defined in RFC 9180. |
| Module-Lattice Digital Signature Algorithm | First Preview | Add support for generating and verifying post-quantum digital signatures using the Module-Lattice Digital Signature Algorithm (ML-DSA), as standardized in NIST FIPS 204. |
| Module-Lattice-Based Keys | First Preview | Add an API for creating, generating, importing, exporting, and clearing ML-KEM and ML-DSA key material, as specified in NIST FIPS 203 and NIST FIPS 204, respectively. |
Detailed Changes
This topic provides comprehensive information about each change made in the specifications for this release.
The following list provides details about the changes in this release, including:
- Component - lists the specifications modified for this feature (Java Card Virtual Machine, Java Card Runtime Environment, Java Card API)
- Compliance - describes if the feature is mandatory or optional.
- A mandatory feature must be supported by any implementation.
- An optional feature is not necessarily supported. However, when the feature is supported, the proposed API, defined based on industry requirements, should be used instead of proprietary APIs to guarantee interoperability and avoid fragmentation.
- API - Lists the package or class that supports the feature.
Core – logical channel encoding
Support for logical channel encoding.
- Component: Java Card Runtime Environment – Logical Channels and Applet Selection; Java Card Application Programming Interface
- API:
javacard.framework.APDUclass - Compliance: Mandatory
The Java Card Runtime Environment must support one of the following configurations:
- A configuration where the Java Card Platform provides support for multiple logical channels. A terminal can open multiple logical channels over any I/O interface and assign each logical channel to an Applet instance. In this configuration, a platform may support the logical channels Type 4 encoding (logical channels 0 to 3) only or both the Type 4 and the Type 16 (logical channels 4 to 19) encodings.
- A configuration where the Java Card platform does not provide support for multiple logical channels. A terminal can only use the basic logical channel (logical channel 0) on each I/O interface and assign it to an Applet instance.
The Java Card API provides a way to retrieve the logical channel encoding supported by the platform:
| New Constant referring to CLA encoding without logical channel information | javacard.framework.APDU.LC_ENCODING_NO |
| New constant referring to CLA encoding with Type 4 logical channel information | javacard.framework.APDU.LC_ENCODING_TYPE_4 |
| New Constant referring to CLA encoding with Type 4 and Type 16 logical channel information | javacard.framework.APDU.LC_ENCODING_TYPE_4_TYPE_16 |
| New method to retrieve the logical channel encoding type used by the JCRE to interpret the CLA byte of the current APDU | javacard.framework.APDU.getLogicalChannelEncoding() |
API - TLS1.3 and DTLS1.3
Support for the TLS1.3 and DTLS1.3 interfaces.
- Component: Java Card Application Programming Interface
- API:
javacardx.security.derivationpackage andjavacard.security.MessageDigestclass - Compliance: Optional
The API for cryptography is extended to support the TLS1.3 (RFC 8446) and DTLS (RFC 9147) key schedule. For this purpose:
- A new derivation function algorithm is added to perform the HKDF-Expand-Label operation defined in RFC 8446 and to choose the label prefix either for TLS1.3 or for DTLS1.3.
- A new method is added to perform the transcript hash operation defined in RFC 8446: it is possible to perform an intermediate message digest calculation without changing the current state of the message digest instance and continue the operation.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
| New method to determine if intermediate hash calculation is supported | javacard.security.MessageDigest.isIntermediateMessageDigestSupported() |
| New method to generate an intermediate hash calculation |
javacard.security.MessageDigest.doIntermediateMessageDigest()
javacard.security.MessageDigest.OneShot.doIntermediateMessageDigest()
|
| New constant for HKDF-Expand-Label algorithm | javacardx.security.derivation.DerivationFunction.ALG_HKDF_EXPAND_LABEL_TLS13 |
| New interface for HKDF-Expand-Label algorithm | javacardx.security.derivation.TLSKDFExpandLabelSpec |
API – ISO9796 signature with message recovery with trailer field option 2
Support for ISO9796 signature with message recovery.
- Component: Java Card Application Programming Interface
- API:
javacardx.crypto.Cipherclass andjavacard.security.Signatureclass - Compliance: Optional
The API for cryptography is extended to support the following paddings for signatures with message recovery:
- padding specified by ISO/IEC 9796-2 for signature scheme 1, signature production function B.6 and giving message recovery with a trailer field option 2.
- padding specified by ISO/IEC 9796-2 for signature scheme 2, signature production function B.6 and giving message recovery with a trailer field option 2.
- padding specified by ISO/IEC 9796-2 for signature scheme 3, signature production function B.6 and giving message recovery with a trailer field option 2.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
| New constant for ISO9796 scheme 1 trailer field option 2 | javacardx.crypto.Cipher.PAD_ISO9796_MR_SCHEME_1_OPTION_2
|
| New constant for ISO9796 scheme 2 trailer field option 2 | javacardx.crypto.Cipher.PAD_ISO9796_MR_SCHEME_2_OPTION_2
|
| New constant for ISO9796 scheme 3 trailer field option 2 | javacardx.crypto.Cipher.PAD_ISO9796_MR_SCHEME_3_OPTION_2 |
API – Extend support to EdDSA digital signature algorithm
Support for EdDSA digital signature algorithm.
- Component: Java Card Application Programming Interface
- API:
javacard.security.Signatureclass - Compliance: Optional
The API for pure and pre-hash EdDSA signatures is extended to bind a signature instance to edwards25519 or edwards448 curves before the related key type is known.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
| New constant for pure EdDSA for the variant Ed25519 |
javacard.security.Signature.SIG_CIPHER_EDDSA_ED25519 |
| New constant for pure EdDSA for the variant Ed448 |
javacard.security.Signature.SIG_CIPHER_EDDSA_ED448 |
| New constant for pre-hash EdDSA for the variant Ed25519ph |
javacard.security.Signature.SIG_CIPHER_EDDSAPH_ED25519 |
| New constant for pre-hash EdDSA for the variant Ed448ph |
javacard.security.Signature.SIG_CIPHER_EDDSAPH_ED448 |
API – Extend support to SM2 key agreement with confirmation value
Support for SM2 key agreements with confirmation value.
- Component: Java Card Application Programming Interface
- API:
javacardx.securitypackage andjavacard.security.KeyAgreementclass - Compliance: Optional
The existing API for SM2 is extended to support the SM2 key agreement protocol with and without confirmation values and for both the initiator and the receiver roles.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
| New constant to perform an SM2 key agreement operation using confirmation values in and/or out | javacard.security.KeyAgreement.ALG_SM2_WITH_CONFIRMATION
|
| New interface to configure the role and the parameters involved during an SM2 key agreement operation | javacard.security.SM2KeyAgreementParameterSpec |
| New method to initialize a key agreement instance based on algorithm parameters such as for SM2 | javacard.security.KeyAgreement.init() |
API – Configure RSA-OAEP cipher scheme
Configuration of RSA-OAEP cipher scheme.
The RSA-OAEP cipher scheme refers to a message digest algorithm for both the OAEP scheme itself and its underlying mask generation function (MGF1). The API is extended to configure independently the message digest algorithm of the scheme and the message digest algorithm of the MGF1.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
The following table lists the constant added to configure OAEP parameters.
| New constant for configuring OAEP parameters in Cipher.init() | javacardx.crypto.Cipher.PAD_PKCS1_OAEP_EXT_PARAMETERS |
API – Configure RSA-PSS digital signature scheme
Configuration for RSA-PSS digital signature scheme
- Component: Java Card Application Programming Interface
- API:
javacard.security.Signatureclass andjavacardx.crypto.Cipherclass - Compliance: Optional
The RSA-PSS digital signature scheme refers to a message digest algorithm for both the PSS scheme itself and its underlying mask generation function (MGF1). The API is extended to configure independently the message digest algorithm of the scheme and the message digest algorithm of the MGF1 as well as the salt length.
The new classes, interfaces, methods or constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the following reason code CryptoException.NO_SUCH_ALGORITHM.
| New constant for configuring PSS parameters in Signature.init() | javacardx.crypto.Cipher.PAD_PKCS1_PSS_EXT_PARAMETERS |
API – Retrieve available memory value as byte array
Retrieve available memory as byte array.
- Component: Java Card Application Programming Interface
- API:
javacard.framework.JCSystemclass - Compliance: Mandatory
Two methods already exist to retrieve the memory available for a given type either as a short or in a short[]. The API is extended to also retrieve the value as a byte[].
| New method to retrieve memory available as a byte array | javacard.framework.JCSystem.getAvailableMemory() |
API – Instantiate random generator with external access
Support for instantiating random generator with external access.
- Component: Java Card Application Programming Interface
- API:
javacard.security.RandomDataclass - Compliance: Optional
As with other cryptographic objects, the random generator API is extended to explicitly request a RandomData instance with external access. Such an instance can be shared among multiple applet instances and/or can also be accessed (via a Shareable interface) when the owner of the RandomData instance is not the currently selected applet.
The previous method RandomData.getInstance() is deprecated.
The new classes, interfaces, methods, and constants for this feature must be available in any Java Card 3.2 compliant implementation, but the corresponding algorithm implementation is optional and may throw an exception with the reason code CryptoException.NO_SUCH_ALGORITHM.
| New method to instantiate a RandomData object with external access | javacard.security.RandomData.getInstance() |
API – Clear a biometric template
Support for clearing a biometric template.
The interfaces referring to a biometric template owned by an applet are extended to offer the possibility to clear the biometric template. Clearing the biometric template makes it uninitialized.
| New method to clear a biometric template owned by an applet | javacardx.biometry.OwnerBioTemplate.clear() |
| New method to clear a biometric template owned by an applet (1:N biometric framework) | javacardx.biometry1toN.OwnerBioTemplateData.clear() |
Preview Feature API - Add Support for Elliptic Curve Blinded Diffie-Hellman Key Agreement Algorithm
Support for Elliptic Curve BDH key agreement algorithm.
- Component: Java Card Application Programming Interface
- API:
javacard.security.KeyAgreementclass andjavacardx.security.bdh.BDHKeyAgreementclass - Compliance: Preview Feature
Add support for key agreement using the Blinded Diffie-Hellman (BDH) protocol (EMV® Contactless Book E Security and Key Management v1.1).
Table - Preview Features
| Constant/Feature | Description |
|---|---|
| New constant for Elliptic Curve Blinded Diffie-Hellman Key Exchange (ECBDH-KE) using the secp256r1 curve defined in FIPS 186-4 | javacard.security.KeyAgreement.ALG_EC_BDH_SECP256R1 |
| New package containing a new interface with a method to generate ECBDH related blinding factor, blinded public key and shared secret | javacardx.security.bdh
javacardx.security.bdh.BDHKeyAgreement.generateSecret() |
Preview Feature API - Add support for Elliptic Curve Schnorr Digital Signature Algorithm
Support for ECSDSA digital signature algorithm.
- Component: Java Card Application Programming Interface
- API:
javacard.security.Signatureclass - Compliance: Preview Feature
Add support for generating and verifying digital signatures using the Elliptic Curve-based Schnorr Digital Signature Algorithm (ECSDSA) with appendix, in accordance with ISO/IEC 14888-3 specifications.
Table - Constants for ECSDSA
| Constant | Description |
|---|---|
| New constant for ECSDSA | javacard.security.Signature.SIG_CIPHER_ECSDSA |
| New constant for optimized ECSDSA | javacard.security.Signature.SIG_CIPHER_ECSDSA_OPTIMIZED |
Preview Feature API - Add Support for Key Encapsulation Mechanism
Support for Key Encapsulation Mechanism (KEM) operations.
- Component: Java Card Application Programming Interface
- API:
javacardx.crypto.kempackage,javacardx.crypto.kem.KEMclass, andjavacardx.crypto.kem.KEM.Encapsulatorandjavacardx.crypto.kem.KEM.Decapsulatorinterfaces - Compliance: Preview Feature
Add an API for Key Encapsulation Mechanisms (KEMs), cryptographic protocols that securely establish symmetric keys using public key cryptography. The API supports the quantum-resistant Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), as standardized in NIST FIPS 203, and Diffie-Hellman-based KEM (DHKEM), as defined in RFC 9180. The API also supports creating KEM instances that perform ML-KEM decapsulation with private keys in either seed or expanded representation, automatically expanding seed private keys before decapsulation.
Table - Preview Features for Key Encapsulation Mechanisms
| Constant/Feature | Description |
|---|---|
| New extension package for KEM operations | javacardx.crypto.kem |
| New class for obtaining KEM instances | javacardx.crypto.kem.KEM
|
| New constants for selecting KEM algorithms and operation modes | javacardx.crypto.kem.KEM.ALG_DHKEM
javacardx.crypto.kem.KEM.MODE_ENCAPSULATION
javacardx.crypto.kem.KEM.MODE_EXPAND |
| New interfaces for key encapsulation and decapsulation operations | javacardx.crypto.kem.KEM.Encapsulator
javacardx.crypto.kem.KEM.Encapsulator.sharedSecretSize()
javacardx.crypto.kem.KEM.Decapsulator
javacardx.crypto.kem.KEM.Decapsulator.sharedSecretSize()
|
Preview Feature API - Add Support for Module-Lattice Digital Signature Algorithm
Support for Module-Lattice Digital Signature Algorithm (ML-DSA) operations.
- Component: Java Card Application Programming Interface
- API:
javacard.security.Signatureclass - Compliance: Preview Feature
Add support for generating and verifying post-quantum digital signatures using the Module-Lattice Digital Signature Algorithm (ML-DSA), as standardized in NIST FIPS 204. The ML-DSA API uses the existing Java Card Signature programming model and supports pure ML-DSA operations over either the original message or an externally computed 64-byte message representative, mu. Depending on the selected constant, signing requires a private key in expanded representation or supports private keys in either seed or expanded representation. Seed private keys are automatically expanded before signing.
Table - Constants for ML-DSA
| Constant | Description |
|---|---|
| New constant for pure ML-DSA operations over the original message, using private keys in expanded representation for signing | javacard.security.Signature.SIG_CIPHER_ML_DSA |
| New constant for pure ML-DSA operations over the original message, supporting private keys in either seed or expanded representation for signing | javacard.security.Signature.SIG_CIPHER_ML_DSA_EXPAND_SEED |
New constant for pure ML-DSA operations over an externally computed message representative mu, using private keys in expanded representation for signing |
javacard.security.Signature.SIG_CIPHER_ML_DSA_EXTERNAL_MU |
New constant for pure ML-DSA operations over an externally computed message representative mu, supporting private keys in either seed or expanded representation for signing |
javacard.security.Signature.SIG_CIPHER_ML_DSA_EXTERNAL_MU_EXPAND_SEED |
Preview Feature API - Add Support for Module-Lattice-Based Keys
Support for ML-KEM and ML-DSA key material.
- Component: Java Card Application Programming Interface
- API:
javacardx.security.pqcpackage andjavacardx.security.pqc.PQCKeyFactoryclass - Compliance: Preview Feature
Add an API for working with post-quantum cryptography key material, including ML-KEM keys defined in NIST FIPS 203 and ML-DSA keys defined in NIST FIPS 204. The API supports creating key objects, generating fresh key pairs, expanding seed private keys, importing and exporting encoded key material, retrieving an encoded ML-KEM public key from a private key, and clearing key material. ML-KEM and ML-DSA private key objects can be created and populated through key pair generation in either seed or expanded representation.
Table - Preview Features for Module-Lattice-Based Keys
| Constant/Feature | Description |
|---|---|
| New extension package for post-quantum cryptography keys | javacardx.security.pqc |
| New factory class for creating keys, generating key pairs, and expanding seed private keys | javacardx.security.pqc.PQCKeyFactory
javacardx.security.pqc.PQCKeyFactory.buildKey()
|
| New interface for importing, exporting, and clearing encoded key material | javacardx.security.pqc.EncodableKey
javacardx.security.pqc.EncodableKey.getEncoded()
javacardx.security.pqc.EncodableKey.getParams()
|
| New interfaces for ML-DSA public and private keys | javacardx.security.pqc.MLDSAPublicKey
|
| New interfaces for ML-KEM public and private keys | javacardx.security.pqc.MLKEMPublicKey
javacardx.security.pqc.MLKEMPrivateKey.getPublicKey() |
| New constants identifying ML-DSA and ML-KEM key types | javacard.security.KeyBuilder.TYPE_ML_DSA
|
| New named parameter constants for ML-DSA and ML-KEM | javacard.security.NamedParameterSpec.ML_DSA_44
javacard.security.NamedParameterSpec.ML_DSA_87
javacard.security.NamedParameterSpec.ML_KEM_768
|
Clarifications
Additional information on clarifications and fixes.
This release contains the following clarifications and fixes:
Java Card Platform Virtual Machine Specification, Classic Edition, Version 3.2
Static Resource Component (JCVM section 6.16)
- Fix typo: static_resource replaced by static_resource_info
Java Card API Specification, Classic Edition, Version 3.2
javacard.framework.MultiSelectable interface
- Method boolean select(boolean appInstAlreadyActive) – “package” replaced by “group context”. Clarify the behavior when multiple I/O interfaces are supported.
- Method void deselect(boolean appInstStillActive) – “package” replaced by “group context”. Clarify the behavior when multiple I/O interfaces are supported.
javacard.framework.APDU class
- Method byte getCLAChannel() – Clarify that the return value is based on the logical channel encoding type returned by APDU.getLogicalChannelEncoding().
- Method boolean isSecureMessagingCLA() – Clarify that the return value is based on the logical channel encoding type returned by APDU.getLogicalChannelEncoding().
- Method void setOutgoingLength(short len) – Clarify when APDUException.NO_T0_GETRESPONSE and APDUException.NO_T0_REISSUE are thrown when multiple I/O interfaces are supported.
- Method void sendBytesLong(byte[] outData, short bOff, short len) – Clarify when APDUException.NO_T0_GETRESPONSE is thrown when multiple I/O interfaces are supported.
javacard.framework.Applet class
- Method boolean select() – “package” replaced by “group context”. Clarify the behavior when multiple I/O interfaces are supported.
- Method void deselect() – “package” replaced by “group context”. Clarify the behavior when multiple I/O interfaces are supported.
javacard.framework.JCSystem class
- Method Shareable getAppletShareableInterfaceObject(AID serverAID, byte parameter) – Clarify the behavior when multiple I/O interfaces are supported.
- Method static boolean isAppletActive(AID theApplet) – Clarify the behavior when multiple I/O interfaces are supported.
javacard.framework.Resources class
- Method Resources getResources() – Clarify the returned instance is a permanent JCRE Entry Point Object that can be accessed from any applet context.
- Method byte[] getView(short resourceId, short ofs, short len) – Clarify that an IOException is thrown when the value offset + length exceeds the size returned by getSize().
javacard.security.ECKey interface
- Method void setK(short K) – Clarify that the value “1” must be supported by any implementation. A CryptoException.ILLEGAL_VALUE can be thrown when the cofactor value K is different from 1 and not supported by the platform.
javacard.security.GenericSecretKey interface
- Interface description – Clarify that the key can be of any length aligned on a multiple of 8 bits.
javacard.security.HMACKey interface
- Interface description – Clarify that the key can be of any length aligned on a multiple of 8 bits.
javacard.security.Key interface
- Method byte getType() – Clarify that KeyBuilder.TYPE_XEC is returned for keys implementing XECKey interface. Clarify that “0” is returned for keys for which the type is not one of the pre-defined algorithms.
javacard.security.SignatureMessageRecovery interface
- Interface description – Clarify the list of algorithms used by Signature.getInstance(byte, boolean) and Signature.getInstance(byte, byte, byte, boolean) that return an instance implementing this interface.
javacard.security.InitializedMessageDigest class
- Method void setInitialDigest(byte[] state, short stateOffset, short stateLength, byte[] digestedMsgLenBuf, short digestedMsgLenOffset, short digestedMsgLenLength) – Correct typo “initalDigestLength” into “stateLength” when describing the CryptoException.ILLEGAL_VALUE case.
javacard.security.InitializedMessageDigest.OneShot class
- Method void setInitialDigest(…) – Align parameter names with those of the corresponding method in the InitializedMessageDigest class.
javacard.security.KeyAgreement class
- Class description – Clarify preserved (e.g. key) and unpreserved instance values after a reset or a tear down.
- Constants ALG_EC_SVDP_DH, ALG_EC_SVDP_DHC – Clarify that those constants are deprecated and should be replaced respectively by ALG_EC_SVDP_DH_KDF and ALG_EC_SVDP_DHC_KDF.
- Constant ALG_SM2 – Clarify that it requires additional algorithm parameters and the use of the init(PrivateKey, AlgorithmParameterSpec) method.
- Method void init(PrivateKey privKey) – Clarify CryptoException.ILLEGAL_VALUE is thrown if KeyAgreement algorithm requires additional algorithm parameters.
- Method generateSecret(byte[] publicData, short publicOffset, short publicLength, byte[] secret, short secretOffset) – Clarify the preserved (e.g. key) and unpreserved instance values after generateSecret operation. CryptoException.UNINITIALIZED_KEY is thrown if the PrivateKey or any other key passed in additional parameters is not initialized. CryptoException.ILLEGAL_VALUE is thrown if the publicData data is inconsistent with the additional algorithm parameters passed in init(PrivateKey, AlgorithmParameterSpec). Clarify the return value and value length when ALG_SM2_WITH_CONFIRMATION algorithm is used.
javacard.security.KeyPair class
- Method void genKeyPair() – Clarify that, for DSA algorithm, default precomputed p, q and g parameters may be used by the platform if not provided by the application. It aligns with the Elliptic curve case.
javacard.security.RandomData class
- Method RandomData getInstance(byte algorithm) – This method is deprecated. getInstance(byte algorithm, boolean externalAccess) should be used instead.
javacard.security.Signature class
- Class description – Clarify the preserved (e.g. key and mode) and unpreserved instance values after a reset or a tear down.
- Constants ALG_RSA_SHA_ISO9796, ALG_RSA_RIPEMD160_ISO9796, ALG_RSA_SHA_ISO9796_MR, ALG_RSA_RIPEMD160_ISO9796_MR – Clarify constants refer to the scheme 1, the signature production function B.6 and trailer field option 1 of the ISO9796 specification.
- Constants ALG_RSA_SHA_PKCS1_PSS, ALG_RSA_MD5_PKCS1_PSS, ALG_RSA_RIPEMD160_PKCS1_PSS, ALG_RSA_SHA_224_PKCS1_PSS, ALG_RSA_SHA_256_PKCS1_PSS, ALG_RSA_SHA_384_PKCS1_PSS, ALG_RSA_SHA_512_PKCS1_PSS – Clarify the default salt length, the scheme digest algorithm and the MGF1 digest algorithm.
- Constants SIG_CIPHER_EDDSA, SIG_CIPHER_EDDSAPH – Clarify which EdDSA variants these constants refer to, as defined in RFC 8032. Clarify that this cipher algorithm must be associated with message digest algorithm MessageDigest.ALG_NULL and the padding algorithm Cipher.PAD_NULL when calling getInstance(byte, byte, byte, boolean).
- Method void init(Key theKey, byte theMode) – Remove the note about the default salt length value in case of RSA-PSS which is now described in the related RSA-PSS constants. Remove the note about “optimal performance”.
- Method init(Key theKey, byte theMode, byte[] bArray, short bOff, short bLen) – Remove the note about “optimal performance”. Clarify the expected behavior for managing RSA-PSS and EdDSA parameters. CryptoException.NO_SUCH_ALGORITHM can be thrown if the parameters referenced in the byte array parameter are not supported in case of PAD_PKCS1_PSS_EXT_PARAMETERS padding.
- Method short getLength() – Clarify that for DSA and ECDSA, the returned length must be the maximum possible length of the related ASN.1 sequence.
- Method void setInitialDigest(…) – Align parameter names with those of the corresponding method in the InitializedMessageDigest class.
- Method short sign(byte[] inBuff, short inOffset, short inLength, byte[] sigBuff, short sigOffset) – Clarify the preserved (e.g. key and mode) and unpreserved instance values after sign operation.
- Method short signPreComputedHash(byte[] hashBuff, short hashOffset, short hashLength, byte[] sigBuff, short sigOffset) – Clarify the preserved (e.g. key and mode) and unpreserved instance values after signPreComputedHash operation. Clarify CryptoException.ILLEGAL_USE is thrown for edDSA algorithm.
- Method boolean verify(byte[] inBuff, short inOffset, short inLength, byte[] sigBuff, short sigOffset, short sigLength) – Clarify the preserved (e.g. key and mode) and unpreserved instance values after verify operation.
- Method boolean verifyPreComputedHash(byte[] hashBuff, short hashOffset, short hashLength, byte[] sigBuff, short sigOffset, short sigLength) – Clarify the preserved (e.g. key and mode) and unpreserved instance values after verifyPreComputedHash operation. Clarify CryptoException.ILLEGAL_USE is thrown for edDSA algorithm.
javacard.security.Signature.OneShot class
- Method void setInitialDigest(…) – Align parameter names with those of the corresponding method in the InitializedMessageDigest class.
javacardx.apdu.util.APDUUTIL class
- Method byte getCLAChannel(byte CLAbyte) – Clarify that this utility method always refers to the type APDU.LC_ENCODING_TYPE_4_TYPE_16.
javacardx.biometry.OwnerBioTemplate interface
- Method short initMatch(byte[] candidate, short offset, short length) – Clarify that the matching session ends in a failed state if an exception is thrown during the match.
- Method short match(byte[] candidate, short offset, short length) – Clarify that the matching session ends in a failed state if an exception is thrown during the match.
javacardx.biometry1toN.BioMatcher interface
- Method BioTemplateData getBioTemplateData(short index) – Clarify that template indexing starts at value « 1 » (« 0 » is an invalid value).
- Method short getIndexOfLastMatchingBioTemplateData() – Clarify that template indexing starts at value « 1 » (« 0 » is an invalid value).
- Method short initMatch(byte[] candidate, short offset, short length) – Clarify the matching session ends in a failed state if an exception is thrown during the match. Also clarify that if the matching session ends, the validated flag remains in the reset state.
- Method short match(byte[] candidate, short offset, short length) – Clarify the matching session ends in a failed state if an exception is thrown during the match. Also clarify that the matching session must ignore any enrolled BioTemplateData that is uninitialized. Bio1toNException.NO_BIO_TEMPLATE_ENROLLED is thrown if none of the enrolled BioTemplateData is initialized.
javacardx.biometry1toN.OwnerBioMatcher interface
- Method OwnerBioTemplateData getBioTemplateData(short index) – Clarify that template indexing starts at value « 1 » (« 0 » is an invalid value).
- Method short getIndexOfLastMatchingBioTemplateData() – Clarify that template indexing starts at value « 1 » (« 0 » is an invalid value).
- Method void putBioTemplateData(short index, BioTemplateData templateData) – Clarify that template indexing starts at value « 1 » (« 0 » is an invalid value).
javacardx.crypto.AEADCipher class
- Class description – Clarify the preserved (e.g. key and mode) and unpreserved instance values after a reset or a tear down.
- Method void init(Key theKey, byte theMode) – Remove references to non-AEAD algorithms. Clarify that the nonce is a 12-byte buffer filled with zeros for GCM mode.
- Method void init(Key theKey, byte theMode, byte[] bArray, short bOff, short bLen) – Remove references to non-AEAD algorithms.
- Method short update(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset) – Clarify the expected output length based on the algorithm. Add reference to array views case when input/output buffers overlap. Remove references to non-AEAD algorithms.
- Method short doFinal(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset) – Clarify the preserved (e.g. key and mode) and unpreserved instance values after doFinal operation. Remove references to non-AEAD algorithms.
- Method short retrieveTag(byte[] tagBuf, short tagOff, short tagLen) – Clarify CryptoException.ILLEGAL_USE is thrown if the mode is not MODE_ENCRYPT. Clarify CryptoException.ILLEGAL_VALUE if the tag length is not equal to the generated tag length e.g the length passed in init() method for ALG_AES_CCM.
- Method boolean verifyTag(byte[] receivedTagBuf, short receivedTagOff, short receivedTagLen, short requiredTagLen) – Replace “bits” with “bytes”. Clarify that if receivedTagLen and requiredTagLen are valid values and receivedTagLen < requiredTagLen, the method returns false. Clarify CryptoException.ILLEGAL_USE is thrown if the mode is not MODE_DECRYPT.
javacardx.crypto.Cipher class
- Class description – Clarify the preserved (e.g. key and mode) and unpreserved instance values after a reset or a tear down.
- Constants PAD_ISO9796, PAD_ISO9796_MR, PAD_ISO9796_MR_SCHEME_2, PAD_ISO9796_MR_SCHEME_3 – Clarify that these constants refer to the signature production function B.6 and trailer field option 1 of the ISO9796 specification.
- Constant PAD_PKCS1_PSS – Clarify default salt length, scheme digest algorithm and MGF1 digest algorithm.
- Constants ALG_RSA_PKCS1_OAEP, PAD_PKCS1_OAEP, PAD_PKCS1_OAEP_SHA224, PAD_PKCS1_OAEP_SHA256, PAD_PKCS1_OAEP_SHA384, PAD_PKCS1_OAEP_SHA512, PAD_PKCS1_OAEP_SHA3_224, PAD_PKCS1_OAEP_SHA3_256, PAD_PKCS1_OAEP_SHA3_384, PAD_PKCS1_OAEP_SHA3_512 – Clarify the scheme digest algorithm and the MGF1 digest algorithm.
- Method void init(Key theKey, byte theMode) – Remove the note about “optimal performance” and add reference to SM4.
- Method void init(Key theKey, byte theMode, byte[] bArray, short bOff, short bLen) – Remove the note about “optimal performance”. Clarify the input array format for AES XTS mode. Clarify the input array format for SM4 CBC mode. Clarify the expected behavior for managing RSA OAEP parameters. CryptoException.NO_SUCH_ALGORITHM can be thrown if the parameters referenced in the byte array parameter are not supported in case of PAD_PKCS1_OAEP_EXT_PARAMETERS padding.
- Method short update(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset) – Clarify the expected output length based on the algorithm. Add reference to array views case when input/output buffers overlap.
- Method short doFinal(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset) – Clarify preserved (e.g. key and mode) and unpreserved instance values after doFinal operation.
javacardx.security.derivation.DerivationFunction class
- Class description – Clarify that after a reset or a tear down, the object state is reset, like after a call to one of the nextBytes() methods, and has to be initialized again using the init(AlgorithmParameterSpec) method.
Supported Platforms
The Java Card specification documents are accessible on any computer system with an Unzip utility, Adobe Acrobat Reader (version 4.0 or later), and a CSS-compliant web browser. View the HTML files using any of the following CSS-compliant browsers:
- Internet Explorer, version 5.0 or later.
- Mozilla Firefox, version 11.0 or later.
View the PDF files in your web browser with an appropriate plugin or in the Adobe® Acrobat Reader. Most recent browsers include the PDF reader plugin. However, if your browser doesn’t have one, then download the plugin from the Install Adobe Acrobat Reader website.
Downloading the Specification Documents
Perform the following steps to download the specifications:
- Download the specification bundle from the Java Card Technology website.
- Unzip the bundle.
- Browse to the
javacard_specifications-3_2/classicfolder. Theclassicdirectory has the following subfolders:api_classic: Contains the Java Card API specification for the Classic Edition, Version 3.2 with Preview Features in the JavadocTM tool HTML format. Use the available browsers to view the APIs. However, the APIs might not render well in Mozilla Firefox, version 3.0.10.jcre_classic: Contains the Java Card Runtime Environment specification for the Classic Edition, Version 3.2 in the PDF format (JCREspecCLASSIC-3_2.pdf).jcvm_classic: Contains the Java Card Virtual Machine specification for the Classic Edition, version 3.2 in the PDF format (JCVMspecCLASSIC_3_2.pdf).
Known Issues
There are no known issues.
Product Information
The Java Card Technology website provides useful information about the Java Card product.
You can access the Java Card Development Kit Tools User Guide from the Java Card Documentation website or from the Java Partner portal.
- Product news and reviews
- Release notes and product documentation
Java Card Specification Release Notes, Version 3.2 with Preview Features
G57033-01