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

119 lines
3.3 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>AA</hex>
</command>
<data extend="data">
<keyType len="3" cn="密钥类型">
密钥类型
</keyType>
<keySolution len="1" cn="密 钥 方 案LMK" >
LMK 下加密密钥的方案
</keySolution>
<keyClearPattern cn="密钥明文模式" >
两个明文分量异或合成
</keyClearPattern>
<businessKey len="1" cn="业务标识">
取值 N可选当选定此标识时表示密钥加密方案采用默认方式
</businessKey>
<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>AB</hex>
</command>
<data>
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
<options>
<option cn="无错误">
<hex>00</hex>
</option>
<option cn="用户存储区中没有装载密钥">
<hex>12</hex>
</option>
<option cn="LMK 错误">
LMK 错误;报告给管理员。
<hex>13</hex>
</option>
<option cn="输入数据错">
<hex>15</hex>
</option>
<option cn="无效的密钥方案">
<hex>26</hex>
</option>
</options>
</error>
<lmkHead len="1" cn="lmk 头">
如果是 'X,U,S' lmk 32 个字节长
如果是 'Y,T' lmk 48 个字节长
</lmkHead>
<lmk :len="lmkLen()" cn="密钥LMK">
LMK 加密下的密钥。
</lmk>
<keyCheck :len="keyCheckLen()" cn="密钥校验值">
密钥校验值。当保护新密钥的密钥方案为 S 时,
输出 32H KCV 计算算法为 SM4否则输出
16HKCV 计算算法为 DES/3DES
</keyCheck>
<tailSep len="1" required="false" cn="尾分隔">
可选项。如果显示消息尾域,则该域必须显示。值为 “X19”。
<hex>19</hex>
</tailSep>
<tail maxLen="32" required="false" cn="尾部">
可选项。最大长度为 32个字符。
</tail>
</data>
</res>
<script>function Len() {
return Util.lenChoice($final.getSection('data').getSection('lmkHead').getValue() )
}
function lmkLen() {
if( $final.data.lmkHead.eqStr("Y") || $final.data.lmkHead.eqStr("T") ){
return 48
}else if( $final.data.lmkHead.eqStr("X") || $final.data.lmkHead.eqStr("U") ){
return 32
}
return 15
}
function keyCheckLen() {
if (Arrays.equals("S".getBytes(),
$final.getSection('data').getSection('lmkHead').getValue()
)) {
return 32
} else {
return 16
}
}
</script>
</packet>