public sealed class DeviceCredential : IMessage<DeviceCredential>, IEquatable<DeviceCredential>, IDeepCloneable<DeviceCredential>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud IoT v1 API class DeviceCredential.
A server-stored device credential used for authentication.
[Optional] The time at which this credential becomes invalid. This
credential will be ignored for new client authentication requests after
this timestamp; however, it will not be automatically deleted.
public PublicKeyCredential PublicKey { get; set; }
A public key used to verify the signature of JSON Web Tokens (JWTs).
When adding a new device credential, either via device creation or via
modifications, this public key credential may be required to be signed by
one of the registry level certificates. More specifically, if the
registry contains at least one certificate, any new device credential
must be signed by one of the registry certificates. As a result,
when the registry contains certificates, only X.509 certificates are
accepted as device credentials. However, if the registry does
not contain a certificate, self-signed certificates and public keys will
be accepted. New device credentials must be different from every
registry-level certificate.
[[["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 latest version of the \u003ccode\u003eDeviceCredential\u003c/code\u003e class is 2.2.0, which is part of the Google Cloud IoT v1 API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDeviceCredential\u003c/code\u003e is a server-stored credential for device authentication, implementing several interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers two constructors, one default and another that accepts another \u003ccode\u003eDeviceCredential\u003c/code\u003e object for cloning purposes.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003eCredentialCase\u003c/code\u003e, \u003ccode\u003eExpirationTime\u003c/code\u003e (an optional timestamp for credential validity), and \u003ccode\u003ePublicKey\u003c/code\u003e for JWT signature verification, with the requirement that the public key must be signed by a registry level certificate when one exists in the registry.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeviceCredential\u003c/code\u003e class in the namespace \u003ccode\u003eGoogle.Cloud.Iot.V1\u003c/code\u003e is found in the \u003ccode\u003eGoogle.Cloud.Iot.V1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,[]]