问题描述
我正在尝试使用基于 TPM 的注册到我的 IoT 中心。我们已经在现场使用了一些设备(运行 windows iot ent),所以我编写了一个基本的 PS 脚本来获取他们的 TPM 公共 EK 并在我们的 DPS 中手动注册它们。该脚本生成 ASN.1 编码公钥的 base64 字符串。当我在“背书键”字段中使用该值时,我收到错误请求错误消息:“背书键无效,或与注册不匹配。”
我是否使用了错误的格式来编码公钥?是否有另一种简单的方法来访问格式化为 base64 字符串的 TPM 公共 EK? 如果有帮助,这是我的脚本
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
enum {rows = 2,cols = 3};
static void *thread_handler(void *arg)
{
int (*arr)[cols] = arg;
for (int row = 0; row < rows; row++)
{
for (int col = 0; col < cols; coL++)
{
printf("%d ",arr[row][col]);
}
printf("\n");
}
return NULL;
}
int main(void)
{
int arr[rows][cols] = {{1,2,3},{4,5,6}};
pthread_t thread;
if (pthread_create(&thread,NULL,thread_handler,arr) != 0)
{
perror("pthread_create");
exit(EXIT_FAILURE);
}
if (pthread_join(thread,NULL) != 0)
{
perror("pthread_join");
exit(EXIT_FAILURE);
}
return 0;
}
非常感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)