visa.openplatform
Class OPSystem

java.lang.Object
  extended byvisa.openplatform.OPSystem

public final class OPSystem
extends java.lang.Object

The OPSystem class exposes a subset of the behavior of the Card Manager to the outside world. It extends the functionality of the JCRE 2.1 API by providing card management services to applications. It implements and enforces a Card Issuer's security policies. This class provides the functionality of a runtime environment running at the JCRE ‘system’ (privileged) context. The details of the JCRE ‘system’ context implementation are left to the implementer. This class’s public interface is composed of static methods visible to all applets importing the openplatform package. This is a ‘singleton’ class (only one instance is created for the lifetime of the card).


Field Summary
static byte APPLET_BLOCKED
          Application life cycle state indicating the application is BLOCKED.
static byte APPLET_INSTALLED
          Application life-cycle state indicating the application is INSTALLED.
static byte APPLET_LOCKED
          Application life-cycle state indicating the application is LOCKED.
static byte APPLET_PERSONALIZED
          Application life cycle state indicating the application is PERSONALIZED.
static byte APPLET_SELECTABLE
          Application life cycle state indicating the application is SELECTABLE.
static byte CARD_INITIALIZED
          Card Manager life cycle state indicating the Card Manager is INITIALIZED.
static byte CARD_LOCKED
          Card Manager life cycle state indicating the Card Manager is CM_LOCKED.
static byte CARD_OP_READY
          Card Manager life cycle state indicating the Card Manager is OP_READY.
static byte CARD_SECURED
          Card Manager life cycle state indicating the Card Manager is SECURED.
static byte INITIALIZED
          Deprecated. Use CARD_INITIALIZED
static byte PACKAGE_LOADED
          The executable load file life cycle state indicating the package is LOADED.
 
Method Summary
static byte getCardContentState()
          This method returns the life cycle state of the selected application.
static byte getCardManagerState()
          This method returns the current life cycle state for the Card Manager.
static void getCPLCData(javacard.framework.APDU apdu, short apdu_offset, short cplc_offset, short length)
          This method returns the card's production life cycle data.
static ProviderSecurityDomain getSecurityDomain()
          This method returns the handle of the application’s associated Security Domain.
static byte getTriesRemaining()
          This method returns the PIN tries remaining for the Global PIN.
static boolean lockCardManager()
          This method allows an applet to lock the card.
static boolean setATRHistBytes(byte[] buffer, short bOffset, byte bLength)
          This method sets the historical bytes contained in the ATR (Answer To Reset).
static boolean setCardContentState(byte state)
          This is used by an application to transition its own life cycle state.
static boolean setPin(javacard.framework.APDU apdu, short offset)
          This method is used to initialize the Card Global PIN.
static boolean terminateCardManager()
          This method allows an application to terminate the card.
static boolean verifyPin(javacard.framework.APDU apdu, short offset)
          This method allows an application to check the validity of a PIN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLET_BLOCKED

public static final byte APPLET_BLOCKED
Application life cycle state indicating the application is BLOCKED. The application, due to some off-card or internal event, has transitioned itself to the life cycle state of BLOCKED.

See Also:
Constant Field Values

APPLET_PERSONALIZED

public static final byte APPLET_PERSONALIZED
Application life cycle state indicating the application is PERSONALIZED. The applet has been loaded with application specific data and has transitioned itself to the life cycle state of PERSONALIZED.

See Also:
Constant Field Values

APPLET_INSTALLED

public static final byte APPLET_INSTALLED
Application life-cycle state indicating the application is INSTALLED. The applet has been instantiated and has completed the install() method.

See Also:
Constant Field Values

APPLET_SELECTABLE

public static final byte APPLET_SELECTABLE
Application life cycle state indicating the application is SELECTABLE. The applet has reached the life cycle state of SELECTABLE and is available to receive SELECT commands from outside the card.

See Also:
Constant Field Values

APPLET_LOCKED

public static final byte APPLET_LOCKED
Application life-cycle state indicating the application is LOCKED. This state results from a Card Manager internal invoked or Card Issuer invoked action: LOCKED = 0xFF.

See Also:
Constant Field Values

CARD_INITIALIZED

public static final byte CARD_INITIALIZED
Card Manager life cycle state indicating the Card Manager is INITIALIZED.

See Also:
Constant Field Values

INITIALIZED

public static final byte INITIALIZED
Deprecated. Use CARD_INITIALIZED

See Also:
Constant Field Values

CARD_SECURED

