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