public sealed class CustomerEncryptionKey : IMessage<CustomerEncryptionKey>, IEquatable<CustomerEncryptionKey>, IDeepCloneable<CustomerEncryptionKey>, IBufferMessage, IMessage
Reference documentation and code samples for the Backup and DR Service v1 API class CustomerEncryptionKey.
Optional. The service account being used for the encryption request for the
given KMS key. If absent, the Compute Engine default service account is
used.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eCustomerEncryptionKey\u003c/code\u003e class within the Google Cloud Backup and DR Service v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCustomerEncryptionKey\u003c/code\u003e class is used to represent a customer-supplied encryption key for the Backup and DR Service.\u003c/p\u003e\n"],["\u003cp\u003eIt supports different types of keys, including KMS keys, raw keys, and RSA-encrypted keys, each having corresponding properties.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several interfaces, such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, and \u003ccode\u003eIDeepCloneable\u003c/code\u003e, allowing for message manipulation, equality comparisons, and deep cloning.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eCustomerEncryptionKey\u003c/code\u003e class is 2.1.0, with previous versions available, including version 2.0.0, 1.2.0, 1.1.0, and 1.0.0-beta02.\u003c/p\u003e\n"]]],[],null,["# Backup and DR Service v1 API - Class CustomerEncryptionKey (2.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.0 (latest)](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/latest/Google.Cloud.BackupDR.V1.CustomerEncryptionKey)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/2.1.0/Google.Cloud.BackupDR.V1.CustomerEncryptionKey)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/2.0.0/Google.Cloud.BackupDR.V1.CustomerEncryptionKey)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/1.2.0/Google.Cloud.BackupDR.V1.CustomerEncryptionKey)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/1.1.0/Google.Cloud.BackupDR.V1.CustomerEncryptionKey)\n- [1.0.0-beta02](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/1.0.0-beta02/Google.Cloud.BackupDR.V1.CustomerEncryptionKey) \n\n public sealed class CustomerEncryptionKey : IMessage\u003cCustomerEncryptionKey\u003e, IEquatable\u003cCustomerEncryptionKey\u003e, IDeepCloneable\u003cCustomerEncryptionKey\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Backup and DR Service v1 API class CustomerEncryptionKey.\n\nA customer-supplied encryption key. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CustomerEncryptionKey \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CustomerEncryptionKey](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/latest/Google.Cloud.BackupDR.V1.CustomerEncryptionKey), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CustomerEncryptionKey](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/latest/Google.Cloud.BackupDR.V1.CustomerEncryptionKey), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CustomerEncryptionKey](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/latest/Google.Cloud.BackupDR.V1.CustomerEncryptionKey), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.BackupDR.V1](/dotnet/docs/reference/Google.Cloud.BackupDR.V1/latest/Google.Cloud.BackupDR.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.BackupDR.V1.dll\n\nConstructors\n------------\n\n### CustomerEncryptionKey()\n\n public CustomerEncryptionKey()\n\n### CustomerEncryptionKey(CustomerEncryptionKey)\n\n public CustomerEncryptionKey(CustomerEncryptionKey other)\n\nProperties\n----------\n\n### HasKmsKeyName\n\n public bool HasKmsKeyName { get; }\n\nGets whether the \"kms_key_name\" field is set\n\n### HasKmsKeyServiceAccount\n\n public bool HasKmsKeyServiceAccount { get; }\n\nGets whether the \"kms_key_service_account\" field is set\n\n### HasRawKey\n\n public bool HasRawKey { get; }\n\nGets whether the \"raw_key\" field is set\n\n### HasRsaEncryptedKey\n\n public bool HasRsaEncryptedKey { get; }\n\nGets whether the \"rsa_encrypted_key\" field is set\n\n### KeyCase\n\n public CustomerEncryptionKey.KeyOneofCase KeyCase { get; }\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\nOptional. The name of the encryption key that is stored in Google Cloud\nKMS.\n\n### KmsKeyServiceAccount\n\n public string KmsKeyServiceAccount { get; set; }\n\nOptional. The service account being used for the encryption request for the\ngiven KMS key. If absent, the Compute Engine default service account is\nused.\n\n### RawKey\n\n public string RawKey { get; set; }\n\nOptional. Specifies a 256-bit customer-supplied\nencryption key.\n\n### RsaEncryptedKey\n\n public string RsaEncryptedKey { get; set; }\n\nOptional. RSA-wrapped 2048-bit\ncustomer-supplied encryption key to either encrypt or decrypt this\nresource."]]