Class: Google::Apis::CloudkmsV1::CryptoKey

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/cloudkms_v1/classes.rb,
generated/google/apis/cloudkms_v1/representations.rb,
generated/google/apis/cloudkms_v1/representations.rb

Overview

A CryptoKey represents a logical key that can be used for cryptographic operations. A CryptoKey is made up of one or more versions, which represent the actual key material used in cryptographic operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ CryptoKey

Returns a new instance of CryptoKey



241
242
243
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 241

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#create_timeString

Output only. The time at which this CryptoKey was created. Corresponds to the JSON property createTime

Returns:

  • (String)


190
191
192
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 190

def create_time
  @create_time
end

#labelsHash<String,String>

Labels with user-defined metadata. For more information, see Labeling Keys. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


196
197
198
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 196

def labels
  @labels
end

#nameString

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

Returns:

  • (String)


202
203
204
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 202

def name
  @name
end

#next_rotation_timeString

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. Corresponds to the JSON property nextRotationTime

Returns:

  • (String)


213
214
215
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 213

def next_rotation_time
  @next_rotation_time
end

#primaryGoogle::Apis::CloudkmsV1::CryptoKeyVersion

A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. It can be used for cryptographic operations either directly, or via its parent CryptoKey, in which case the server will choose the appropriate version for the operation. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt or decrypt data when an authorized user or application invokes Cloud KMS. Corresponds to the JSON property primary



226
227
228
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 226

def primary
  @primary
end

#purposeString

The immutable purpose of this CryptoKey. Currently, the only acceptable purpose is ENCRYPT_DECRYPT. Corresponds to the JSON property purpose

Returns:

  • (String)


232
233
234
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 232

def purpose
  @purpose
end

#rotation_periodString

next_rotation_time will be advanced by this period when the service automatically rotates a key. Must be at least one day. If rotation_period is set, next_rotation_time must also be set. Corresponds to the JSON property rotationPeriod

Returns:

  • (String)


239
240
241
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 239

def rotation_period
  @rotation_period
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



246
247
248
249
250
251
252
253
254
# File 'generated/google/apis/cloudkms_v1/classes.rb', line 246

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @labels = args[:labels] if args.key?(:labels)
  @name = args[:name] if args.key?(:name)
  @next_rotation_time = args[:next_rotation_time] if args.key?(:next_rotation_time)
  @primary = args[:primary] if args.key?(:primary)
  @purpose = args[:purpose] if args.key?(:purpose)
  @rotation_period = args[:rotation_period] if args.key?(:rotation_period)
end