class Google::Apis::CloudkmsV1::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](cloud.google.com/kms/docs/ importing-a-key).

Attributes

attestation[RW]

Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (cloud.google.com/kms/docs/ attest-key). Corresponds to the JSON property `attestation` @return [Google::Apis::CloudkmsV1::KeyOperationAttestation]

create_time[RW]

Output only. The time at which this ImportJob was created. Corresponds to the JSON property `createTime` @return [String]

expire_event_time[RW]

Output only. The time this ImportJob expired. Only present if state is EXPIRED. Corresponds to the JSON property `expireEventTime` @return [String]

expire_time[RW]

Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material. Corresponds to the JSON property `expireTime` @return [String]

generate_time[RW]

Output only. The time this ImportJob's key material was generated. Corresponds to the JSON property `generateTime` @return [String]

import_method[RW]

Required. Immutable. The wrapping method to be used for incoming key material. Corresponds to the JSON property `importMethod` @return [String]

name[RW]

Output only. The resource name for this ImportJob in the format `projects/*/ locations//keyRings//importJobs/*`. Corresponds to the JSON property `name` @return [String]

protection_level[RW]

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. Corresponds to the JSON property `protectionLevel` @return [String]

public_key[RW]

The public key component of the wrapping key. For details of the type of key this public key corresponds to, see the ImportMethod. Corresponds to the JSON property `publicKey` @return [Google::Apis::CloudkmsV1::WrappingPublicKey]

state[RW]

Output only. The current state of the ImportJob, indicating if it can be used. Corresponds to the JSON property `state` @return [String]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/cloudkms_v1/classes.rb, line 1201
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/cloudkms_v1/classes.rb, line 1206
def update!(**args)
  @attestation = args[:attestation] if args.key?(:attestation)
  @create_time = args[:create_time] if args.key?(:create_time)
  @expire_event_time = args[:expire_event_time] if args.key?(:expire_event_time)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @generate_time = args[:generate_time] if args.key?(:generate_time)
  @import_method = args[:import_method] if args.key?(:import_method)
  @name = args[:name] if args.key?(:name)
  @protection_level = args[:protection_level] if args.key?(:protection_level)
  @public_key = args[:public_key] if args.key?(:public_key)
  @state = args[:state] if args.key?(:state)
end