Class CustomerEncryptionKey.Builder (1.52.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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CustomerEncryptionKey.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides

build()

public CustomerEncryptionKey build()
Returns
Type Description
CustomerEncryptionKey

buildPartial()

public CustomerEncryptionKey buildPartial()
Returns
Type Description
CustomerEncryptionKey

clear()

public CustomerEncryptionKey.Builder clear()
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public CustomerEncryptionKey.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
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
Type Description
CustomerEncryptionKey.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CustomerEncryptionKey.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
CustomerEncryptionKey.Builder

This builder for chaining.

clone()

public CustomerEncryptionKey.Builder clone()
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides

getDefaultInstanceForType()

public CustomerEncryptionKey getDefaultInstanceForType()
Returns
Type Description
CustomerEncryptionKey

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the sha256 field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CustomerEncryptionKey other)

public CustomerEncryptionKey.Builder mergeFrom(CustomerEncryptionKey other)
Parameter
Name Description
other CustomerEncryptionKey
Returns
Type Description
CustomerEncryptionKey.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CustomerEncryptionKey.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CustomerEncryptionKey.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CustomerEncryptionKey.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public CustomerEncryptionKey.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value String

The kmsKeyName to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for kmsKeyName to set.

Returns
Type Description
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
Name Description
value String

The kmsKeyServiceAccount to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for kmsKeyServiceAccount to set.

Returns
Type Description
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
Name Description
value String

The rawKey to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for rawKey to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The rsaEncryptedKey to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for rsaEncryptedKey to set.

Returns
Type Description
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
Name Description
value String

The sha256 to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for sha256 to set.

Returns
Type Description
CustomerEncryptionKey.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CustomerEncryptionKey.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CustomerEncryptionKey.Builder
Overrides