public sealed class CryptoKey : IMessage<CryptoKey>, IEquatable<CryptoKey>, IDeepCloneable<CryptoKey>, IBufferMessage, IMessage
This is a data encryption key (DEK) (as opposed to
a key encryption key (KEK) stored by KMS).
When using KMS to wrap/unwrap DEKs, be sure to set an appropriate
IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot
unwrap the data crypto key.
[[["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 webpage details the \u003ccode\u003eCryptoKey\u003c/code\u003e class within the \u003ccode\u003eGoogle.Cloud.Dlp.V2\u003c/code\u003e namespace, a data encryption key (DEK) used in Google Cloud's Data Loss Prevention (DLP) API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCryptoKey\u003c/code\u003e class is part of the .NET library and supports multiple versions of the API, from 2.15.0 to 4.16.0, with 4.16.0 being the latest version available.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e and inherits from \u003ccode\u003eObject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCryptoKey\u003c/code\u003e objects can be created with no arguments or by copying another \u003ccode\u003eCryptoKey\u003c/code\u003e object, offering flexibility in its instantiation, and can come in the form of \u003ccode\u003eKmsWrapped\u003c/code\u003e, \u003ccode\u003eTransient\u003c/code\u003e and \u003ccode\u003eUnwrapped\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhen utilizing KMS for key wrapping/unwrapping, it's important to implement a secure IAM policy on the KMS CryptoKey to prevent unauthorized unwrapping of the data crypto key.\u003c/p\u003e\n"]]],[],null,[]]