add Installed to CashApplicationInfo
This commit is contained in:
parent
8c2d13ba90
commit
66a0a082fe
|
@ -15,6 +15,7 @@ type CashCommandSet struct {
|
||||||
func NewCashCommandSet(c types.Channel) *CashCommandSet {
|
func NewCashCommandSet(c types.Channel) *CashCommandSet {
|
||||||
return &CashCommandSet{
|
return &CashCommandSet{
|
||||||
c: c,
|
c: c,
|
||||||
|
CashApplicationInfo: &types.CashApplicationInfo{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +24,6 @@ func (cs *CashCommandSet) Select() error {
|
||||||
cmd.SetLe(0)
|
cmd.SetLe(0)
|
||||||
resp, err := cs.c.Send(cmd)
|
resp, err := cs.c.Send(cmd)
|
||||||
if err = cs.checkOK(resp, err); err != nil {
|
if err = cs.checkOK(resp, err); err != nil {
|
||||||
cs.CashApplicationInfo = &types.CashApplicationInfo{}
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package types
|
||||||
import "github.com/status-im/keycard-go/apdu"
|
import "github.com/status-im/keycard-go/apdu"
|
||||||
|
|
||||||
type CashApplicationInfo struct {
|
type CashApplicationInfo struct {
|
||||||
|
Installed bool
|
||||||
PublicKey []byte
|
PublicKey []byte
|
||||||
PublicKeyData []byte
|
PublicKeyData []byte
|
||||||
Version []byte
|
Version []byte
|
||||||
|
@ -15,6 +16,8 @@ func ParseCashApplicationInfo(data []byte) (*CashApplicationInfo, error) {
|
||||||
return nil, ErrWrongApplicationInfoTemplate
|
return nil, ErrWrongApplicationInfoTemplate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.Installed = true
|
||||||
|
|
||||||
pubKey, err := apdu.FindTag(data, apdu.Tag{TagApplicationInfoTemplate}, apdu.Tag{0x80})
|
pubKey, err := apdu.FindTag(data, apdu.Tag{TagApplicationInfoTemplate}, apdu.Tag{0x80})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue