Class CryptoKeyVersion (2.33.0)

public final class CryptoKeyVersion extends GeneratedMessageV3 implements CryptoKeyVersionOrBuilder

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.

Protobuf type google.cloud.kms.v1.CryptoKeyVersion

Static Fields

ALGORITHM_FIELD_NUMBER

public static final int ALGORITHM_FIELD_NUMBER
Field Value
TypeDescription
int

ATTESTATION_FIELD_NUMBER

public static final int ATTESTATION_FIELD_NUMBER
Field Value
TypeDescription
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

DESTROY_EVENT_TIME_FIELD_NUMBER

public static final int DESTROY_EVENT_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

DESTROY_TIME_FIELD_NUMBER

public static final int DESTROY_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

EXTERNAL_DESTRUCTION_FAILURE_REASON_FIELD_NUMBER

public static final int EXTERNAL_DESTRUCTION_FAILURE_REASON_FIELD_NUMBER
Field Value
TypeDescription
int

EXTERNAL_PROTECTION_LEVEL_OPTIONS_FIELD_NUMBER

public static final int EXTERNAL_PROTECTION_LEVEL_OPTIONS_FIELD_NUMBER
Field Value
TypeDescription
int

GENERATE_TIME_FIELD_NUMBER

public static final int GENERATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

GENERATION_FAILURE_REASON_FIELD_NUMBER

public static final int GENERATION_FAILURE_REASON_FIELD_NUMBER
Field Value
TypeDescription
int

IMPORT_FAILURE_REASON_FIELD_NUMBER

public static final int IMPORT_FAILURE_REASON_FIELD_NUMBER
Field Value
TypeDescription
int

IMPORT_JOB_FIELD_NUMBER

public static final int IMPORT_JOB_FIELD_NUMBER
Field Value
TypeDescription
int

IMPORT_TIME_FIELD_NUMBER

public static final int IMPORT_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PROTECTION_LEVEL_FIELD_NUMBER

public static final int PROTECTION_LEVEL_FIELD_NUMBER
Field Value
TypeDescription
int

REIMPORT_ELIGIBLE_FIELD_NUMBER

public static final int REIMPORT_ELIGIBLE_FIELD_NUMBER
Field Value
TypeDescription
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static CryptoKeyVersion getDefaultInstance()
Returns
TypeDescription
CryptoKeyVersion

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static CryptoKeyVersion.Builder newBuilder()
Returns
TypeDescription
CryptoKeyVersion.Builder

newBuilder(CryptoKeyVersion prototype)

public static CryptoKeyVersion.Builder newBuilder(CryptoKeyVersion prototype)
Parameter
NameDescription
prototypeCryptoKeyVersion
Returns
TypeDescription
CryptoKeyVersion.Builder

parseDelimitedFrom(InputStream input)

public static CryptoKeyVersion parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static CryptoKeyVersion parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CryptoKeyVersion parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CryptoKeyVersion parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static CryptoKeyVersion parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static CryptoKeyVersion parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CryptoKeyVersion parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CryptoKeyVersion
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<CryptoKeyVersion> parser()
Returns
TypeDescription
Parser<CryptoKeyVersion>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAlgorithm()

public CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm()

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
CryptoKeyVersion.CryptoKeyVersionAlgorithm

The algorithm.

getAlgorithmValue()

public int getAlgorithmValue()

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for algorithm.

getAttestation()

public KeyOperationAttestation 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.

.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
KeyOperationAttestation

The attestation.

getAttestationOrBuilder()

public KeyOperationAttestationOrBuilder getAttestationOrBuilder()

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.

.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
KeyOperationAttestationOrBuilder

getCreateTime()

public Timestamp getCreateTime()

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

.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

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

.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public CryptoKeyVersion getDefaultInstanceForType()
Returns
TypeDescription
CryptoKeyVersion

getDestroyEventTime()

public Timestamp getDestroyEventTime()

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

.google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The destroyEventTime.

getDestroyEventTimeOrBuilder()

public TimestampOrBuilder getDestroyEventTimeOrBuilder()

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

.google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDestroyTime()

public Timestamp getDestroyTime()

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

.google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The destroyTime.

getDestroyTimeOrBuilder()

public TimestampOrBuilder getDestroyTimeOrBuilder()

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

.google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getExternalDestructionFailureReason()

public String getExternalDestructionFailureReason()

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

string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The externalDestructionFailureReason.

getExternalDestructionFailureReasonBytes()

public ByteString getExternalDestructionFailureReasonBytes()

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

string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for externalDestructionFailureReason.

getExternalProtectionLevelOptions()

public ExternalProtectionLevelOptions 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.

.google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17;

Returns
TypeDescription
ExternalProtectionLevelOptions

The externalProtectionLevelOptions.

getExternalProtectionLevelOptionsOrBuilder()

public ExternalProtectionLevelOptionsOrBuilder getExternalProtectionLevelOptionsOrBuilder()

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

.google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17;

Returns
TypeDescription
ExternalProtectionLevelOptionsOrBuilder

getGenerateTime()

public Timestamp getGenerateTime()

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

.google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The generateTime.

getGenerateTimeOrBuilder()

public TimestampOrBuilder getGenerateTimeOrBuilder()

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

.google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getGenerationFailureReason()

public String getGenerationFailureReason()

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

string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The generationFailureReason.

getGenerationFailureReasonBytes()