public static final byte CARD_SECURED
Card Manager life cycle state indicating the Card Manager is SECURED.

See Also:
Constant Field Values

CARD_LOCKED

public static final byte CARD_LOCKED
Card Manager life cycle state indicating the Card Manager is CM_LOCKED.

See Also:
Constant Field Values

CARD_OP_READY

public static final byte CARD_OP_READY
Card Manager life cycle state indicating the Card Manager is OP_READY.

See Also:
Constant Field Values

PACKAGE_LOADED

public static final byte PACKAGE_LOADED
The executable load file life cycle state indicating the package is LOADED. The package in a CAP file has been loaded onto a card.

See Also:
Constant Field Values
Method Detail

getCardContentState

public static byte getCardContentState()
This method returns the life cycle state of the selected application. The Card Manager locates the AID of the selected application in the registry and returns the life cycle state.

Returns:
Life cycle state.
See Also:
APPLET_SELECTABLE, APPLET_PERSONALIZED, APPLET_BLOCKED

getCardManagerState

public static byte getCardManagerState()
This method returns the current life cycle state for the Card Manager.

Returns:
Life cycle state.
See Also:
CARD_INITIALIZED, CARD_OP_READY, CARD_SECURED, CARD_LOCKED

getSecurityDomain

public static ProviderSecurityDomain getSecurityDomain()
This method returns the handle of the application’s associated Security Domain. The Card Manager locates the AID of the selected application in the registry and determines the application’s associated Security Domain.

Returns:
Provider Security Domain.

getTriesRemaining

public static byte getTriesRemaining()
This method returns the PIN tries remaining for the Global PIN.

Returns:
PIN tries remaining.

lockCardManager

public static boolean lockCardManager()
This method allows an applet to lock the card. If the calling applet has been authorized to perform this operation and the operation is successful, this method returns true. The Card Manager locates the AID of the selected application in the registry and determines if the application has the required privilege.

Returns:
true if the CardManager locked, false otherwise.

setATRHistBytes

public static boolean setATRHistBytes(byte[] buffer,
                                      short bOffset,
                                      byte bLength)
This method sets the historical bytes contained in the ATR (Answer To Reset). The sequence of bytes will be set on a subsequent power-up or reset. Only the default selected application may invoke this method. The Card Manager locates the AID of the selected application in the registry and determines if the application has the required privilege.

Parameters:
buffer - Array containing the ATR historical bytes.
bOffset - Offset within the buffer where ATR historical bytes begin.
bLength - Length of the ATR historical bytes in the buffer.
Returns:
true if ATR bytes set, false otherwise.

setCardContentState

public static boolean setCardContentState(byte state)
This is used by an application to transition its own life cycle state. The Card Manager locates the AID of the selected application in the registry and changes the application’s life cycle state. The Card Manager is responsible for enforcing the state transition rules.

Parameters:
state - transition to this state.
Returns:
true if the operation is successful, false otherwise.

setPin

public static boolean setPin(javacard.framework.APDU apdu,
                             short offset)
This method is used to initialize the Card Global PIN. The length of the PIN is retrieved from the Pin structure. If the calling applet has been authorized to perform this operation and the operation is successful, this method returns true, otherwise false.

Parameters:
apdu - APDU object
offset - short Offset within an APDU buffer
Returns:
true if the operation is successful, false otherwise.

terminateCardManager

public static boolean terminateCardManager()
This method allows an application to terminate the card. If allows an applet to request the irreversible termination of the Card Manager's functionality. The card becomes inoperable. If the calling applet has been authorized to perform this operation, this method returns true, otherwise false.

Returns:
true if the operation is successful, false otherwise.

verifyPin

public static boolean verifyPin(javacard.framework.APDU apdu,
                                short offset)
This method allows an application to check the validity of a PIN.

Returns:
true if the supplied PIN matches the Card Global PIN, and false otherwise.

getCPLCData

public static void getCPLCData(javacard.framework.APDU apdu,
                               short apdu_offset,
                               short cplc_offset,
                               short length)
This method returns the card's production life cycle data. The calling applet passes a handle to the APDU object and an offset where the CPLC data shall be placed.

Parameters:
apdu - APDU object
apdu_offset - Offset within an APDU buffer
cplc_offset - Offset within the CPLC buffer
length - length of the data to be placed into the buffer
Throws:
javacard.framework.CardRuntimeException - if decryption fails.


Copyright (c) GlobalPlatform Inc. All Rights Reserved. The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.