Delete an existing key

1/23/2015 2:25:20 PM
Gravatar
Total Posts 33

Delete an existing key

How can simply delete an existing key? 

 

I can't find anything, but does it exist something like "Session.DeleteKey(string label)"?

 

Piero

1/28/2015 4:02:50 PM
Gravatar
Total Posts 33

Re: Delete an existing key

Wow, so many answers for me... cheeky

 

But I'm a good person, so.... here the magical solution, maybe useful for someone:

 

public static int DestroyKey(string label, string type)
{
    try
    {
        CryptokiObject obj = findTarget(label, type);
        session.Objects.Destroy(obj);
        return Settings.OK_RESPONSE;
    }
    catch (Exception e)
    {
        return -1;
    }