129 lines
3.6 KiB
XML
129 lines
3.6 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
||
<packet extend="base">
|
||
<req>
|
||
|
||
<command>
|
||
<bin>8003</bin>
|
||
</command>
|
||
<data extend="data">
|
||
<signatureDataType len="1" cn="获取公私钥标记位">
|
||
<options>
|
||
<option cn="索引方式">
|
||
<bin>00</bin>
|
||
</option>
|
||
<option cn="DN 方式">
|
||
<bin>01</bin>
|
||
</option>
|
||
</options>
|
||
</signatureDataType>
|
||
|
||
<DN cn="DN 或 DN索引">
|
||
若上面的标志为1,则此域为证书DN,若为0,则此域为两个字节的证书索引;
|
||
</DN>
|
||
|
||
<dataLength len="2" :value="dataLen()" cn="待签名数据长度">
|
||
待签名数据长度
|
||
</dataLength>
|
||
|
||
<signData cn="待签名数据">
|
||
待签名数据
|
||
</signData>
|
||
|
||
</data>
|
||
|
||
|
||
|
||
</req>
|
||
<res>
|
||
|
||
<command>
|
||
<bin>8004</bin>
|
||
</command>
|
||
<data>
|
||
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
|
||
<options>
|
||
<option cn="无错误">
|
||
<hex>00</hex>
|
||
</option>
|
||
<option cn="无效的私钥类型">
|
||
<hex>03</hex>
|
||
</option>
|
||
<option cn="无效私钥标记">
|
||
<hex>04</hex>
|
||
</option>
|
||
<option cn="无效的哈希标识">
|
||
<hex>05</hex>
|
||
</option>
|
||
<option cn="无效的签名标识">
|
||
<hex>06</hex>
|
||
</option>
|
||
<option cn="无效的附加标识">
|
||
<hex>07</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>49</hex>
|
||
</option>
|
||
<option cn="无效摘要信息语法(仅仅无哈希模式)">
|
||
<hex>74</hex>
|
||
</option>
|
||
<option cn="公钥长度错误">
|
||
<hex>76</hex>
|
||
</option>
|
||
<option cn="私钥长度错误">
|
||
<hex>78</hex>
|
||
</option>
|
||
<option cn="输入数据长度错误">
|
||
<hex>80</hex>
|
||
</option>
|
||
</options>
|
||
</error>
|
||
|
||
<signatureLen len="2" cn="签名的字节长度">
|
||
签名的字节长度
|
||
</signatureLen>
|
||
|
||
<signature :len="signatureLen()" cn="签名的 DER 编码">
|
||
签名的 DER 编码
|
||
</signature>
|
||
|
||
<tailSep len="1" required="false" cn="尾分隔">
|
||
可选项。如果显示消息尾域,则该域必须显示。值为 “X’19”。
|
||
<hex>19</hex>
|
||
</tailSep>
|
||
|
||
<tail maxLen="32" required="false" cn="尾部">
|
||
可选项。最大长度为 32个字符。
|
||
</tail>
|
||
</data>
|
||
|
||
|
||
|
||
</res>
|
||
<script type="javascript"><![CDATA[
|
||
function dataLen(){
|
||
def len = $packet.data.signData.length
|
||
def ret = new byte[2]
|
||
ret[0] = (byte)(len >> 8 & 0xFF)
|
||
ret[1] = (byte)(len & 0xFF)
|
||
return ret;
|
||
}
|
||
|
||
function signatureLen() {
|
||
return Util.b2i( $final.data.signatureLen )
|
||
}
|
||
|
||
]]> </script>
|
||
</packet>
|