add RemoveKey command
This commit is contained in:
parent
5b441cd26f
commit
00dc453676
|
@ -186,6 +186,12 @@ func (cs *CommandSet) GenerateKey() ([]byte, error) {
|
|||
return resp.Data, nil
|
||||
}
|
||||
|
||||
func (cs *CommandSet) RemoveKey() error {
|
||||
cmd := NewCommandRemoveKey()
|
||||
resp, err := cs.sc.Send(cmd)
|
||||
return cs.checkOK(resp, err)
|
||||
}
|
||||
|
||||
func (cs *CommandSet) DeriveKey(path string) error {
|
||||
cmd, err := NewCommandDeriveKey(path)
|
||||
if err != nil {
|
||||
|
|
11
commands.go
11
commands.go
|
@ -17,6 +17,7 @@ const (
|
|||
InsPair = uint8(0x12)
|
||||
InsGetStatus = uint8(0xF2)
|
||||
InsGenerateKey = uint8(0xD4)
|
||||
InsRemoveKey = uint8(0xD3)
|
||||
InsVerifyPIN = uint8(0x20)
|
||||
InsDeriveKey = uint8(0xD1)
|
||||
InsSign = uint8(0xC0)
|
||||
|
@ -101,6 +102,16 @@ func NewCommandGenerateKey() *apdu.Command {
|
|||
)
|
||||
}
|
||||
|
||||
func NewCommandRemoveKey() *apdu.Command {
|
||||
return apdu.NewCommand(
|
||||
globalplatform.ClaGp,
|
||||
InsRemoveKey,
|
||||
uint8(0),
|
||||
uint8(0),
|
||||
[]byte{},
|
||||
)
|
||||
}
|
||||
|
||||
func NewCommandVerifyPIN(pin string) *apdu.Command {
|
||||
return apdu.NewCommand(
|
||||
globalplatform.ClaGp,
|
||||
|
|
Loading…
Reference in New Issue