---
title: "POST /#X-Amz-Target=PaymentCryptographyControlPlane.RestoreKey"
method: POST
path: "/#X-Amz-Target=PaymentCryptographyControlPlane.RestoreKey"
---

# POST /#X-Amz-Target=PaymentCryptographyControlPlane.RestoreKey

`POST /#X-Amz-Target=PaymentCryptographyControlPlane.RestoreKey`

Cancels a scheduled key deletion during the waiting period. Use this operation to restore a `Key` that is scheduled for deletion.

During the waiting period, the `KeyState` is `DELETE_PENDING` and `deletePendingTimestamp` contains the date and time after which the `Key` will be deleted. After `Key` is restored, the `KeyState` is `CREATE_COMPLETE`, and the value for `deletePendingTimestamp` is removed.

**Cross-account use:** This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see [Resource-based policies](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security_iam_resource-based-policies.html).

**Related operations:**

*   [DeleteKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_DeleteKey.html)
    
*   [StartKeyUsage](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_StartKeyUsage.html)
    
*   [StopKeyUsage](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_StopKeyUsage.html)

## Headers

- `X-Amz-Target` 'PaymentCryptographyControlPlane.RestoreKey', required

## Request body

- RestoreKeyInput
  - `KeyIdentifier` string, required — The <code>KeyARN</code> of the key to be restored within Amazon Web Services Payment Cryptography.

## Response `200`

Success

