# CreateVaultEncryptionKeyDto

A model the API reference uses in a request or a response. The operation pages link every field typed as this model here.

A request to create a named encryption key.

## Fields
- `name` (string) required: The name route editors pick the key by, up to 128 characters. A save is refused when another key has it, ignoring case. A route names the key by its id, so the name is a label only. (nullable, max length 128)
- `gateway` (string) required: The gateway that publishes the key, such as Clover, up to 64 characters. (nullable, max length 64)
- `publicKey` (string) required: The gateway's RSA public key, 2048 to 8192 bits, written in `keyFormat`, exactly as the gateway publishes it. (nullable, max length 4096)
- `keyFormat` ([VaultEncryptionKeyFormat](https://docs.winkpg.io/docs/api/models/VaultEncryptionKeyFormat.md)): How `publicKey` is written: `RawModulusExponent`, the base64 of the modulus followed by the public exponent, or `Pem`, a PEM public key or the base64 of a DER SubjectPublicKeyInfo.
  Values:
  - `Unknown`: Not set. Never valid on a filter that encrypts.
  - `RawModulusExponent`: The modulus followed by the public exponent, as one base64 value. The first modulus-length bytes are the modulus, and the rest is the exponent.
  - `Pem`: A PEM public key (BEGIN PUBLIC KEY or BEGIN RSA PUBLIC KEY), or the base64 of a DER SubjectPublicKeyInfo.
- `modulusLength` (integer(int32)): For a `RawModulusExponent` key: how many leading bytes are the modulus, 256 to 1024. Defaults to 256, a 2048-bit key. Leave it empty for a `Pem` key. (nullable)
- `expectedFingerprint` (string) required: The fingerprint you expect, from the gateway's published key: SHA-256 of the key's SubjectPublicKeyInfo bytes, as 64 hex digits, with or without colons or spaces between the pairs. The save is refused unless the key computes to this value. Required on a create, and on an update that changes the key. (nullable, max length 191)

## See also

- [All documentation](https://docs.winkpg.io/llms.txt): the machine-readable index of every public page on this site.
