SHOW Signed
 

net.rim.device.api.smartcard
Class AnswerToReset

java.lang.Object
  |
  +--net.rim.device.api.smartcard.AnswerToReset
All Implemented Interfaces:
Persistable

public class AnswerToReset
extends Object
implements Persistable

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.

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:
JDE 4.1.0
See Also:
SmartCardReader

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  byte getBaudAndClockRate()
          Returns the TA(1) Byte of the ATR.
 Category: Signed  int getBWT()
          Returns the Block Waiting Time (BWT).
 Category: Signed  byte[] getBytes()
          Returns a copy the ATR bytes The first byte is the TS byte followed by a maximum of 32 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_CRC

public static final int EDC_CRC
Since:
JDE 4.2.0
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.

EDC_LRC

public static final int EDC_LRC
Since:
JDE 4.2.0
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.
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.
Since:
JDE 4.1.0
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.
Method Detail

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.
Since:
JDE 4.1.0
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.

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:
Since:
JDE 4.2.0
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.

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
Since:
JDE 4.2.0
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.

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
Since:
JDE 4.1.0
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.

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.
Since:
JDE 4.2.0
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.

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.
Since:
JDE 4.1.0
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.

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
Since:
JDE 4.2.0
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.

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.
Since:
JDE 4.1.0
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.

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.
Since:
JDE 4.1.0
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.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.