Reference documentation and code samples for the Secret Manager v1beta2 API class SecretPayload.
A secret payload resource in the Secret Manager API. This contains the
sensitive secret payload that is associated with a
[SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion].
Optional. If specified,
[SecretManagerService][google.cloud.secretmanager.v1beta2.SecretManagerService]
will verify the integrity of the received
[data][google.cloud.secretmanager.v1beta2.SecretPayload.data] on
[SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion]
calls using the crc32c checksum and store it to include in future
[SecretManagerService.AccessSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion]
responses. If a checksum is not provided in the
[SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion]
request, the
[SecretManagerService][google.cloud.secretmanager.v1beta2.SecretManagerService]
will generate and store one for you.
[[["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\u003eThe \u003ccode\u003eSecretPayload\u003c/code\u003e class represents a secret payload resource within the Secret Manager v1beta2 API, holding sensitive data associated with a \u003ccode\u003eSecretVersion\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionalities for message handling, equality comparison, deep cloning, and buffer management.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecretPayload\u003c/code\u003e class has two constructors, a default constructor and one that accepts another \u003ccode\u003eSecretPayload\u003c/code\u003e object, enabling the creation of new instances or copies.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a \u003ccode\u003eData\u003c/code\u003e property of type \u003ccode\u003eByteString\u003c/code\u003e for storing the secret data, which must not exceed 64KiB in size.\u003c/p\u003e\n"],["\u003cp\u003eAn optional \u003ccode\u003eDataCrc32C\u003c/code\u003e property of type \u003ccode\u003elong\u003c/code\u003e allows for the verification of data integrity using a crc32c checksum during \u003ccode\u003eAddSecretVersion\u003c/code\u003e calls and included in \u003ccode\u003eAccessSecretVersion\u003c/code\u003e responses.\u003c/p\u003e\n"]]],[],null,["# Secret Manager v1beta2 API - Class SecretPayload (1.0.0-beta03)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta03 (latest)](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/latest/Google.Cloud.SecretManager.V1Beta2.SecretPayload)\n- [1.0.0-beta02](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/1.0.0-beta02/Google.Cloud.SecretManager.V1Beta2.SecretPayload) \n\n public sealed class SecretPayload : IMessage\u003cSecretPayload\u003e, IEquatable\u003cSecretPayload\u003e, IDeepCloneable\u003cSecretPayload\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Secret Manager v1beta2 API class SecretPayload.\n\nA secret payload resource in the Secret Manager API. This contains the\nsensitive secret payload that is associated with a\n\\[SecretVersion\\]\\[google.cloud.secretmanager.v1beta2.SecretVersion\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SecretPayload \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SecretPayload](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/latest/Google.Cloud.SecretManager.V1Beta2.SecretPayload), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SecretPayload](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/latest/Google.Cloud.SecretManager.V1Beta2.SecretPayload), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SecretPayload](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/latest/Google.Cloud.SecretManager.V1Beta2.SecretPayload), [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.SecretManager.V1Beta2](/dotnet/docs/reference/Google.Cloud.SecretManager.V1Beta2/latest/Google.Cloud.SecretManager.V1Beta2)\n\nAssembly\n--------\n\nGoogle.Cloud.SecretManager.V1Beta2.dll\n\nConstructors\n------------\n\n### SecretPayload()\n\n public SecretPayload()\n\n### SecretPayload(SecretPayload)\n\n public SecretPayload(SecretPayload other)\n\nProperties\n----------\n\n### Data\n\n public ByteString Data { get; set; }\n\nThe secret data. Must be no larger than 64KiB.\n\n### DataCrc32C\n\n public long DataCrc32C { get; set; }\n\nOptional. If specified,\n\\[SecretManagerService\\]\\[google.cloud.secretmanager.v1beta2.SecretManagerService\\]\nwill verify the integrity of the received\n\\[data\\]\\[google.cloud.secretmanager.v1beta2.SecretPayload.data\\] on\n\\[SecretManagerService.AddSecretVersion\\]\\[google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion\\]\ncalls using the crc32c checksum and store it to include in future\n\\[SecretManagerService.AccessSecretVersion\\]\\[google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion\\]\nresponses. If a checksum is not provided in the\n\\[SecretManagerService.AddSecretVersion\\]\\[google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion\\]\nrequest, the\n\\[SecretManagerService\\]\\[google.cloud.secretmanager.v1beta2.SecretManagerService\\]\nwill generate and store one for you.\n\nThe CRC32C value is encoded as a Int64 for compatibility, and can be\nsafely downconverted to uint32 in languages that support this type.\n\u003chttps://cloud.google.com/apis/design/design_patterns#integer_types\u003e\n\n### HasDataCrc32C\n\n public bool HasDataCrc32C { get; }\n\nGets whether the \"data_crc32c\" field is set"]]