{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-kms/json-schema/amazon-kms-get-public-key-response-schema.json",
  "title": "GetPublicKeyResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-kms-operations-api-openapi.yml#/components/schemas/GetPublicKeyResponse",
  "type": "object",
  "properties": {
    "KeyId": {
      "type": "string",
      "description": "The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was downloaded."
    },
    "PublicKey": {
      "type": "string",
      "format": "byte",
      "description": "The exported public key. The value is a DER-encoded X.509 public key, also known as SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded."
    },
    "CustomerMasterKeySpec": {
      "type": "string",
      "enum": [
        "RSA_2048",
        "RSA_3072",
        "RSA_4096",
        "ECC_NIST_P256",
        "ECC_NIST_P384",
        "ECC_NIST_P521",
        "ECC_SECG_P256K1",
        "SYMMETRIC_DEFAULT",
        "HMAC_224",
        "HMAC_256",
        "HMAC_384",
        "HMAC_512",
        "SM2"
      ],
      "description": "Instead, use the KeySpec field in the GetPublicKey response. The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend that you use the KeySpec field in your code. However, to avoid breaking changes, KMS supports both fields."
    },
    "KeySpec": {
      "type": "string",
      "enum": [
        "RSA_2048",
        "RSA_3072",
        "RSA_4096",
        "ECC_NIST_P256",
        "ECC_NIST_P384",
        "ECC_NIST_P521",
        "ECC_SECG_P256K1",
        "SYMMETRIC_DEFAULT",
        "HMAC_224",
        "HMAC_256",
        "HMAC_384",
        "HMAC_512",
        "SM2",
        "ML_DSA_44",
        "ML_DSA_65",
        "ML_DSA_87",
        "ECC_NIST_EDWARDS25519",
        "ML_KEM_512",
        "ML_KEM_768",
        "ML_KEM_1024"
      ],
      "description": "The type of the of the public key that was downloaded."
    },
    "KeyUsage": {
      "type": "string",
      "enum": [
        "SIGN_VERIFY",
        "ENCRYPT_DECRYPT",
        "GENERATE_VERIFY_MAC",
        "KEY_AGREEMENT",
        "ENCAPSULATE_DECAPSULATE"
      ],
      "description": "The permitted use of the public key. Valid values for asymmetric key pairs are ENCRYPT_DECRYPT, SIGN_VERIFY, and KEY_AGREEMENT. This information is critical. For example, if a public key with SIGN_VERIFY key usage encrypts data outside of KMS, the ciphertext cannot be decrypted."
    },
    "EncryptionAlgorithms": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "SYMMETRIC_DEFAULT",
          "RSAES_OAEP_SHA_1",
          "RSAES_OAEP_SHA_256",
          "SM2PKE"
        ]
      },
      "description": "The encryption algorithms that KMS supports for this key. This information is critical. If a public key encrypts data outside of KMS by using an unsupported encryption algorithm, the ciphertext cannot be decrypted. This field appears in the response only when the KeyUsage of the public key is ENCRYPT_DECRYPT."
    },
    "SigningAlgorithms": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "RSASSA_PSS_SHA_256",
          "RSASSA_PSS_SHA_384",
          "RSASSA_PSS_SHA_512",
          "RSASSA_PKCS1_V1_5_SHA_256",
          "RSASSA_PKCS1_V1_5_SHA_384",
          "RSASSA_PKCS1_V1_5_SHA_512",
          "ECDSA_SHA_256",
          "ECDSA_SHA_384",
          "ECDSA_SHA_512",
          "SM2DSA",
          "ML_DSA_SHAKE_256",
          "ED25519_SHA_512",
          "ED25519_PH_SHA_512"
        ]
      },
      "description": "The signing algorithms that KMS supports for this key. This field appears in the response only when the KeyUsage of the public key is SIGN_VERIFY."
    },
    "KeyAgreementAlgorithms": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ECDH"
        ]
      },
      "description": "The key agreement algorithm used to derive a shared secret. This field is present only when the KMS key has a KeyUsage value of KEY_AGREEMENT."
    },
    "EncapsulationAlgorithms": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ML_KEM"
        ]
      },
      "description": "The key encapsulation algorithm used to establish a shared secret. This field is present only when the KMS key has a KeyUsage value of ENCAPSULATE_DECAPSULATE."
    }
  }
}