sydapi/DProto/73.xml

157 lines
4.2 KiB
XML
Raw 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>73</hex>
</command>
<data extend="data">
<privateKeyLength len="4" :value="privateKeyLen()" cn="私钥长度">
当私钥标记为全 9 时使用该区域的值
</privateKeyLength>
<privateKeyTag len="27" cn="指示私钥位置的标记" :if="useLocalKey()" >
数字为存储私钥的索引,除了
全 9 表示使用由命令中提供的密钥。
27 位的索引号16 位机构号+3 位密钥类型+8 位密钥
索引号。
</privateKeyTag>
<privateKey cn="私钥" >
当私钥标记为全 9 时使用该区域的值
</privateKey>
<cipherKeyLength len="4" :value="cipherKeyLen()" cn="会话密钥长度"></cipherKeyLength>
<cipherKey cn="会话密钥"></cipherKey>
<lmk len="1" cn="LMK">
LMK 下加密密钥的方案。
</lmk>
<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>74</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="16" cn="密钥校验值">
密钥校验值
</keyCheck>
<tailSep len="1" required="false" cn="尾分隔">
可选项。如果显示消息尾域,则该域必须显示。值为 “X19”。
<hex>19</hex>
</tailSep>
<tail maxLen="32" required="false" cn="尾部">
可选项。最大长度为 32个字符。
</tail>
</data>
</res>
<script>function useLocalKey(){
if( "999999999999999999999999999".equals($packet.data.privateKeyTag))
{
return false;
}else{
return true;
}
}
function userIdLen(){
return $packet.data.userId.length;
}
function cipherKeyLen(){
var data = $packet.data;
return data.cipherKey.length;
}
function dataLen(){
return $packet.data.infoData.length;
}
function privateKeyLen(){
var data = $packet.data;
return data.privateKey.length;
}
function getKeyLen() {
return Util.a2i( $final.getSection('data').getSection('keyLen') )
}
function lmkLen() {
if( Arrays.equals("L".getBytes(),
$final.getSection('data').getSection('lmkHead').getValue()
) ){
return 64
}else{
return 32
}
} </script>
</packet>