keycard-go/globalplatform/commands.go

32 lines
513 B
Go
Raw Normal View History

2018-09-19 13:31:06 +00:00
package globalplatform
import "github.com/status-im/status-go/smartcard/apdu"
2018-09-25 15:43:26 +00:00
const (
Cla = uint8(0x00)
ClaGp = uint8(0x80)
2018-09-19 13:31:06 +00:00
2018-09-25 15:43:26 +00:00
InsSelect = uint8(0xA4)
InsInitializeUpdate = uint8(0x50)
)
2018-09-19 13:31:06 +00:00
func NewCommandSelect(aid []byte) *apdu.Command {
return apdu.NewCommand(
Cla,
InsSelect,
uint8(0x04),
uint8(0x00),
aid,
)
}
2018-09-25 15:43:26 +00:00
func NewCommandInitializeUpdate(challenge []byte) *apdu.Command {
return apdu.NewCommand(
ClaGp,
InsInitializeUpdate,
uint8(0x00),
uint8(0x00),
challenge,
)
}