net.rim.device.api.smartcard
Class AnswerToReset

java.lang.Object
  extended by net.rim.device.api.smartcard.AnswerToReset

public class AnswerToReset
extends Object

Represents an Answer to Reset object(ATR). The Answer to Reset structure is defined in ISO 7816-3. It contains two parts, protocol bytes and historical bytes.

It is assumed that Answer to Reset objects will be different for two different families or brands of smart cards. The Answer To Reset object is used to identify what type of card is present in the reader.

See Also:
SmartCardReader
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

Field Summary
Category: Signed static int EDC_CRC
           
Category: Signed static int EDC_LRC
           
 
Constructor Summary
Category: Signed AnswerToReset(byte[] atr)
          Constructs an ATR object using the response from the card when an ATR request is sent.
 
Method Summary
Category: Signed  boolean equals(Object other)
          Returns true if two AnswerToReset objects have the same protocol and historical bytes, false otherwise.
Category: Signed  int getBWT()
          Returns the Block Waiting Time (BWT).
Category: Signed  byte getBaudAndClockRate()
          Returns the TA(1) Byte of the ATR.
Category: Signed  byte[] getBytes()
          Returns a copy the ATR bytes.
Category: Signed  int getEdcType()
          Returns the EdcType.
Category: Signed  byte[] getHistoricalBytes()
          Returns the historical bytes from the raw data that is formatted as per ISO 7816-3.
Category: Signed  int getIFS()
          Returns the maximum length of the information filed (IFS) of blocks wich cna be recieved by the card.
Category: Signed  byte[] getProtocolBytes()
          Returns the protocol bytes from the raw data that is formatted as per ISO 7816-3.
Category: Signed  String toString()
          Returns a String representation of the object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Field Detail

EDC_LRC

public static final int EDC_LRC
See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

EDC_CRC

public static final int EDC_CRC
See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0


Constructor Detail

AnswerToReset

public AnswerToReset(byte[] atr)
Constructs an ATR object using the response from the card when an ATR request is sent. The first byte must be the TS byte followed by a maximum of 32 bytes. The array must contain at least the TS byte( thus the first byte must be 0x3b or 0x3F )and the T0 byte. This method also checks if the length of the atr is equal to TS byte + the protocol bytes + the historical bytes + the TCK byte in the T = 1 case, or TS byte + the protocol bytes + the historical bytes or TS byte + the protocol bytes + the historical bytes + the TCK byte in the T = 0 case. It also checks the TCK in the T = 1 case ( It usually does not appear in the T = 0 case ).

See ISO 7816-3 on how an ATR response is constructed.

Parameters:
atr - A byte array representing the response from the card.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0


Method Detail

getBytes

public byte[] getBytes()
Returns a copy the ATR bytes. The first byte is the TS byte followed by a maximum of 32 bytes

Returns:
a copy of the ATR bytes
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getProtocolBytes

public byte[] getProtocolBytes()
Returns the protocol bytes from the raw data that is formatted as per ISO 7816-3. The TS byte is not included in the protocol bytes. Thus the first protocol byte is T0.

Returns:
A byte array containing the protocol bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getHistoricalBytes

public byte[] getHistoricalBytes()
Returns the historical bytes from the raw data that is formatted as per ISO 7816-3.

See ISO 7816-3 for specification on the meaning of the historical bytes. This does not include the TCK byte.

Returns:
A byte array containing the historical bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

equals

public boolean equals(Object other)
Returns true if two AnswerToReset objects have the same protocol and historical bytes, false otherwise.

Overrides:
equals in class Object
Parameters:
other - The item to compare this object against.
Returns:
True if the objects have the same protocol and historical bytes, false otherwise.
See Also:
Boolean.hashCode(), Hashtable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

toString

public String toString()
Returns a String representation of the object.

The String includes the historical and protocol bytes.

Overrides:
toString in class Object
Returns:
A String represention of the object, including the historical and protocol bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getIFS

public int getIFS()
Returns the maximum length of the information filed (IFS) of blocks wich cna be recieved by the card. The default is 32, but this value can be modified by the ATR. This value is used in the T = 1 protocol.

Returns:
ifs
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

getBWT

public int getBWT()
Returns the Block Waiting Time (BWT). The BWT is defined as the maximum delay between the leading edge of the last character of the block received by the card and the leading edge of the first character of the next block sent by the card. This value is used in the T = 1 protocol.

Returns:
bwt
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

getEdcType

public int getEdcType()
Returns the EdcType. The EDC conveys the error detection code of the block used in T=1. The two types of EDC are longitudinal redundancy check (LRC) and cyclic redundany check (CRC).

Returns:
1 for LRC and 2 for CRC.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

getBaudAndClockRate

public byte getBaudAndClockRate()
Returns the TA(1) Byte of the ATR. See section 6.5.1 and 6.5.2 of ISO/IEC 7816-3:1997(E) to determine how to calculate

Returns:
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0





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