我正在为物联网设备和客户端之间的 confidential 通信设计API . 必须是客户端 - 设备连接是 secure 并且没有中间人可以缓和通信或攻击设备,包括路由服务器 .

网络图如下:

enter image description here

  • IoT devices are always in home behind the same network.

  • Client devices are mobile and change networks

  • Clients continuously connect and disconnect to the IoT device

客户端必须能够通过在每个IoT设备上运行的API服务器在IoT设备上执行命令 . 路由服务器仅隧道传递请求,但 must not be trusted .

我的问题是:

我应该使用什么协议来实现这个方案?

我对 SSH 有点困惑 . 它似乎非常适合通过隧道进行安全客户端< - > IoT设备通信 .

But is it possible to create a RESTful API using SSH?

我不需要直接访问设备的shell,我需要一个抽象层,由IoT设备上运行的API提供 .

如果SSH不是一个选项,我是否可以通过客户端以任何其他方式安全地路由请求并在IoT设备上执行命令?