{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-payment-cryptography/json-schema/amazon-payment-cryptography-import-key-input-schema.json",
  "title": "ImportKeyInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-payment-cryptography-payment-cryptography-control-plane-api-openapi.yml#/components/schemas/ImportKeyInput",
  "type": "object",
  "properties": {
    "KeyMaterial": {
      "$ref": "#/$defs/ImportKeyMaterial"
    },
    "KeyCheckValueAlgorithm": {
      "type": "string",
      "description": "The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity. 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 lef"
    },
    "Enabled": {
      "type": "boolean",
      "description": "Specifies whether import key is enabled."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "Assigns one or more tags to the Amazon Web Services Payment Cryptography key. Use this parameter to tag a key when it is imported. To tag an existing Amazon Web Services Payment Cryptography key, use the TagResource operation. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the cur"
    },
    "ReplicationRegions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "RequesterComment": {
      "type": "string",
      "description": "The comment from the requester explaining the reason for the import. Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output."
    }
  },
  "required": [
    "KeyMaterial"
  ],
  "$defs": {
    "DiffieHellmanDerivationData": {
      "type": "object",
      "properties": {
        "SharedInformation": {
          "type": "string",
          "description": "A string containing information that binds the ECDH derived key to the two parties involved or to the context of the key. It may include details like identities of the two parties deriving the key, context of the operation, session IDs, and optionally a nonce. It must not contain zero bytes. It is not recommended to reuse shared information for multiple ECDH key derivations, as it could result in derived key material being the same across different derivations."
        }
      },
      "description": "Exactly one member is set."
    },
    "ImportAs2805KeyCryptogram": {
      "type": "object",
      "properties": {
        "As2805KeyVariant": {
          "type": "string",
          "enum": [
            "TERMINAL_MAJOR_KEY_VARIANT_00",
            "PIN_ENCRYPTION_KEY_VARIANT_28",
            "MESSAGE_AUTHENTICATION_KEY_VARIANT_24",
            "DATA_ENCRYPTION_KEY_VARIANT_22"
          ],
          "description": "The cryptographic usage of the key under import."
        },
        "KeyModesOfUse": {
          "$ref": "#/$defs/KeyModesOfUse"
        },
        "KeyAlgorithm": {
          "type": "string",
          "description": "The key algorithm of the key under import."
        },
        "Exportable": {
          "type": "boolean",
          "description": "Specified whether the key is exportable. This data is immutable after the key is imported."
        },
        "WrappingKeyIdentifier": {
          "type": "string"
        },
        "WrappedKeyCryptogram": {
          "type": "string",
          "description": "The wrapped key cryptogram under import."
        }
      },
      "required": [
        "As2805KeyVariant",
        "KeyModesOfUse",
        "KeyAlgorithm",
        "Exportable",
        "WrappingKeyIdentifier",
        "WrappedKeyCryptogram"
      ]
    },
    "ImportDiffieHellmanTr31KeyBlock": {
      "type": "object",
      "properties": {
        "PrivateKeyIdentifier": {
          "type": "string",
          "description": "The keyARN of the asymmetric ECC key created within Amazon Web Services Payment Cryptography."
        },
        "CertificateAuthorityPublicKeyIdentifier": {
          "type": "string",
          "description": "The keyARN of the CA that signed the PublicKeyCertificate for the client's receiving ECC key pair."
        },
        "PublicKeyCertificate": {
          "type": "string",
          "description": "The public key certificate of the client's receiving ECC key pair, in PEM format (base64 encoded), to use for ECDH key derivation."
        },
        "DeriveKeyAlgorithm": {
          "type": "string",
          "enum": [
            "TDES_2KEY",
            "TDES_3KEY",
            "AES_128",
            "AES_192",
            "AES_256",
            "HMAC_SHA256",
            "HMAC_SHA384",
            "HMAC_SHA512",
            "HMAC_SHA224"
          ],
          "description": "The key algorithm of the shared derived ECDH key."
        },
        "KeyDerivationFunction": {
          "type": "string",
          "enum": [
            "NIST_SP800",
            "ANSI_X963"
          ],
          "description": "The key derivation function to use when deriving a key using ECDH."
        },
        "KeyDerivationHashAlgorithm": {
          "type": "string",
          "enum": [
            "SHA_256",
            "SHA_384",
            "SHA_512"
          ],
          "description": "The hash type to use when deriving a key using ECDH."
        },
        "DerivationData": {
          "$ref": "#/$defs/DiffieHellmanDerivationData"
        },
        "WrappedKeyBlock": {
          "type": "string",
          "description": "The ECDH wrapped key block to import."
        }
      },
      "required": [
        "PrivateKeyIdentifier",
        "CertificateAuthorityPublicKeyIdentifier",
        "PublicKeyCertificate",
        "DeriveKeyAlgorithm",
        "KeyDerivationFunction",
        "KeyDerivationHashAlgorithm",
        "DerivationData",
        "WrappedKeyBlock"
      ]
    },
    "ImportKeyCryptogram": {
      "type": "object",
      "properties": {
        "KeyAttributes": {
          "$ref": "#/$defs/KeyAttributes"
        },
        "Exportable": {
          "type": "boolean",
          "description": "Specifies whether the key is exportable from the service."
        },
        "WrappedKeyCryptogram": {
          "type": "string",
          "description": "The RSA wrapped key cryptogram under import."
        },
        "ImportToken": {
          "type": "string",
          "description": "The import token that initiates key import using the asymmetric RSA wrap and unwrap key exchange method into AWS Payment Cryptography. It expires after 30 days. You can use the same import token to import multiple keys to the same service account."
        },
        "WrappingSpec": {
          "type": "string",
          "description": "The wrapping spec for the wrapped key cryptogram."
        }
      },
      "required": [
        "KeyAttributes",
        "Exportable",
        "WrappedKeyCryptogram",
        "ImportToken"
      ]
    },
    "ImportKeyMaterial": {
      "type": "object",
      "properties": {
        "RootCertificatePublicKey": {
          "$ref": "#/$defs/RootCertificatePublicKey"
        },
        "TrustedCertificatePublicKey": {
          "$ref": "#/$defs/TrustedCertificatePublicKey"
        },
        "Tr31KeyBlock": {
          "$ref": "#/$defs/ImportTr31KeyBlock"
        },
        "Tr34KeyBlock": {
          "$ref": "#/$defs/ImportTr34KeyBlock"
        },
        "KeyCryptogram": {
          "$ref": "#/$defs/ImportKeyCryptogram"
        },
        "DiffieHellmanTr31KeyBlock": {
          "$ref": "#/$defs/ImportDiffieHellmanTr31KeyBlock"
        },
        "As2805KeyCryptogram": {
          "$ref": "#/$defs/ImportAs2805KeyCryptogram"
        }
      },
      "description": "Exactly one member is set."
    },
    "ImportTr31KeyBlock": {
      "type": "object",
      "properties": {
        "WrappingKeyIdentifier": {
          "type": "string",
          "description": "The KeyARN of the key that will decrypt or unwrap a TR-31 key block during import."
        },
        "WrappedKeyBlock": {
          "type": "string",
          "description": "The TR-31 wrapped key block to import."
        }
      },
      "required": [
        "WrappingKeyIdentifier",
        "WrappedKeyBlock"
      ]
    },
    "ImportTr34KeyBlock": {
      "type": "object",
      "properties": {
        "CertificateAuthorityPublicKeyIdentifier": {
          "type": "string",
          "description": "The KeyARN of the certificate chain that signs the signing key certificate during TR-34 key import."
        },
        "SigningKeyCertificate": {
          "type": "string",
          "description": "The public key component in PEM certificate format of the private key that signs the KDH TR-34 WrappedKeyBlock."
        },
        "ImportToken": {
          "type": "string",
          "description": "The import token that initiates key import using the asymmetric TR-34 key exchange method into Amazon Web Services Payment Cryptography. It expires after 30 days. You can use the same import token to import multiple keys to the same service account."
        },
        "WrappingKeyIdentifier": {
          "type": "string",
          "description": "Key Identifier used for unwrapping the import key"
        },
        "WrappingKeyCertificate": {
          "type": "string",
          "description": "The certificate used to wrap the TR-34 key block."
        },
        "WrappedKeyBlock": {
          "type": "string",
          "description": "The TR-34 wrapped key block to import."
        },
        "KeyBlockFormat": {
          "type": "string",
          "description": "The key block format to use during key import. The only value allowed is X9_TR34_2012."
        },
        "RandomNonce": {
          "type": "string",
          "description": "A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass."
        }
      },
      "required": [
        "CertificateAuthorityPublicKeyIdentifier",
        "SigningKeyCertificate",
        "WrappedKeyBlock",
        "KeyBlockFormat"
      ]
    },
    "KeyAttributes": {
      "type": "object",
      "properties": {
        "KeyUsage": {
          "type": "string",
          "description": "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": {
          "type": "string",
          "description": "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": {
          "type": "string",
          "description": "The key algorithm to be use during creation of an Amazon Web Services Payment Cryptography key. For symmetric keys, Amazon Web Services Payment Cryptography supports AES and TDES algorithms. For asymmetric keys, Amazon Web Services Payment Cryptography supports RSA and ECC_NIST algorithms."
        },
        "KeyModesOfUse": {
          "$ref": "#/$defs/KeyModesOfUse"
        }
      },
      "required": [
        "KeyUsage",
        "KeyClass",
        "KeyAlgorithm",
        "KeyModesOfUse"
      ]
    },
    "KeyModesOfUse": {
      "type": "object",
      "properties": {
        "Encrypt": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to encrypt data."
        },
        "Decrypt": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to decrypt data."
        },
        "Wrap": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to wrap other keys."
        },
        "Unwrap": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to unwrap other keys."
        },
        "Generate": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to generate and verify other card and PIN verification keys."
        },
        "Sign": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used for signing."
        },
        "Verify": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to verify signatures."
        },
        "DeriveKey": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key can be used to derive new keys."
        },
        "NoRestrictions": {
          "type": "string",
          "description": "Speciﬁes whether an Amazon Web Services Payment Cryptography key has no special restrictions other than the restrictions implied by KeyUsage."
        }
      }
    },
    "RootCertificatePublicKey": {
      "type": "object",
      "properties": {
        "KeyAttributes": {
          "$ref": "#/$defs/KeyAttributes"
        },
        "PublicKeyCertificate": {
          "type": "string",
          "description": "Parameter information for root public key certificate import."
        }
      },
      "required": [
        "KeyAttributes",
        "PublicKeyCertificate"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the tag."
        },
        "Value": {
          "type": "string",
          "description": "The value of the tag."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "TrustedCertificatePublicKey": {
      "type": "object",
      "properties": {
        "KeyAttributes": {
          "$ref": "#/$defs/KeyAttributes"
        },
        "PublicKeyCertificate": {
          "type": "string",
          "description": "Parameter information for trusted public key certificate import."
        },
        "CertificateAuthorityPublicKeyIdentifier": {
          "type": "string",
          "description": "The KeyARN of the root public key certificate or certificate chain that signs the trusted public key certificate import."
        }
      },
      "required": [
        "KeyAttributes",
        "PublicKeyCertificate",
        "CertificateAuthorityPublicKeyIdentifier"
      ]
    }
  }
}