我们可以从 google 物联网核心获取与设备关联的 RSA public 密钥吗
Can we get RSA public key associated with device from google iot core
实际上,我在 Google IoT Core 上有一个设备及其关联的 public 密钥。是否可以使用服务帐户(和相应的注册表)从任何脚本中获取 public 密钥。它是 google-iot-core 上的受限密钥吗?
是的,这是可能的。使用 python iot client 的示例:
from google.cloud import iot_v1
client = iot_v1.DeviceManagerClient()
name = client.device_path('my-project', 'my-location', 'my-registry', 'my-device')
response = client.get_device(name)
# Here you can see the credentials
print(response.credentials)
使用gcloud的示例:
gcloud iot devices describe my-device --project=my-project --region=my-location --registry=my-registry --format=json | jq '.credentials
您可以通过其他客户端或直接使用 Rest API 获取此信息。
实际上,我在 Google IoT Core 上有一个设备及其关联的 public 密钥。是否可以使用服务帐户(和相应的注册表)从任何脚本中获取 public 密钥。它是 google-iot-core 上的受限密钥吗?
是的,这是可能的。使用 python iot client 的示例:
from google.cloud import iot_v1
client = iot_v1.DeviceManagerClient()
name = client.device_path('my-project', 'my-location', 'my-registry', 'my-device')
response = client.get_device(name)
# Here you can see the credentials
print(response.credentials)
使用gcloud的示例:
gcloud iot devices describe my-device --project=my-project --region=my-location --registry=my-registry --format=json | jq '.credentials
您可以通过其他客户端或直接使用 Rest API 获取此信息。