All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey.
Required. The name of the CryptoKey to be imported into.
The create permission is only required on this key when creating a new CryptoKeyVersion.
Authorization requires the following IAM permission on the specified resource parent:
cloudkms.cryptoKeyVersions.create
Request body
The request body contains data with the following structure:
JSON representation
{"cryptoKeyVersion": string,"algorithm": enum (CryptoKeyVersionAlgorithm),"importJob": string,"wrappedKey": string,// Union field wrapped_key_material can be only one of the following:"rsaAesWrappedKey": string// End of list of possible types for union field wrapped_key_material.}
Fields
cryptoKeyVersion
string
Optional. The optional name of an existing CryptoKeyVersion to target for an import operation. If this field is not present, a new CryptoKeyVersion containing the supplied key material is created.
Before wrapping, key material must be formatted. If importing symmetric key material, the expected key material format is plain bytes. If importing asymmetric key material, the expected key material format is PKCS#8-encoded DER (the PrivateKeyInfo structure from RFC 5208).
this field must contain the formatted key to be imported, wrapped with the publicKey using RSAES-OAEP with SHA-256, MGF1 with SHA-256, and an empty label.
A base64-encoded string.
Union field wrapped_key_material. This field is legacy. Use the field wrapped_key instead. wrapped_key_material can be only one of the following:
Optional. This field has the same meaning as wrappedKey. Prefer to use that field in new work. Either that field or this field (but not both) must be specified.
A base64-encoded string.
Response body
If successful, the response body contains an instance of CryptoKeyVersion.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-23 UTC."],[],[],null,["# Method: cryptoKeyVersions.import\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\n**Full name**: projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.import\n\nImport wrapped key material into a [CryptoKeyVersion](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion).\n\nAll requests must specify a [CryptoKey](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey). If a [CryptoKeyVersion](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion) is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the [CryptoKey](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey).\n\n### HTTP request\n\nChoose a location: \nglobal europe-west3 europe-west8 europe-west9 me-central2 us-east1 us-east4 us-west2 us-west1 us-east7 us-central1 us-west3 us-central2 us-west4 us-west8 us-east5 us-south1 us in \n\n\u003cbr /\u003e\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [CryptoKeyVersion](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloudkms`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]