151 lines
4.3 KiB
XML
151 lines
4.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
||
<packet extend="base">
|
||
<req>
|
||
|
||
<command>
|
||
<hex>MA</hex>
|
||
</command>
|
||
<data extend="data">
|
||
|
||
<businessKey len="1" cn="业务标识" required="false">
|
||
取值 P(可选)当选定此标识时,表示密钥加密方案采用默认方式
|
||
</businessKey>
|
||
|
||
<alg len="1" cn="算法">
|
||
<options>
|
||
<option cn="DES">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="3DES">
|
||
<hex>1</hex>
|
||
</option>
|
||
<option cn="SM4">
|
||
<hex>2</hex>
|
||
</option>
|
||
<option cn="AES">
|
||
<hex>3</hex>
|
||
</option>
|
||
<option cn="IDEA">
|
||
<hex>4</hex>
|
||
</option>
|
||
<option cn="SM1">
|
||
<hex>5</hex>
|
||
</option>
|
||
<option cn="3DESX919">
|
||
<hex>6</hex>
|
||
</option>
|
||
</options>
|
||
</alg>
|
||
|
||
<keyType len="1" cn="密钥类型">
|
||
<options>
|
||
<option cn="TAK">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="ZAK">
|
||
<hex>1</hex>
|
||
</option>
|
||
</options>
|
||
</keyType>
|
||
|
||
<fullMode len="1" cn="填充类型">
|
||
<options>
|
||
<option cn="弱填充">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="强填充">
|
||
<hex>1</hex>
|
||
</option>
|
||
</options>
|
||
</fullMode>
|
||
|
||
|
||
<MACLen len="1" cn="MAC数据长度">
|
||
<options>
|
||
<option cn="4">
|
||
<hex>1</hex>
|
||
</option>
|
||
<option cn="8">
|
||
<hex>2</hex>
|
||
</option>
|
||
<option cn="16">
|
||
<hex>3</hex>
|
||
</option>
|
||
</options>
|
||
</MACLen>
|
||
|
||
|
||
<key cn="密钥">
|
||
|
||
</key>
|
||
|
||
<MACData maxLen="1024" cn="MAC数据">
|
||
生成MAC的数据,n=1024
|
||
注:数据长度应该为8的整数倍,如果不是8的整数倍,系统默认在数据后面填充0x00组成8的整数倍。
|
||
|
||
</MACData>
|
||
|
||
</data>
|
||
|
||
|
||
|
||
</req>
|
||
<res>
|
||
|
||
<command>
|
||
<hex>MB</hex>
|
||
</command>
|
||
<data>
|
||
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
|
||
<options>
|
||
<option cn="无错误">
|
||
<hex>00</hex>
|
||
</option>
|
||
<option cn="TAK奇偶校验错">
|
||
<hex>10</hex>
|
||
</option>
|
||
<option cn="用户存储区没有装载密钥">
|
||
<hex>12</hex>
|
||
</option>
|
||
<option cn="LMK错误;报告给管理员">
|
||
<hex>13</hex>
|
||
</option>
|
||
<option cn="输入数据错">
|
||
<hex>15</hex>
|
||
</option>
|
||
<option cn="无效的用户存储索引">
|
||
<hex>21</hex>
|
||
</option>
|
||
<option cn="密钥方案错误">
|
||
<hex>26</hex>
|
||
</option>
|
||
<option cn="输入数据长度错误">
|
||
<hex>80</hex>
|
||
</option>
|
||
</options>
|
||
</error>
|
||
|
||
<MAC cn="MAC数据" :len="retMacLen()">
|
||
所计算出的MAC。有MAC返回标识决定,默认8H
|
||
</MAC>
|
||
</data>
|
||
|
||
|
||
|
||
</res>
|
||
<script>
|
||
|
||
function retMacLen(){
|
||
|
||
if( 0 == $packet.data.MACLen$option ) {
|
||
return 8;
|
||
} else if ( 1 == $packet.data.MACLen$option ) {
|
||
return 16;
|
||
} else if ( 2 == $packet.data.MACLen$option ) {
|
||
return 32;
|
||
}
|
||
}
|
||
|
||
</script>
|
||
</packet>
|