- RestoreKeyOutput
  - `Key` object, required — The key material of the restored key. The <code>KeyState</code> will change to <code>CREATE_COMPLETE</code> and value for <code>DeletePendingTimestamp</code> gets removed.
    - `KeyArn` string, required — The Amazon Resource Name (ARN) of the key.
    - `KeyAttributes` object, required — The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.
      - `KeyUsage` 'TR31_B0_BASE_DERIVATION_KEY' | 'TR31_C0_CARD_VERIFICATION_KEY' | 'TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY' | 'TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION' | 'TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS' | 'TR31_E1_EMV_MKEY_CONFIDENTIALITY' | 'TR31_E2_EMV_MKEY_INTEGRITY' | 'TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS' | 'TR31_E5_EMV_MKEY_CARD_PERSONALIZATION' | 'TR31_E6_EMV_MKEY_OTHER' | 'TR31_K0_KEY_ENCRYPTION_KEY' | 'TR31_K1_KEY_BLOCK_PROTECTION_KEY' | 'TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT' | 'TR31_M0_ISO_16609_MAC_KEY' | 'TR31_M3_ISO_9797_3_MAC_KEY' | 'TR31_M1_ISO_9797_1_MAC_KEY' | 'TR31_M6_ISO_9797_5_CMAC_KEY' | 'TR31_M7_HMAC_KEY' | 'TR31_P0_PIN_ENCRYPTION_KEY' | 'TR31_P1_PIN_GENERATION_KEY' | 'TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE' | 'TR31_V1_IBM3624_PIN_VERIFICATION_KEY' | 'TR31_V2_VISA_PIN_VERIFICATION_KEY' | 'TR31_K2_TR34_ASYMMETRIC_KEY', required — The cryptographic usage of an Amazon Web Services Payment Cryptography key as deﬁned in section A.5.2 of the TR-31 spec.
      - `KeyClass` 'SYMMETRIC_KEY' | 'ASYMMETRIC_KEY_PAIR' | 'PRIVATE_KEY' | 'PUBLIC_KEY', required — The type of Amazon Web Services Payment Cryptography key to create, which determines the classiﬁcation of the cryptographic method and whether Amazon Web Services Payment Cryptography key contains a symmetric key or an asymmetric key pair.
      - `KeyAlgorithm` 'TDES_2KEY' | 'TDES_3KEY' | 'AES_128' | 'AES_192' | 'AES_256' | 'HMAC_SHA256' | 'HMAC_SHA384' | 'HMAC_SHA512' | 'HMAC_SHA224' | 'RSA_2048' | 'RSA_3072' | 'RSA_4096' | 'ECC_NIST_P256' | 'ECC_NIST_P384' | 'ECC_NIST_P521', required — <p>The key algorithm to be use during creation of an Amazon Web Services Payment Cryptography key.</p> <p>For symmetric keys, Amazon Web Services Payment Cryptography supports <code>AES</code> and <code>TDES</code> algorithms. For asymmetric keys, Amazon Web Services Payment Cryptography supports <code>RSA</code> and <code>ECC_NIST</code> algorithms.</p>
      - `KeyModesOfUse` object, required — The list of cryptographic operations that you can perform using the key.
        - `Encrypt` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to encrypt data.
        - `Decrypt` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to decrypt data.
        - `Wrap` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to wrap other keys.
        - `Unwrap` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to unwrap other keys.
        - `Generate` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to generate and verify other card and PIN verification keys.
        - `Sign` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used for signing.
        - `Verify` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to verify signatures.
        - `DeriveKey` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to derive new keys.
        - `NoRestrictions` boolean — Speciﬁes whether an Amazon Web Services Payment Cryptography key has no special restrictions other than the restrictions implied by <code>KeyUsage</code>.
    - `KeyCheckValue` string, required — The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.
    - `KeyCheckValueAlgorithm` 'CMAC' | 'ANSI_X9_24' | 'HMAC' | 'SHA_1', required — <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p> <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result. For HMAC keys, the KCV is computed using the hash selected at key creation on a zero-length message, taking the leftmost 3 bytes.</p>
    - `Enabled` boolean, required — Specifies whether the key is enabled.
    - `Exportable` boolean, required — Specifies whether the key is exportable. This data is immutable after the key is created.
    - `KeyState` 'CREATE_IN_PROGRESS' | 'CREATE_COMPLETE' | 'DELETE_PENDING' | 'DELETE_COMPLETE', required — The state of key that is being created or deleted.
    - `KeyOrigin` 'EXTERNAL' | 'AWS_PAYMENT_CRYPTOGRAPHY', required — The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.
    - `CreateTimestamp` string, date-time, required — The date and time when the key was created.
    - `UsageStartTimestamp` string, date-time — The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.
    - `UsageStopTimestamp` string, date-time — The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.
    - `DeletePendingTimestamp` string, date-time — The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.
    - `DeleteTimestamp` string, date-time — The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.
    - `DeriveKeyUsage` 'TR31_B0_BASE_DERIVATION_KEY' | 'TR31_C0_CARD_VERIFICATION_KEY' | 'TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY' | 'TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS' | 'TR31_E1_EMV_MKEY_CONFIDENTIALITY' | 'TR31_E2_EMV_MKEY_INTEGRITY' | 'TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS' | 'TR31_E5_EMV_MKEY_CARD_PERSONALIZATION' | 'TR31_E6_EMV_MKEY_OTHER' | 'TR31_K0_KEY_ENCRYPTION_KEY' | 'TR31_K1_KEY_BLOCK_PROTECTION_KEY' | 'TR31_M3_ISO_9797_3_MAC_KEY' | 'TR31_M1_ISO_9797_1_MAC_KEY' | 'TR31_M6_ISO_9797_5_CMAC_KEY' | 'TR31_M7_HMAC_KEY' | 'TR31_P0_PIN_ENCRYPTION_KEY' | 'TR31_P1_PIN_GENERATION_KEY' | 'TR31_V1_IBM3624_PIN_VERIFICATION_KEY' | 'TR31_V2_VISA_PIN_VERIFICATION_KEY' — The cryptographic usage of an ECDH derived key as deﬁned in section A.5.2 of the TR-31 spec.
    - `MultiRegionKeyType` 'PRIMARY' | 'REPLICA' — <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p> <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    - `PrimaryRegion` string — <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p> <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    - `ReplicationStatus` object — <p>Information about the replication status of the key across different Amazon Web Services Regions.</p> <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    - `UsingDefaultReplicationRegions` boolean — <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p> <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    - `MpaStatus` object — The Multi-Party Approval (MPA) status for the key, if applicable.
      - `MpaSessionArn` string, required — The ARN of the MPA session.
      - `Status` 'PENDING' | 'APPROVED' | 'FAILED' | 'CANCELLED', required — The current status of the MPA session.
      - `InitiationDate` string, date-time, required — The date and time when the MPA session was initiated.
      - `StatusMessage` string — The message providing additional information about the MPA session status.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — ServiceUnavailableException
- `482` — ValidationException
- `483` — ConflictException
- `484` — AccessDeniedException
- `485` — ResourceNotFoundException
- `486` — ThrottlingException
- `487` — InternalServerException

---

[API](https://skmtc.net/aws/apis/payment-cryptography.md) · [All operations](https://skmtc.net/aws/apis/payment-cryptography/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/payment-cryptography/versions/1b0b83160e8d/schema)
