Cloud KMS V1 Client - Class CryptoKeyVersion (1.16.4)

Reference documentation and code samples for the Cloud KMS V1 Client class 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.

Generated from protobuf message google.cloud.kms.v1.CryptoKeyVersion

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

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

↳ state int

The current state of the CryptoKeyVersion.

↳ protection_level int

Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.

↳ algorithm int

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

↳ attestation Google\Cloud\Kms\V1\KeyOperationAttestation

Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.

↳ create_time Google\Protobuf\Timestamp

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

↳ generate_time Google\Protobuf\Timestamp

Output only. The time this CryptoKeyVersion's key material was generated.

↳ destroy_time Google\Protobuf\Timestamp

Output only. The time this CryptoKeyVersion's key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.

↳ destroy_event_time Google\Protobuf\Timestamp

Output only. The time this CryptoKeyVersion's key material was destroyed. Only present if state is DESTROYED.

↳ import_job string

Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.

↳ import_time Google\Protobuf\Timestamp

Output only. The time at which this CryptoKeyVersion's key material was most recently imported.

↳ import_failure_reason string

Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.

↳ generation_failure_reason string

Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.

↳ external_destruction_failure_reason string

Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.

↳ external_protection_level_options Google\Cloud\Kms\V1\ExternalProtectionLevelOptions

ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.

↳ reimport_eligible bool

Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.

getName

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

Returns
TypeDescription
string

setName

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getState

The current state of the CryptoKeyVersion.

Returns
TypeDescription
int

setState

The current state of the CryptoKeyVersion.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getProtectionLevel

Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.

Returns
TypeDescription
int

setProtectionLevel

Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getAlgorithm

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

Returns
TypeDescription
int

setAlgorithm

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getAttestation

Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.

Returns
TypeDescription
Google\Cloud\Kms\V1\KeyOperationAttestation|null

hasAttestation

clearAttestation

setAttestation

Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.

Parameter
NameDescription
var Google\Cloud\Kms\V1\KeyOperationAttestation
Returns
TypeDescription
$this

getCreateTime

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

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

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

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getGenerateTime

Output only. The time this CryptoKeyVersion's key material was generated.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasGenerateTime

clearGenerateTime

setGenerateTime

Output only. The time this CryptoKeyVersion's key material was generated.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getDestroyTime

Output only. The time this CryptoKeyVersion's key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasDestroyTime

clearDestroyTime

setDestroyTime

Output only. The time this CryptoKeyVersion's key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getDestroyEventTime

Output only. The time this CryptoKeyVersion's key material was destroyed. Only present if state is DESTROYED.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasDestroyEventTime

clearDestroyEventTime

setDestroyEventTime

Output only. The time this CryptoKeyVersion's key material was destroyed. Only present if state is DESTROYED.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getImportJob

Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.

Returns
TypeDescription
string

setImportJob

Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getImportTime

Output only. The time at which this CryptoKeyVersion's key material was most recently imported.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasImportTime

clearImportTime

setImportTime

Output only. The time at which this CryptoKeyVersion's key material was most recently imported.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getImportFailureReason

Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.

Returns
TypeDescription
string

setImportFailureReason

Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getGenerationFailureReason

Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.

Returns
TypeDescription
string

setGenerationFailureReason

Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getExternalDestructionFailureReason

Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.

Returns
TypeDescription
string

setExternalDestructionFailureReason

Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getExternalProtectionLevelOptions

ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.

Returns
TypeDescription
Google\Cloud\Kms\V1\ExternalProtectionLevelOptions|null

hasExternalProtectionLevelOptions

clearExternalProtectionLevelOptions

setExternalProtectionLevelOptions

ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.

Parameter
NameDescription
var Google\Cloud\Kms\V1\ExternalProtectionLevelOptions
Returns
TypeDescription
$this

getReimportEligible

Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.

Returns
TypeDescription
bool

setReimportEligible

Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this