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

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudkms_v1/classes.rb,
lib/google/apis/cloudkms_v1/representations.rb,
lib/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 zero or more versions, which represent the actual key material used in cryptographic operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CryptoKey

Returns a new instance of CryptoKey.



664
665
666
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 664

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)


580
581
582
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 580

def create_time
  @create_time
end

#crypto_key_backendString

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/*. Note, this list is non-exhaustive and may apply to additional ProtectionLevels in the future. Corresponds to the JSON property cryptoKeyBackend

Returns:

  • (String)


590
591
592
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 590

def crypto_key_backend
  @crypto_key_backend
end

#destroy_scheduled_durationString

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

Returns:

  • (String)


597
598
599
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 597

def destroy_scheduled_duration
  @destroy_scheduled_duration
end

#import_onlyBoolean Also known as: import_only?

Immutable. Whether this key may contain imported versions only. Corresponds to the JSON property importOnly

Returns:

  • (Boolean)


602
603
604
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 602

def import_only
  @import_only
end

#key_access_justifications_policyGoogle::Apis::CloudkmsV1::KeyAccessJustificationsPolicy

A KeyAccessJustificationsPolicy specifies zero or more allowed AccessReason values for encrypt, decrypt, and sign operations on a CryptoKey. Corresponds to the JSON property keyAccessJustificationsPolicy



609
610
611
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 609

def key_access_justifications_policy
  @key_access_justifications_policy
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>)


615
616
617
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 615

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)


621
622
623
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 621

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. Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted. Corresponds to the JSON property nextRotationTime

Returns:

  • (String)


631
632
633
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 631

def next_rotation_time
  @next_rotation_time
end

#primaryGoogle::Apis::CloudkmsV1::CryptoKeyVersion

A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. 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, decrypt, or sign data when an authorized user or application invokes Cloud KMS. Corresponds to the JSON property primary



641
642
643
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 641

def primary
  @primary
end

#purposeString

Immutable. The immutable purpose of this CryptoKey. Corresponds to the JSON property purpose

Returns:

  • (String)


646
647
648
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 646

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

Returns:

  • (String)


655
656
657
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 655

def rotation_period
  @rotation_period
end

#version_templateGoogle::Apis::CloudkmsV1::CryptoKeyVersionTemplate

A CryptoKeyVersionTemplate specifies the properties to use when creating a new CryptoKeyVersion, either manually with CreateCryptoKeyVersion or automatically as a result of auto-rotation. Corresponds to the JSON property versionTemplate



662
663
664
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 662

def version_template
  @version_template
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/google/apis/cloudkms_v1/classes.rb', line 669

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @crypto_key_backend = args[:crypto_key_backend] if args.key?(:crypto_key_backend)
  @destroy_scheduled_duration = args[:destroy_scheduled_duration] if args.key?(:destroy_scheduled_duration)
  @import_only = args[:import_only] if args.key?(:import_only)
  @key_access_justifications_policy = args[:key_access_justifications_policy] if args.key?(:key_access_justifications_policy)
  @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)
  @version_template = args[:version_template] if args.key?(:version_template)
end