CardChannel

CardChannel (카드 논리 채널)

스마트카드에 대한 논리 채널 연결을 나타내는 클래스입니다. 카드와 APDU를 교환하는 데 사용됩니다.

출처: Java API Reference

본문

CardChannel 객체는 Card.getBasicChannel()이나 Card.openLogicalChannel() 메서드를 호출해 얻을 수 있어요.

protected CardChannel()
public abstract Card getCard()
public abstract int getChannelNumber()
public abstract ResponseAPDU transmit(CommandAPDU command) throws CardException
public abstract int transmit(ByteBuffer command, ByteBuffer response) throws CardException
public abstract void close() throws CardException

transmit(CommandAPDU)는 명령 APDU를 보내고 응답 APDU를 반환합니다. 바이트 버퍼를 받는 transmit은 성능을 위해 버퍼 재사용을 지원하는 변형이고, close()로 채널을 닫습니다. getCard()는 이 채널이 속한 카드를, getChannelNumber()는 채널 번호를 반환합니다.

더 알아보기 (Learn more)

Java 공식 API