Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
763 views
in Technique[技术] by (71.8m points)

amazon-web-services - 创建作业代码签名格式不能与aws-iot-device-sdk-js一起使用?(Create job code signing formats not working with aws-iot-device-sdk-js?)

I have created a job with job-document as follow:

(我创建了一个带有作业文档的作业,如下所示:)

{
  "operation": "install",
  "packageName": "copy-server.js",
  "workingDirectory": "./examples",
  "files": [
    {
      "fileName": "server.js",
      "fileVersion": "1.0.0",
      "fileSource": {
        "url": "${aws:iot:code-sign-signature:s3://us-east-1.<bucket_name>/server.js@version_id}"
      }
    }
  ]
}

I am using a profile created using platformId of "AWSIoTDeviceManagement-SHA256-ECDSA" for code signing.

(我正在使用使用“ AWSIoTDeviceManagement-SHA256-ECDSA”的platformId创建的配置文件进行代码签名。)

the output is the below job document recieved by the job agent:

(输出是作业代理收到的以下作业文档:)

{
  "operation": "install",
  "packageName": "copy-job.js",
  "workingDirectory": "./examples/",
  "files": [
    {
      "fileName": "server.js",
      "fileVersion": "1.0.0",
      "fileSource": {
        "url": {
          "rawPayloadSize": 137,
          "signature": "xxxxxxxxXXXXXXxxxxxxxx==",
          "signatureAlgorithm": "SHA256withECDSA",
          "payloadLocation": {
            "s3": {
              "bucketName": "bucket_name",
              "key": "server.js",
              "version": "version_id"
            }
          }
        }
      }
    }
  ]

Now as per the aws-iot-device-sdk-js document example for install the format shown there is:

(现在,按照aws-iot-device-sdk-js文档示例中所示的安装格式,有:)

{
  "operation": "install",
  "packageName": "uniquePackageName",
  "workingDirectory": "../jobs-example-directory",
  "launchCommand": "node jobs-example.js -f ~/certs -H <PREFIX>.iot.<REGION>.amazonaws.com -T thingName",
  "autoStart": "true",
  "files": [
    {
      "fileName": "jobs-example.js",
      "fileVersion": "1.0.2.10",
      "fileSource": {
        "url": "https://some-bucket.s3.amazonaws.com/jobs-example.js"
      },
      "checksum": {
        "inline": {
          "value": "9569257356cfc5c7b2b849e5f58b5d287f183e08627743498d9bd52801a2fbe4"
        },
        "hashAlgorithm": "SHA256"
      }
    },
    {
      "fileName": "config.json",
      "fileSource": {
        "url": "https://some-bucket.s3.amazonaws.com/config.json"
      }
    }
  ]
}
  1. So my question here is am I doing something wrong to generate different outputs?

    (所以我的问题是我在做错事情以生成不同的输出吗?)

  2. Or the example in the SDK and the generated document by AWS coding signing are handled in two different ways?

    (还是以两种不同的方式来处理SDK中的示例以及通过AWS编码签名生成的文档?)

  3. I am stuck here so I am looking for any suggestions on how to tackle it and what's being done wrong from my side?

    (我被困在这里,所以我正在寻找有关如何解决它的建议,以及我这边做错了什么?)

  ask by Shailendra Yadav translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...