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

147 lines
3.6 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>95</hex>
</command>
<data extend="data">
<privateKeyLength len="4" :value="privateKeyLen()" cn="私钥的长度"></privateKeyLength>
<privateKey cn="私钥"></privateKey>
<keyLength len="4" :value="keyLen()" cn="密钥的长度">公钥加密后的密钥的长度</keyLength>
<key cn="密钥">公钥加密后的密钥</key>
<sln len="1" cn="密钥的方案">
LMK 下加密密钥的方案。
</sln>
<tailSep len="1" :if=" null != $packet.data.tail " cn="尾分隔">
可选项。如果显示消息尾域,则该域必须显示。值为
“X19”。
<hex>19</hex>
</tailSep>
<tail maxLen="32" required="false" cn="尾部">
可选项。最大长度为 32个字符。
</tail>
</data>
</req>
<res>
<command>
<hex>96</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>
<lmkHead len="1" cn="lmk 头">
如果是 'L' lmk 32 个字节长,否则 lmk 64 个字节长。
</lmkHead>
<lmk :len="lmkLen()" cn="对称密钥的密文">
对称密钥的密文,由 LMK30-31 保护。
</lmk>
<keyCheck :len="KCVLen()" cn="密钥校验值">
密钥校验值
</keyCheck>
<infoLen len="4" cn="附加信息长度">
附加信息长度
</infoLen>
<info :len="getInfoLen()" cn="附加信息">
附加信息
</info>
</data>
</res>
<script>
function keyLen(){
var data = $packet.data;
return data.key.length;
}
function privateKeyLen(){
var data = $packet.data;
return data.privateKey.length;
}
function KCVLen(){
var sln = $packet.data.sln
if ( "S".equals( sln ) ) {
return 32
}else {
return 16
}
}
function getKeyLen() {
return Util.a2i( $final.getSection('data').getSection('keyLen') )
}
function getInfoLen() {
return Util.a2i( $final.getSection('data').getSection('infoLen') )
}
function lmkLen() {
if( Arrays.equals("L".getBytes(),
$final.getSection('data').getSection('lmkHead').getValue()
) ){
return 64
}else{
return 32
}
} </script>
</packet>