sydapi/DProto/94.xml
2021-06-29 11:32:24 +08:00

132 lines
3.2 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" ?>
<packet extend="base">
<req>
<command>
<hex>94</hex>
</command>
<data extend="data">
<pkLen len="4" :value="pkLength()" cn="公钥长度">
公钥长度
</pkLen>
<pk cn="公钥">
DER 编码的公钥
</pk>
<infoLen len="4" :value="infoLength()" cn="附加信息长度">
附加信息长度
</infoLen>
<info cn="附加信息">
附加信息
</info>
<sln len="1" cn="密钥方案">
密钥方案
</sln>
</data>
</req>
<res>
<command>
<hex>95</hex>
</command>
<data>
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
<options>
<option cn="无错误">
<hex>00</hex>
</option>
<option cn="公钥不符合编码规则">
<hex>04</hex>
</option>
<option cn="无效的签名标识">
<hex>06</hex>
</option>
<option cn="无效的附加标识">
<hex>07</hex>
</option>
<option cn="密钥奇偶校验错误">
<hex>10</hex>
</option>
<option cn="LMK 错误">
LMK 错误;报告给管理员。
<hex>13</hex>
</option>
<option cn="输入数据错">
<hex>15</hex>
</option>
<option cn="DSP 错误">
DSP 错误;报告给管理员。
<hex>47</hex>
</option>
<option cn="密钥块长度错误">
<hex>76</hex>
</option>
<option cn="信息长度错">
<hex>80</hex>
</option>
</options>
</error>
<keyLength len="4" cn="密钥长度">
密钥长度
</keyLength>
<key :len="getKeyLen()" cn="密钥">
密钥
</key>
<takLmkHead len="1" cn="zpk 头" >
如果是 'Z' 16 个字节长
如果是 'X,U,S' 32 个字节长
如果是 'Y,T' 48 个字节长
</takLmkHead>
<takLmk len="32" cn="ZPKZMK" >
LMK 对 16-17 下加密的 TAK
</takLmk>
<keyCheck :len="keyCheckLen()" cn="密钥校验值">
用 TAK 加密 64 位 0 的结果。是 16H 还是 6H 取决于 KCV
的类型选项。 当 LMK 的密钥方案为 S 时,默认或 KCV
类型为 0 时,输出 32H 的 KCV
</keyCheck>
</data>
</res>
<script>
function pkLength(){
var data = $packet.data;
return data.pk.length;
}
function infoLength(){
var data = $packet.data;
return data.info.length;
}
function keyCheckLen() {
var sln = $packet.data.sln
if ( "S".equals( sln ) ) {
return 32
}else {
return 16
}
}
function getKeyLen() {
return Util.a2i( $final.getSection('data').getSection('keyLength') )
}
</script>
</packet>