---
title: "POST /v1/{+parent}/importJobs"
method: POST
path: "/v1/{+parent}/importJobs"
tags: ["projects"]
---

# POST /v1/{+parent}/importJobs

`POST /v1/{+parent}/importJobs`

Create a new ImportJob within a KeyRing. ImportJob.import_method is required.

## Path parameters

- `parent` string, required

## Query parameters

- `importJobId` string

## Request body

- ImportJob — An ImportJob can be used to create CryptoKeys and CryptoKeyVersions using pre-existing key material, generated outside of Cloud KMS. When an ImportJob is created, Cloud KMS will generate a "wrapping key", which is a public/private key pair. You use the wrapping key to encrypt (also known as wrap) the pre-existing key material to protect it during the import process. The nature of the wrapping key depends on the choice of import_method. When the wrapping key generation is complete, the state will be set to ACTIVE and the public_key can be fetched. The fetched public key can then be used to wrap your pre-existing key material. Once the key material is wrapped, it can be imported into a new CryptoKeyVersion in an existing CryptoKey by calling ImportCryptoKeyVersion. Multiple CryptoKeyVersions can be imported with a single ImportJob. Cloud KMS uses the private key portion of the wrapping key to unwrap the key material. Only Cloud KMS has access to the private key. An ImportJob expires 3 days after it is created. Once expired, Cloud KMS will no longer be able to import or unwrap any key material that was wrapped with the ImportJob's public key. For more information, see [Importing a key](https://cloud.google.com/kms/docs/importing-a-key).
  - `createTime` string, google-datetime — Output only. The time at which this ImportJob was created.
  - `publicKeyFormat` 'PUBLIC_KEY_FORMAT_UNSPECIFIED' | 'PEM' | 'DER' | 'NIST_PQC' | 'XWING_RAW_BYTES' — Output only. Specifies the WrappingPublicKey format provided by the customer in the KeyManagementService.GetImportJob request.
  - `publicKey` WrappingPublicKey — The public key component of the wrapping key. For details of the type of key this public key corresponds to, see the ImportMethod.
    - `data` string, byte — Output only. Contains the public key, formatted according to the PublicKey.PublicKeyFormat specified in the KeyManagementService.GetImportJob request.
    - `pem` string — The public key, encoded in PEM format. For more information, see the [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual Encoding of Subject Public Key Info] (https://tools.ietf.org/html/rfc7468#section-13). This field gets populated by default for RSA-based import methods, if no public_key_format is specified in the request. If you want to retrieve the wrapping key of an ImportJob in some other format, use KeyManagementService.GetImportJob and set the public_key_format to the desired public key format.
  - `cryptoKeyBackend` string — Immutable. The resource name of the backend environment where the key material for the wrapping key resides and where all related cryptographic operations are performed. Currently, this field is only populated for keys stored in HSM_SINGLE_TENANT. Note, this list is non-exhaustive and may apply to additional ProtectionLevels in the future. Supported resources: * `"projects/*/locations/*/singleTenantHsmInstances/*"`
  - `generateTime` string, google-datetime — Output only. The time this ImportJob's key material was generated.
  - `expireEventTime` string, google-datetime — Output only. The time this ImportJob expired. Only present if state is EXPIRED.
  - `protectionLevel` 'PROTECTION_LEVEL_UNSPECIFIED' | 'SOFTWARE' | 'HSM' | 'EXTERNAL' | 'EXTERNAL_VPC' | 'HSM_SINGLE_TENANT' — Required. Immutable. The protection level of the ImportJob. This must match the protection_level of the version_template on the CryptoKey you attempt to import into.
  - `state` 'IMPORT_JOB_STATE_UNSPECIFIED' | 'PENDING_GENERATION' | 'ACTIVE' | 'EXPIRED' — Output only. The current state of the ImportJob, indicating if it can be used.
  - `expireTime` string, google-datetime — Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material.
  - `attestation` KeyOperationAttestation — Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key).
    - `certChains` CertificateChains — Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2.
      - `caviumCerts` string[] — Cavium certificate chain corresponding to the attestation.
      - `googleCardCerts` string[] — Google card certificate chain corresponding to the attestation.
      - `googlePartitionCerts` string[] — Google partition certificate chain corresponding to the attestation.
    - `content` string, byte — Output only. The attestation data provided by the HSM when the key operation was performed.
    - `format` 'ATTESTATION_FORMAT_UNSPECIFIED' | 'CAVIUM_V1_COMPRESSED' | 'CAVIUM_V2_COMPRESSED' — Output only. The format of the attestation data.
  - `name` string — Output only. The resource name for this ImportJob in the format `projects/*/locations/*/keyRings/*/importJobs/*`.
  - `importMethod` 'IMPORT_METHOD_UNSPECIFIED' | 'RSA_OAEP_3072_SHA1_AES_256' | 'RSA_OAEP_4096_SHA1_AES_256' | 'RSA_OAEP_3072_SHA256_AES_256' | 'RSA_OAEP_4096_SHA256_AES_256' | 'RSA_OAEP_3072_SHA256' | 'RSA_OAEP_4096_SHA256' | 'HPKE_KEM_ML_KEM_768_HKDF_SHA256_AES_256_GCM' | 'HPKE_KEM_ML_KEM_1024_HKDF_SHA256_AES_256_GCM' | 'HPKE_KEM_XWING_HKDF_SHA256_AES_256_GCM' — Required. Immutable. The wrapping method to be used for incoming key material.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/cloudkms.md) · [All operations](https://skmtc.net/google/apis/cloudkms/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/cloudkms/versions/576b283e53dd/schema)
