Documentation ¶
Overview ¶
package card provides interfaces for accdssing smartcards
Index ¶
- func IsLoginRequired(e error) bool
- func IsStatus(e error, sw uint16) bool
- func PinAttempts(e error) int
- type Card
- func (c *Card) Command(cla, ins, p1, p2 byte, data []byte, le uint) ([]byte, error)
- func (c *Card) GetDataObject(name uint32) ([]byte, error)
- func (c *Card) GetFileData(name FileID, body []byte) ([]byte, error)
- func (c *Card) Lock() error
- func (c *Card) PutDataObject(name uint32, buf []byte) error
- func (c *Card) PutFileData(name FileID, body []byte) error
- func (c *Card) SelectDF(name []byte) ([]byte, error)
- func (c *Card) Transact(req ReqAPDU) (RespAPDU, error)
- func (c *Card) Unlock() error
- func (c *Card) Verify(id byte, pin []byte) error
- type CardError
- type FileID
- type ReqAPDU
- type RespAPDU
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLoginRequired ¶
IsLoginRequred checks if an error is a CardError representing a login required error
func PinAttempts ¶
PinAttempts returns the number of PIN attempts remaining from an error. If this is not a PIN attempts remaining error, returns -1
Types ¶
type Card ¶
Card represents a single card Card wraps a transport.Card providing higher level operations
func (*Card) GetFileData ¶
GetFileData returns the data contained in the specified file, including the specified request
func (*Card) PutFileData ¶
PutFileData puts data in the specified file
type CardError ¶
type CardError struct {
SW uint16
}
func ErrorFromAPDU ¶
ErrorFromAPDU constructs a CardError from a response APDU
Click to show internal directories.
Click to hide internal directories.