> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Private Key Management

> You can define and manage keys used in policies. You can perform key addition, deletion, and update operations with secret, private, and public key support. These operations can only be performed by Admin users.

## Creating a New Key

<Steps>
  <Step title="Key Definition Creation">
    Click the **Create** button from the **Management → Secrets Management → Keys** screen. Fill in the information under **Definition**. Then click the **New Key Definition** button.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys1.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=3e5dc11958f18ec42e64100c8b07d6f0" alt="Key Definition Creation" width="1000" height="600" data-path="images/yonetici/keys1.png" />

    The fields used for key creation configuration:

    | Field                   | Description                                                                                                                                                          |
    | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Name                    | Name information of the created key.                                                                                                                                 |
    | Description             | A description can be written to facilitate management related to the created key.                                                                                    |
    | Key Type                | The type of the key is selected. Three options are available:<br />• Secret Key<br />• Private Key<br />• Public Key                                                 |
    | Algorithm *(Algorithm)* | The algorithm of the key is selected. Options vary according to the type of the key:<br />• For secret key: AES, DES, DESede<br />• For private and public keys: RSA |
  </Step>

  <Step title="Configuration Settings">
    Fill in the configuration information for the Key in the opened window. Then click the **Save** button. The saved **Key Definition** is listed in the table opened under **Configuration**.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys2.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=6e0cb82ec5c00a319f7a7c439492f2ac" alt="Key Configuration Settings" width="1000" height="600" data-path="images/yonetici/keys2.png" />

    The fields used for key definition configuration:

    | Field                         | Description                                                                                                                                                            |
    | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Environments *(Environments)* | The previously defined environment where the key will be used is selected.                                                                                             |
    | Source *(Source)*             | The source from which the key will be obtained. Two options are available:<br />• Import from File<br />• Paste from Clipboard                                         |
    | File *(File)*                 | When the Import from File option is selected, the file containing the key is selected by clicking the "Select File" button. Allowed formats: pem, crt, cer, cert, der. |
    | Key Content *(Key Content)*   | When the Paste from Clipboard option is selected, this is the field where the key will be pasted.                                                                      |
    | Alias                         | The alias information of the key is entered.                                                                                                                           |
  </Step>

  <Step title="Save and Deploy">
    After completing the definition and configuration information, click the **Save and Deploy** button to deploy.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys3.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=736b68455ca806e9c30b703bde51aa87" alt="Key Save and Deploy" width="1000" height="600" data-path="images/yonetici/keys3.png" />
  </Step>
</Steps>

## Key Editing

<Steps>
  <Step title="Starting Editing Operation">
    To edit an existing key, click the **Edit** button from that key's menu.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys4.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=22c0d691e7b37b4175aee9de69094e97" alt="Key Editing Operation" width="1000" height="600" data-path="images/yonetici/keys4.png" />
  </Step>

  <Step title="Editing Settings">
    <Note>
      After clicking the "Edit" button to edit the key, the steps followed during creation are followed.
    </Note>

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys5.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=9f88175c3f6f4a5447b38876702d5ac5" alt="Key Editing Settings" width="1000" height="600" data-path="images/yonetici/keys5.png" />

    To edit the configuration content of an existing key, click on the Environment to be edited and perform the editing operation.
  </Step>

  <Step title="Save Editing">
    Click the **Save** button to save the changes you made.

    <img src="https://mintcdn.com/apinizer/9Zx4tCVUkSwTchvt/images/yonetici/key-defi.png?fit=max&auto=format&n=9Zx4tCVUkSwTchvt&q=85&s=440d403753ae748e5ffabb40ddf76825" alt="Key Save Editing" width="1000" height="600" data-path="images/yonetici/key-defi.png" />
  </Step>
</Steps>

### Updating Related JWKs

When a key (Public Key or Private Key) is updated and the **Save and Deploy** button is clicked, if there are JWKs created from this key, the system automatically detects related JWKs and presents the user with options.

<Info>
  When a key is updated, JWKs created from this key can also be automatically updated or the relationship can be disconnected.
</Info>

#### JWK Connection Dialog

When a key is updated and related JWKs are detected, the following dialog opens:

