diff --git a/command_set.go b/command_set.go index 13934f1..84b4a31 100644 --- a/command_set.go +++ b/command_set.go @@ -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 { diff --git a/commands.go b/commands.go index 1ba64b5..37ed466 100644 --- a/commands.go +++ b/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,