Class CustomerEncryptionKey.Builder (1.31.0)

public static final class CustomerEncryptionKey.Builder extends GeneratedMessageV3.Builder<CustomerEncryptionKey.Builder> implements CustomerEncryptionKeyOrBuilder

Protobuf type google.cloud.compute.v1.CustomerEncryptionKey

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CustomerEncryptionKey.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

build()

public CustomerEncryptionKey build()
Returns
TypeDescription
CustomerEncryptionKey

buildPartial()

public CustomerEncryptionKey buildPartial()
Returns
TypeDescription
CustomerEncryptionKey

clear()

public CustomerEncryptionKey.Builder clear()
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public CustomerEncryptionKey.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

clearKmsKeyName()

public CustomerEncryptionKey.Builder clearKmsKeyName()

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

clearKmsKeyServiceAccount()

public CustomerEncryptionKey.Builder clearKmsKeyServiceAccount()

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CustomerEncryptionKey.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

clearRawKey()

public CustomerEncryptionKey.Builder clearRawKey()

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

clearRsaEncryptedKey()

public CustomerEncryptionKey.Builder clearRsaEncryptedKey()

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

clearSha256()

public CustomerEncryptionKey.Builder clearSha256()

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

clone()

public CustomerEncryptionKey.Builder clone()
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

getDefaultInstanceForType()

public CustomerEncryptionKey getDefaultInstanceForType()
Returns
TypeDescription
CustomerEncryptionKey

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getKmsKeyName()

public String getKmsKeyName()

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Returns
TypeDescription
String

The kmsKeyName.

getKmsKeyNameBytes()

public ByteString getKmsKeyNameBytes()

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Returns
TypeDescription
ByteString

The bytes for kmsKeyName.

getKmsKeyServiceAccount()

public String getKmsKeyServiceAccount()

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Returns
TypeDescription
String

The kmsKeyServiceAccount.

getKmsKeyServiceAccountBytes()

public ByteString getKmsKeyServiceAccountBytes()

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Returns
TypeDescription
ByteString

The bytes for kmsKeyServiceAccount.

getRawKey()

public String getRawKey()

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Returns
TypeDescription
String

The rawKey.

getRawKeyBytes()

public ByteString getRawKeyBytes()

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Returns
TypeDescription
ByteString

The bytes for rawKey.

getRsaEncryptedKey()

public String getRsaEncryptedKey()

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Returns
TypeDescription
String

The rsaEncryptedKey.

getRsaEncryptedKeyBytes()

public ByteString getRsaEncryptedKeyBytes()

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Returns
TypeDescription
ByteString

The bytes for rsaEncryptedKey.

getSha256()

public String getSha256()

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Returns
TypeDescription
String

The sha256.

getSha256Bytes()

public ByteString getSha256Bytes()

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Returns
TypeDescription
ByteString

The bytes for sha256.

hasKmsKeyName()

public boolean hasKmsKeyName()

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Returns
TypeDescription
boolean

Whether the kmsKeyName field is set.

hasKmsKeyServiceAccount()

public boolean hasKmsKeyServiceAccount()

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Returns
TypeDescription
boolean

Whether the kmsKeyServiceAccount field is set.

hasRawKey()

public boolean hasRawKey()

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Returns
TypeDescription
boolean

Whether the rawKey field is set.

hasRsaEncryptedKey()

public boolean hasRsaEncryptedKey()

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Returns
TypeDescription
boolean

Whether the rsaEncryptedKey field is set.

hasSha256()

public boolean hasSha256()

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Returns
TypeDescription
boolean

Whether the sha256 field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CustomerEncryptionKey other)

public CustomerEncryptionKey.Builder mergeFrom(CustomerEncryptionKey other)
Parameter
NameDescription
otherCustomerEncryptionKey
Returns
TypeDescription
CustomerEncryptionKey.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CustomerEncryptionKey.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CustomerEncryptionKey.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CustomerEncryptionKey.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public CustomerEncryptionKey.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

setKmsKeyName(String value)

public CustomerEncryptionKey.Builder setKmsKeyName(String value)

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Parameter
NameDescription
valueString

The kmsKeyName to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setKmsKeyNameBytes(ByteString value)

public CustomerEncryptionKey.Builder setKmsKeyNameBytes(ByteString value)

The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1

optional string kms_key_name = 484373913;

Parameter
NameDescription
valueByteString

The bytes for kmsKeyName to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setKmsKeyServiceAccount(String value)

public CustomerEncryptionKey.Builder setKmsKeyServiceAccount(String value)

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Parameter
NameDescription
valueString

The kmsKeyServiceAccount to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setKmsKeyServiceAccountBytes(ByteString value)

public CustomerEncryptionKey.Builder setKmsKeyServiceAccountBytes(ByteString value)

The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/

optional string kms_key_service_account = 209986261;

Parameter
NameDescription
valueByteString

The bytes for kmsKeyServiceAccount to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setRawKey(String value)

public CustomerEncryptionKey.Builder setRawKey(String value)

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Parameter
NameDescription
valueString

The rawKey to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setRawKeyBytes(ByteString value)

public CustomerEncryptionKey.Builder setRawKeyBytes(ByteString value)

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="

optional string raw_key = 449196488;

Parameter
NameDescription
valueByteString

The bytes for rawKey to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CustomerEncryptionKey.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides

setRsaEncryptedKey(String value)

public CustomerEncryptionKey.Builder setRsaEncryptedKey(String value)

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Parameter
NameDescription
valueString

The rsaEncryptedKey to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setRsaEncryptedKeyBytes(ByteString value)

public CustomerEncryptionKey.Builder setRsaEncryptedKeyBytes(ByteString value)

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem

optional string rsa_encrypted_key = 335487397;

Parameter
NameDescription
valueByteString

The bytes for rsaEncryptedKey to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setSha256(String value)

public CustomerEncryptionKey.Builder setSha256(String value)

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Parameter
NameDescription
valueString

The sha256 to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setSha256Bytes(ByteString value)

public CustomerEncryptionKey.Builder setSha256Bytes(ByteString value)

[Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

optional string sha256 = 170112551;

Parameter
NameDescription
valueByteString

The bytes for sha256 to set.

Returns
TypeDescription
CustomerEncryptionKey.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CustomerEncryptionKey.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CustomerEncryptionKey.Builder
Overrides