<img src="https://mintcdn.com/apinizer/Gg0kSw8S7n4NUarZ/images/yonetici/jwk.png?fit=max&auto=format&n=Gg0kSw8S7n4NUarZ&q=85&s=3dafa95bce928b4d26c5eaf34f6931b2" alt="JWK Connection Dialog" width="600" height="400" style={{ borderRadius: '0.5rem' }} data-path="images/yonetici/jwk.png" />

**Dialog Content:**

* **Title**: "JWK Connection"
* **Warning Message**: "This Key is used in X JWK(s). What would you like to do?"
* **Options**:
  * **Update related JWKs**: Ensures that changes in the key are reflected to related JWKs as well.
  * **Update key only and disconnect**: Updates the key but disconnects the relationship with JWKs.
  * **Cancel**: Cancels the operation.

#### Update Flow

<Steps>
  <Step title="Key Update">
    Edit the key information and click the **Save and Deploy** button.
  </Step>

  <Step title="Related JWK Check">
    The system checks for JWKs created from this key.
  </Step>

  <Step title="Dialog Display">
    If there are related JWKs, the JWK Connection dialog opens.
  </Step>

  <Step title="Making Selection">
    The user selects one of three options: Update, Disconnect, or Cancel.
  </Step>

  <Step title="Confirmation Dialog">
    When Update or Disconnect is selected, a confirmation dialog opens. The user confirms the operation by entering the key name.
  </Step>

  <Step title="Completing Operation">
    After confirmation, the selected operation is performed and the key is updated.
  </Step>
</Steps>

<Warning>
  Updating related JWKs may affect all policies and connections using these JWKs. Evaluate the impacts before proceeding.
</Warning>

## Key Deletion

<Steps>
  <Step title="Starting Deletion Operation">
    To delete an existing key, click the **Delete** button from that key's menu.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys7.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=d70f36b6aa297e0e03442a62b9f31790" alt="Key Deletion Operation" width="1000" height="600" data-path="images/yonetici/keys7.png" />
  </Step>

  <Step title="Related JWK Check">
    The system checks for JWKs created from this key. If there are related JWKs, the JWK Connection dialog opens.
  </Step>

  <Step title="Deletion Options">
    If there are related JWKs, the following options are presented:

    * **Delete JWKS**: Delete related JWKs as well
    * **Delete Disconnect**: Delete only the key, keep JWKs (relationship is disconnected)
    * **Cancel**: Cancel the operation
  </Step>

  <Step title="Confirmation Dialog">
    When Delete JWKS or Delete Disconnect is selected, a confirmation dialog opens. The user confirms the operation by entering the key name.
  </Step>

  <Step title="Confirming Deletion Operation">
    Click the **Delete** button again in the opened window to confirm.

    <img src="https://mintcdn.com/apinizer/dhWoGIYpW-d1-ZoH/images/yonetici/keys8.png?fit=max&auto=format&n=dhWoGIYpW-d1-ZoH&q=85&s=dc8a0ba503289cfe16ea0ede89ec38fb" alt="Key Deletion Confirmation" width="1000" height="600" data-path="images/yonetici/keys8.png" />
  </Step>
</Steps>

### Deleting Related JWKs

When a key is deleted, if there are JWKs created from this key, the system automatically detects related JWKs and presents the user with options.

<Warning>
  When a key is deleted, related JWKs may also be deleted or the relationship may be disconnected. This operation cannot be undone. Evaluate the impacts before proceeding.
</Warning>

#### Deletion Flow

<Steps>
  <Step title="Key Deletion Request">
    Start the key deletion operation.
  </Step>

  <Step title="Related JWK Check">
    The system checks for JWKs created from this key.
  </Step>

  <Step title="Dialog Display">
    If there are related JWKs, the JWK Connection dialog opens.
  </Step>

  <Step title="Making Selection">
    The user selects one of three options: Delete JWKS, Delete Disconnect, or Cancel.
  </Step>

  <Step title="Confirmation Dialog">
    When Delete JWKS or Delete Disconnect is selected, a confirmation dialog opens. The user confirms the operation by entering the key name.
  </Step>

  <Step title="Completing Operation">
    After confirmation, the selected operation is performed and the key is deleted.
  </Step>
</Steps>
