150 lines
4.2 KiB
XML
150 lines
4.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
||
<packet extend="base">
|
||
<req>
|
||
|
||
<command>
|
||
<hex>6C</hex>
|
||
</command>
|
||
<data extend="data">
|
||
|
||
<certificateModel len="1" cn="证书模式">
|
||
<options>
|
||
<option cn="证书序号">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="证书 DN">
|
||
<hex>1</hex>
|
||
</option>
|
||
</options>
|
||
</certificateModel>
|
||
|
||
|
||
<certificateLen len="4" :value="certificateLen()" cn="证书内容长度">
|
||
根据证书模式,需要输入内容项的长度 n
|
||
</certificateLen>
|
||
|
||
|
||
<certificateSn :len="strlen()" :if="0 == $packet.data.certificateModel$option" cn="X509 证书序号">
|
||
可选项,只针对“证书模式”为 0时有。
|
||
</certificateSn>
|
||
|
||
<certificateDn :len="strlen()" :if="1 == $packet.data.certificateModel$option" cn="X509 证书的 subject">
|
||
可选项,只针对“证书模式”为 1时有。
|
||
</certificateDn>
|
||
|
||
<dataFlag len="1" cn="数据类型标记" :if="'P' == $packet.data.dataFlag">
|
||
可以没有,如果有一定是 ‘P’,表示后续值是 SM3HASH
|
||
</dataFlag>
|
||
|
||
<dataLen len="4" :value="inDataLen()" cn="数据长度">
|
||
数据长度
|
||
</dataLen>
|
||
|
||
<inData :len="getDataLen()" cn="签名数据">
|
||
签名数据内容
|
||
</inData>
|
||
|
||
|
||
<tailSep len="1" :if=" null != $packet.data.tail " cn="尾分隔">
|
||
可选项。如果显示消息尾域,则该域必须显示。值为
|
||
“X’19”。
|
||
<hex>19</hex>
|
||
</tailSep>
|
||
|
||
<tail maxLen="32" required="false" cn="尾部">
|
||
可选项。最大长度为 32个字符。
|
||
</tail>
|
||
</data>
|
||
|
||
|
||
|
||
</req>
|
||
<res>
|
||
|
||
<command>
|
||
<hex>6D</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>
|
||
|
||
<signLen len="4" cn="签名长度">
|
||
签名长度
|
||
</signLen>
|
||
|
||
<sign :len="signLen()" cn="签名">
|
||
数字签名(BASE64)
|
||
</sign>
|
||
|
||
<tailSep len="1" required="false" cn="尾分隔">
|
||
可选项。如果显示消息尾域,则该域必须显示。值为 “X’19”。
|
||
<hex>19</hex>
|
||
</tailSep>
|
||
|
||
<tail maxLen="32" required="false" cn="尾部">
|
||
可选项。最大长度为 32个字符。
|
||
</tail>
|
||
</data>
|
||
|
||
|
||
|
||
</res>
|
||
<script>
|
||
function certificateLen(){
|
||
var data = $packet.data;
|
||
if( 0 == data.certificateModel$option ){
|
||
return data.certificateSn.length()
|
||
}
|
||
if( 1 == data.certificateModel$option ){
|
||
return data.certificateDn.length()
|
||
}
|
||
}
|
||
|
||
function inDataLen() {
|
||
return $packet.data.inData.length
|
||
}
|
||
|
||
|
||
function getDataLen() {
|
||
return Util.a2i( $final.getSection('data').getSection('dataLen') )
|
||
}
|
||
function signLen() {
|
||
return Util.a2i( $final.getSection('data').getSection('signLen') );
|
||
|
||
} </script>
|
||
</packet>
|