Versions in this module Expand all Collapse all v0 v0.1.0 Jul 28, 2026 Changes in this version + const CommandChainingBit + var ErrInvalidCommand = errors.New("iso7816: invalid command APDU") + var ErrInvalidFragmentSize = errors.New("iso7816: invalid command fragment size") + var ErrInvalidOption = errors.New("iso7816: invalid option") + var ErrInvalidResponse = errors.New("iso7816: invalid response APDU") + var ErrNilCard = errors.New("iso7816: nil card") + var ErrResponseTooLarge = errors.New("iso7816: response data is too large") + type APDUError struct + SW1 byte + SW2 byte + func (e *APDUError) Error() string + func (e *APDUError) StatusWord() StatusWord + type Card interface + Transmit func(ctx context.Context, apdu []byte) ([]byte, error) + type Command struct + CLA byte + Data []byte + Encoding Encoding + INS byte + Le uint32 + P1 byte + P2 byte + func Chain(command Command, maxDataLength int) ([]Command, error) + func (c Command) MarshalBinary() ([]byte, error) + type Encoding uint8 + const EncodingAuto + const EncodingExtended + const EncodingShort + type ExchangeOption func(*exchangeOptions) + func WithMaxResponseSize(size int) ExchangeOption + func WithMoreDataStatusBytes(sw1 ...byte) ExchangeOption + type Response struct + Data []byte + Status StatusWord + func Exchange(ctx context.Context, card Card, command Command, opts ...ExchangeOption) (Response, error) + func ParseResponse(raw []byte) (Response, error) + func Transmit(ctx context.Context, card Card, command Command) (Response, error) + func (r Response) APDUError() error + func (r Response) MarshalBinary() ([]byte, error) + type StatusWord uint16 + const StatusSuccess + func NewStatusWord(sw1, sw2 byte) StatusWord + func (s StatusWord) CorrectLength() (uint32, bool) + func (s StatusWord) IsSuccess() bool + func (s StatusWord) MoreDataLength() (uint32, bool) + func (s StatusWord) SW1() byte + func (s StatusWord) SW2() byte + func (s StatusWord) String() string