Documentation ¶
Index ¶
- Variables
- func APDUGetBlockRsp(scardCard Transmiter, apducmds [][]byte, apducmdRsp []byte) ([]byte, error)
- func APDUGetRsp(card Transmiter, apducmds [][]byte, ispadzeroOptional ...bool) ([]byte, error)
- func ThIDCardAddress(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardBirth(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardCID(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardExpireDate(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardFullnameEn(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardFullnameTh(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardGender(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardIssueDate(card Transmiter, opt ...OptThIDCard) (string, error)
- func ThIDCardIssuer(card Transmiter, opt ...OptThIDCard) (string, error)
- func WriteBlockToFile(databytes []byte, fullname string) (int, error)
- type OptThIDCard
- type Transmiter
Constants ¶
This section is empty.
Variables ¶
var APDUThaiIDCardAddress = [][]byte{
{0x80, 0xB0, 0x15, 0x79, 0x02, 0x00, 0x64},
{0x00, 0xc0, 0x00, 0x00, 0x64},
}
APDUThaiIDCardAddress Address resp: 704/82####...#...#...#...
var APDUThaiIDCardBirth = [][]byte{
{0x80, 0xB0, 0x00, 0xD9, 0x02, 0x00, 0x08},
{0x00, 0xc0, 0x00, 0x00, 0x08},
}
APDUThaiIDCardBirth Date of birth resp: 25351126
var APDUThaiIDCardCID = [][]byte{
{0x80, 0xb0, 0x00, 0x04, 0x02, 0x00, 0x0d},
{0x00, 0xc0, 0x00, 0x00, 0x0d},
}
APDUThaiIDCardCID ...
var APDUThaiIDCardExpiredate = [][]byte{
{0x80, 0xB0, 0x01, 0x6F, 0x02, 0x00, 0x08},
{0x00, 0xc0, 0x00, 0x00, 0x08},
}
APDUThaiIDCardExpiredate Expire Date resp: 25691125
var APDUThaiIDCardFullInfo = [][]byte{
{0x80, 0xb0, 0x00, 0x11, 0x02, 0x00, 0xd1},
{0x00, 0xc0, 0x00, 0x00, 0xd1},
}
APDUThaiIDCardFullInfo Fullname Thai + Eng + BirthDate + Sex
var APDUThaiIDCardFullnameEn = [][]byte{
{0x80, 0xb0, 0x00, 0x75, 0x02, 0x00, 0x64},
{0x00, 0xc0, 0x00, 0x00, 0x64},
}
APDUThaiIDCardFullnameEn Fullname English resp: Mr.#Napat##Rungruangbangchan
var APDUThaiIDCardFullnameTh = [][]byte{
{0x80, 0xb0, 0x00, 0x11, 0x02, 0x00, 0x64},
{0x00, 0xc0, 0x00, 0x00, 0x64},
}
APDUThaiIDCardFullnameTh Fullname Thai
var APDUThaiIDCardGender = [][]byte{
{0x80, 0xB0, 0x00, 0xE1, 0x02, 0x00, 0x01},
{0x00, 0xc0, 0x00, 0x00, 0x01},
}
APDUThaiIDCardGender Gender resp: 1=Male, 2=Female
var APDUThaiIDCardIssuedate = [][]byte{
{0x80, 0xB0, 0x01, 0x67, 0x02, 0x00, 0x08},
{0x00, 0xc0, 0x00, 0x00, 0x08},
}
APDUThaiIDCardIssuedate Issue Date resp: 25610119
var APDUThaiIDCardIssuer = [][]byte{
{0x80, 0xB0, 0x01, 0x67, 0x02, 0x00, 0x08},
{0x00, 0xc0, 0x00, 0x00, 0x08},
}
APDUThaiIDCardIssuer Card Issuer resp: 25610119
var APDUThaiIDCardPhoto = [][]byte{ []byte{0x80, 0xB0, 0x01, 0x7B, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x02, 0x7A, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x03, 0x79, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x04, 0x78, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x05, 0x77, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x06, 0x76, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x07, 0x75, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x08, 0x74, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x09, 0x73, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0A, 0x72, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0B, 0x71, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0C, 0x70, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0D, 0x6F, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0E, 0x6E, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x0F, 0x6D, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x10, 0x6C, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x11, 0x6B, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x12, 0x6A, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x13, 0x69, 0x02, 0x00, 0xFF}, []byte{0x80, 0xB0, 0x14, 0x68, 0x02, 0x00, 0xFF}, }
APDUThaiIDCardPhoto Card Photo (JPEG)
var APDUThaiIDCardPhotoRsp = []byte{0x00, 0xc0, 0x00, 0x00, 0xFF}
APDUThaiIDCardPhotoRsp ...
var APDUThaiIDCardSelect = [][]byte{{0x00, 0xA4, 0x04, 0x00, 0x08, 0xA0, 0x00, 0x00, 0x00, 0x54, 0x48, 0x00, 0x01}}
APDUThaiIDCardSelect Select Thai ID Card
Functions ¶
func APDUGetBlockRsp ¶
func APDUGetBlockRsp(scardCard Transmiter, apducmds [][]byte, apducmdRsp []byte) ([]byte, error)
APDUGetBlockRsp Send list of APDU and append all response
func APDUGetRsp ¶
func APDUGetRsp(card Transmiter, apducmds [][]byte, ispadzeroOptional ...bool) ([]byte, error)
APDUGetRsp Send list of APDU and get last command response ispadzeroOptional is optional(default = true) to replace adpu tail section
func ThIDCardAddress ¶
func ThIDCardAddress(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardAddress get address from Thai national ID smart card.
func ThIDCardBirth ¶
func ThIDCardBirth(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardBirth get birth date from Thai national ID smart card.
func ThIDCardCID ¶
func ThIDCardCID(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardCID get cid from Thai national ID smart card.
func ThIDCardExpireDate ¶
func ThIDCardExpireDate(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardExpireDate get expire date from Thai national ID smart card.
func ThIDCardFullnameEn ¶
func ThIDCardFullnameEn(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardFullnameEn get full name(English) from Thai national ID smart card.
func ThIDCardFullnameTh ¶
func ThIDCardFullnameTh(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardFullnameTh get full name(Thai) from Thai national ID smart card.
func ThIDCardGender ¶
func ThIDCardGender(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardGender get gender from Thai national ID smart card.
func ThIDCardIssueDate ¶
func ThIDCardIssueDate(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardIssueDate get issue date from Thai national ID smart card.
func ThIDCardIssuer ¶
func ThIDCardIssuer(card Transmiter, opt ...OptThIDCard) (string, error)
ThIDCardIssuer get issuer from Thai national ID smart card.
Types ¶
type OptThIDCard ¶
type OptThIDCard func(*thidcardOpts)
OptThIDCard provide options for each operation.
func OptSharpToSpace ¶
func OptSharpToSpace() OptThIDCard
OptSharpToSpace add option to convert all # to space before return a string
func OptTis620ToUtf8 ¶
func OptTis620ToUtf8() OptThIDCard
OptTis620ToUtf8 add option to convert TIS620 string back to UTF-8 before return a string
type Transmiter ¶
Transmiter is an interface that wrap the command to communicate with smart card via application protocol data unit (APDU) according to ISO/IEC 7816.