> For the complete documentation index, see [llms.txt](https://xoops.gitbook.io/xmf-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xoops.gitbook.io/xmf-cookbook/reference/key/keyabstract.md).

# KeyAbstract

The `Xmf\Key\KeyAbstract` is an abstract class that defines a Key.

The concrete implementations of KeyAbstract are responsible for

* creating keys
* serializing and deserializing key data for storage
* interacting with a StorageInterface implementation for key persistence as needed

## \_\_construct(*$storage*, *$name*)

The StorageInterface instance, *$storage*, handles persistence for this key. The *$name* parameter is the symbolic name of the key to use. The *$name* uniquely identifies the key in the key store. The key name should relate to a specific application action, or a closely related set of actions.

## getSigning()

Returns a key string to be used for signing.

## getVerifying()

Returns a key string to be used for verifying.

## create()

Create the key and store it for use.

Returns true on success, otherwise false.

## kill()

Delete the key from storage.
