|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.io.nfc.se.SecureElement
public class SecureElement
Represents a secure element on the device. The secure element can be either embedded or SIM-based.
| Field Summary | ||
|---|---|---|
|
static int |
BATTERY_OFF_MODE
Constant to indicate a battery off setting. |
|
static int |
BATTERY_ON_MODE
Constant to indicate a battery on setting. |
|
static int |
EMBEDDED
Constant to indicate an embedded secure element. |
|
static int |
SIM
Constant to indicate a SIM-based secure element. |
| Method Summary | ||
|---|---|---|
|
void |
addTechnologyTypesChangeListener(TechnologyTypesChangeListener listener)
Registers a listener to receive technology type routing change notifications. |
|
void |
addTransactionListener(TransactionListener listener)
Deprecated. As of version 7.1. Use SecureElement.addTransactionListener(TransactionListener, byte [][]) instead. |
|
void |
addTransactionListener(TransactionListener listener,
byte[][] aids)
Registers a listener to receive transaction notifications for a specific set of AIDs. |
|
int |
getTechnologyTypes(int batteryMode)
Returns the technology types that the secure element is using for card emulation. |
|
int |
getType()
Returns the secure element type. |
|
String |
getUri()
Returns a URI that can be used to open an APDUConnection to the
secure element. |
|
String |
getUri(byte[] aid)
Returns a URI that can be used to open an APDUConnection to a
specific application on a secure element. |
|
boolean |
isTransactionListenerRegistered(byte[] aid)
Checks whether there has been a transaction listener registered for the input AID. |
|
void |
removeTechnologyTypesChangeListener(TechnologyTypesChangeListener listener)
Unregisters a technology types change listener. |
|
void |
removeTransactionListener(TransactionListener listener)
Unregisters a TransactionListener object. |
|
void |
setTechnologyTypes(int batteryMode,
int technologyTypes)
Sets the technology types that this card should use for card emulation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BATTERY_OFF_MODE
public static final int BATTERY_ON_MODE
public static final int SIM
public static final int EMBEDDED
| Method Detail |
|---|
public String getUri()
APDUConnection to the
secure element.
APDUConnection to the secure element.public String getUri(byte[] aid)
APDUConnection to a
specific application on a secure element.
aid - The ID of the application.
APDUConnection to the application on
the secure element.public int getType()
SecureElement.SIM or
SecureElement.EMBEDDED.
public int getTechnologyTypes(int batteryMode)
throws NFCException
batteryMode - The battery mode that the technology types apply to. Can be either
BATTERY_ON or BATTERY_OFF
TechnologyTypes used by the secure element.
IllegalArgumentException - If the batteryMode parameter is not valid
NFCException - If the currently supported technology types cannot
be returned
public void setTechnologyTypes(int batteryMode,
int technologyTypes)
throws NFCException
batteryMode - The battery mode that the technology types apply to. Can be either
BATTERY_ON or BATTERY_OFFtechnologyTypes - The TechnologyType that this secure element may use when
doing card emulation.
IllegalArgumentException - If technologyTypes is not
in the valid range, or the batteryMode parameter is invalid
NFCException - When the technology types cannot be set.
public void addTransactionListener(TransactionListener listener)
throws NFCException
SecureElement.addTransactionListener(TransactionListener, byte [][]) instead.
main( String [] args ). It is recommended that if your application is started with
this parameter, you exit your application once you have completed any processing or user interaction.
Note that MIDlets can alternatively add a PushRegistry entry in order to be launched when a particular
AID is selected over the RF interface. The entry must be in the form of a JSR-177 connection string.
For example, an appropriate PushRegistry entry to listen for selection events on the SIM for the AID a0.00.00.00.03.00.00.00
would be "apdu:0;target=a0.00.00.00.03.00.00.00".
Note: As of BlackBerry 7.1, this method will always throw an NFCException if called. Use
SecureElement.addTransactionListener(TransactionListener, byte [][]) instead.
listener - The TransactionListener object to receive
transaction notifications.
NFCException - if the listener cannot be registered.
IllegalArgumentException - if the SEProtocol is invalid.
public void addTransactionListener(TransactionListener listener,
byte[][] aids)
throws NFCException
main( String [] args ). It is recommended that if your application is started with
this parameter, you exit your application once you have completed any processing or user interaction.
Note that MIDlets can alternatively add a PushRegistry entry in order to be launched when a particular
AID is selected over the RF interface. The entry must be in the form of a JSR-177 connection string.
For example, an appropriate PushRegistry entry to listen for selection events on the SIM for the AID a0.00.00.00.03.00.00.00
would be "apdu:0;target=a0.00.00.00.03.00.00.00".
listener - The TransactionListener object to receive
transaction notifications.aids - The AIDs to listen to for transaction notifications. First caller to specify an AID wins; all other
callers will receive an NFCException.
NFCException - if the listener cannot be registered because the se transaction manager is not present or this listener has already
been registered
IllegalArgumentException - if the SEProtocol type is invalid or if the input aids are invalid.
SecurityException - if the terminal application does not have ACF permission to connect to the applet.
public boolean isTransactionListenerRegistered(byte[] aid)
throws NFCException
aid - The AID to check if there's a transaction listener registered for.
NFCException - if cannot determine whether there is a listener registered for the AID.
IllegalArgumentException - if the SEProtocol type is invalid or if the given AID is invalid.
SecurityException - if the terminal application does not have ACF permission to connect to the applet.
public void removeTransactionListener(TransactionListener listener)
throws NFCException
TransactionListener object.
listener - The TransactionListener to unregister.
NFCException - If the listener cannot be removed.
public void addTechnologyTypesChangeListener(TechnologyTypesChangeListener listener)
throws NFCException
main( String [] args ). It is recommended that if your application is
started with this parameter, you exit your application once you have completed any processing
or user interaction.
listener - The TechnologyTypesChangeListener object to receive
technology type change notifications.
NFCException - if the listener cannot be registered.
public void removeTechnologyTypesChangeListener(TechnologyTypesChangeListener listener)
throws NFCException
listener - The TransactionListener to unregister.
NFCException - If the listener cannot be removed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal