Interface SmartCardConnection

All Superinterfaces:
AutoCloseable, Closeable, YubiKeyConnection

public interface SmartCardConnection extends YubiKeyConnection
A connection capable of sending APDUs and receiving their responses.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Retrieve Answer to reset (or answer to select for NFC)
    Checks what transport the connection is using (USB or NFC).
    boolean
    Standard APDUs have a 1-byte length field, allowing a maximum of 255 payload bytes, which results in a maximum APDU length of 261 bytes.
    byte[]
    sendAndReceive(byte[] apdu)
    Sends a command APDU to the YubiKey, and reads a response.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • sendAndReceive

      byte[] sendAndReceive(byte[] apdu) throws IOException
      Sends a command APDU to the YubiKey, and reads a response.
      Parameters:
      apdu - The binary APDU data to be sent.
      Returns:
      The response back from the YubiKey.
      Throws:
      IOException - in case of communication error
    • getTransport

      Transport getTransport()
      Checks what transport the connection is using (USB or NFC).
      Returns:
      the physical transport used for the connection.
    • isExtendedLengthApduSupported

      boolean isExtendedLengthApduSupported()
      Standard APDUs have a 1-byte length field, allowing a maximum of 255 payload bytes, which results in a maximum APDU length of 261 bytes. Extended length APDUs have a 3-byte length field, allowing 65535 payload bytes.
      Returns:
      true if this connection object supports Extended length APDUs.
    • getAtr

      byte[] getAtr()
      Retrieve Answer to reset (or answer to select for NFC)
      Returns:
      data block returned for reset command