add Cash applet installation

This commit is contained in:
Andrea Franz 2019-11-19 10:51:44 +01:00
parent 96c3596fca
commit 8515e729d7
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 15 additions and 2 deletions

View File

@ -127,6 +127,14 @@ func (cs *CommandSet) InstallKeycardApplet() error {
[]byte{}) []byte{})
} }
func (cs *CommandSet) InstallCashApplet() error {
return cs.InstallForInstall(
identifiers.PackageAID,
identifiers.CashAID,
identifiers.CashInstanceAID,
[]byte{})
}
func (cs *CommandSet) InstallForInstall(packageAID, appletAID, instanceAID, params []byte) error { func (cs *CommandSet) InstallForInstall(packageAID, appletAID, instanceAID, params []byte) error {
cmd := NewCommandInstallForInstall(packageAID, appletAID, instanceAID, params) cmd := NewCommandInstallForInstall(packageAID, appletAID, instanceAID, params)
resp, err := cs.sc.Send(cmd) resp, err := cs.sc.Send(cmd)

View File

@ -6,11 +6,16 @@ var (
GlobalPlatformDefaultKey = []byte{0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f} GlobalPlatformDefaultKey = []byte{0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f}
KeycardDevelopmentKey = []byte{0xc2, 0x12, 0xe0, 0x73, 0xff, 0x8b, 0x4b, 0xbf, 0xaf, 0xf4, 0xde, 0x8a, 0xb6, 0x55, 0x22, 0x1f} KeycardDevelopmentKey = []byte{0xc2, 0x12, 0xe0, 0x73, 0xff, 0x8b, 0x4b, 0xbf, 0xaf, 0xf4, 0xde, 0x8a, 0xb6, 0x55, 0x22, 0x1f}
PackageAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01} PackageAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01}
KeycardAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x01}
KeycardAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x01}
NdefAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x02} NdefAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x02}
NdefInstanceAID = []byte{0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01} NdefInstanceAID = []byte{0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01}
CashAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x03}
CashInstanceAID = []byte{0xA0, 0x00, 0x00, 0x08, 0x04, 0x00, 0x01, 0x03, 0x01}
KeycardDefaultInstanceIndex = 1 KeycardDefaultInstanceIndex = 1
ErrInvalidInstanceIndex = errors.New("instance index must be between 1 and 255") ErrInvalidInstanceIndex = errors.New("instance index must be between 1 and 255")