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.
[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.
getPublicKey
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.
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.
[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.
[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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud IoT Core V1 Client - Class DeviceCredential (1.7.5)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.5 (latest)](/php/docs/reference/cloud-iot/latest/V1.DeviceCredential)\n- [1.7.4](/php/docs/reference/cloud-iot/1.7.4/V1.DeviceCredential)\n- [1.6.4](/php/docs/reference/cloud-iot/1.6.4/V1.DeviceCredential)\n- [1.5.12](/php/docs/reference/cloud-iot/1.5.12/V1.DeviceCredential) \nReference documentation and code samples for the Google Cloud IoT Core V1 Client class DeviceCredential.\n\nA server-stored device credential used for authentication.\n\nGenerated from protobuf message `google.cloud.iot.v1.DeviceCredential`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Iot \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getPublicKey\n\nA public key used to verify the signature of JSON Web Tokens (JWTs).\n\nWhen adding a new device credential, either via device creation or via\nmodifications, this public key credential may be required to be signed by\none of the registry level certificates. More specifically, if the\nregistry contains at least one certificate, any new device credential\nmust be signed by one of the registry certificates. As a result,\nwhen the registry contains certificates, only X.509 certificates are\naccepted as device credentials. However, if the registry does\nnot contain a certificate, self-signed certificates and public keys will\nbe accepted. New device credentials must be different from every\nregistry-level certificate.\n\n### hasPublicKey\n\n### setPublicKey\n\nA public key used to verify the signature of JSON Web Tokens (JWTs).\n\nWhen adding a new device credential, either via device creation or via\nmodifications, this public key credential may be required to be signed by\none of the registry level certificates. More specifically, if the\nregistry contains at least one certificate, any new device credential\nmust be signed by one of the registry certificates. As a result,\nwhen the registry contains certificates, only X.509 certificates are\naccepted as device credentials. However, if the registry does\nnot contain a certificate, self-signed certificates and public keys will\nbe accepted. New device credentials must be different from every\nregistry-level certificate.\n\n### getExpirationTime\n\n\\[Optional\\] The time at which this credential becomes invalid. This\ncredential will be ignored for new client authentication requests after\nthis timestamp; however, it will not be automatically deleted.\n\n### hasExpirationTime\n\n### clearExpirationTime\n\n### setExpirationTime\n\n\\[Optional\\] The time at which this credential becomes invalid. This\ncredential will be ignored for new client authentication requests after\nthis timestamp; however, it will not be automatically deleted.\n\n### getCredential"]]