v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-134796204.9 KB
projects

Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required.

post/v1/{+parent}/cryptoKeys

Path parameters

parentstring required

Required. The name of the KeyRing associated with the CryptoKeys.

Query parameters

cryptoKeyIdstring

Required. It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]{1,63}

skipInitialVersionCreationboolean

If set to true, the request will create a CryptoKey without any CryptoKeyVersions. You must manually call CreateCryptoKeyVersion or ImportCryptoKeyVersion before you can use this CryptoKey.

trustedWrappingEnabledboolean

Optional. Whether trusted wrapping will be enabled on the first CryptoKeyVersions created for this CryptoKey. This field is only supported for keys with CryptoKeyVersionTemplate.protection_level HSM_SINGLE_TENANT. This field is supported for all CryptoKeyPurposes except ENCRYPT_DECRYPT.

Request body

namestring

Output only. The resource name for this CryptoKey in the format projects/*/locations/*/keyRings/*/cryptoKeys/*.

rotationPeriodstring google-duration

next_rotation_time will be advanced by this period when the service automatically rotates a key. Must be at least 24 hours and at most 876,000 hours. If rotation_period is set, next_rotation_time must also be set. Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.

labelsobject

Labels with user-defined metadata. For more information, see Labeling Keys.

cryptoKeyBackendstring

Immutable. The resource name of the backend environment where the key material for all CryptoKeyVersions associated with this CryptoKey reside and where all related cryptographic operations are performed. Only applicable if CryptoKeyVersions have a ProtectionLevel of EXTERNAL_VPC, with the resource name in the format projects/*/locations/*/ekmConnections/*. Only applicable if CryptoKeyVersions have a ProtectionLevel of HSM_SINGLE_TENANT, with the resource name in the format projects/*/locations/*/singleTenantHsmInstances/*. Note, this list is non-exhaustive and may apply to additional ProtectionLevels in the future.

importOnlyboolean

Immutable. Whether this key may contain imported versions only.

purpose'CRYPTO_KEY_PURPOSE_UNSPECIFIED' | 'ENCRYPT_DECRYPT' | 'ASYMMETRIC_SIGN' | 'ASYMMETRIC_DECRYPT' | 'RAW_ENCRYPT_DECRYPT' | 'MAC' | 'KEY_ENCAPSULATION' | 'AES_WRAPPING'

Immutable. The immutable purpose of this CryptoKey.

destroyScheduledDurationstring google-duration

Immutable. The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED. If not specified at creation time, the default duration is 30 days.

createTimestring google-datetime

Output only. The time at which this CryptoKey was created.

nextRotationTimestring google-datetime

At next_rotation_time, the Key Management Service will automatically: 1. Create a new version of this CryptoKey. 2. Mark the new version as primary. Key rotations performed manually via CreateCryptoKeyVersion and UpdateCryptoKeyPrimaryVersion do not affect next_rotation_time. Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.

Response

Successful response