add RemoveKey command

This commit is contained in:
Andrea Franz 2019-03-27 11:22:20 +01:00
parent 5b441cd26f
commit 00dc453676
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 17 additions and 0 deletions

View File

@ -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 {

View File

@ -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,