使用 asn1parse 解码 openssl 数据时出现问题。使用 asn1parse 命令后,out.pem 包含与预期输出不匹配。实际输出和预期输出如下所示。请在这个问题上帮助我。
openssl asn1parse -inform PEM -in base64.pem -out out.pem
猫base64。佩姆cmF0aW9uLWhhbmRsaW5nIjogIm1lcmdlIiwKICAgICAgICAiY29uZmlndXJhdGlvbiI6ICJQSFJ2Y0NCNGJXeHVjejBpYUhSMGNITTZMMlY0WVcxd2JHVXVZMjl0TDJOdmJtWnBaeUkrQ2lBZ1BHRnVlUzE0Yld3dFkyOXVkR1Z1ZEMxdmEyRjVMejRLUEM5MGIzQStDZz09IiwKICAgICAgICAicG9zdC1jb25maWd1cmF0aW9uLXNjcmlwdCI6ICJJeTlpYVc0dlltRnphQXBsWTJodklDSnBibk5wWkdVZ2RHaGxJSEJ2YzNRdFkyOXVabWxuZFhKaGRHbHZiaTF6WTNKcGNIUXVMaTRpQ2c9PSIKICAgIH0KfQ==
0:d=0 hl=2 l= 86 prim: appl [ 7 ]
88:d=0 hl=2 l= 67 prim: appl [ 9 ]
cat out.pem GVudC1va2F5Lz4KPC90b3A+Cg==", "配置后脚本": "Iy9iaW4vYmFzaAplY2hvICJpbnNpZGUgdGhlIHBvc3QtY29uZmlndXJhdGlvbi1zY3JpcHQuLi4iCg==" } }
预期输出.pem b'0\x82\x03\x99\x06\x0b*\x86H\x86\xf7\r\x01\t\x10\x01+\xa0\x82\x03\x88\x04\x82\x03\x84 {\n "ietf-sztp-conveyed-info:onboarding-information": {\n "boot-image": {\n "download-uri": [\n "https://example.com/my-boot -image.img"\n ],\n "image-verification": [\n {\n "hash-algorithm": "ietf-sztp-conveyed-info:sha-256",\n "hash-value" :“d8:56:8d:d2:10:5e:dc:75:4c:c7:87:ae:f1:27:97:65:e0:65:17:6c:04:61:22:fa: 3e:82:cf:9d:0f:ae:1a:3d"\n }\n ]\n },\n "预配置脚本": "Iy9iaW4vYmFzaAplY2hvICJpbnNpZGUgdGhlIHByZS1jb25maWd1cmF0aW9uLXNjcmlwdC4uLiIK",\n "configuration-handling": "merge",\n "configuration": "PHRvcCB4bWxucz0iaHR0cHM6L2V4YW1wbGUuY29tL2NvbmZpZyI+CiAgPGFueS14bWwtY29udGVudC1va2F5Lz4KPC90b3A+Cg==",\n "post-configuration-script": "Iy9iaW4vYmFzaAplY2hvICJpbnNpZGUgdGhlIHBvc3QtY29uZmlndXJhdGlvbi1zY3JpcHQuLi4iCg=="\n }\n}'