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

161 lines
5.0 KiB
XML
Raw Permalink 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>7B</hex>
</command>
<data extend="data">
<signatureDataType len="1" cn="签名数据类型">
<options>
<option cn="HASH">
<hex>0</hex>
</option>
<option cn="原数据">
<hex>1</hex>
</option>
</options>
</signatureDataType>
<hashMark len="1" cn="哈希标识">
指示用于哈希证书数据的哈希算法的标识
<options>
<option cn="SHA1">
<hex>0</hex>
</option>
<option cn="SHA256">
<hex>1</hex>
</option>
<option cn="MD5">
<hex>2</hex>
</option>
</options>
</hashMark>
<hashData :len="32" :if="0 == $packet.data.signatureDataType$option" cn="HASH 值">
可选项,只对“签名数据类型”为 0 时有效。
</hashData>
<dataLength len="4" :if="1 == $packet.data.signatureDataType$option" :value="dataLen()" cn="用于签名的信息数据的字节长度">
可选项,只对“签名数据类型”为 1 时有效。
</dataLength>
<infoData :if="1 == $packet.data.signatureDataType$option" cn="要签名的信息">
可选项,只对“签名数据类型”为 1 时有效。
</infoData>
<privateKeyTag len="27" cn="指示私钥位置的标记">
privateKeyTag len="27" cn="指示私钥位置的标记">
数字为存储私钥的索引,除了
全 9 表示使用由命令中提供的密钥。
27 位的索引号16 位机构号+3 位密钥类型+8 位密钥
索引号。
</privateKeyTag>
<privateKeyLength len="4" cn="加密密钥方案" :if="useLocalKey()" :value="privateKeyLen()">
可选项,当私钥标记为全 9 时显示此域
</privateKeyLength>
<privateKey cn="LMK34-35 下加密的私钥" :if="useLocalKey()">
可选项,当私钥标记为全 9 时显示此域
</privateKey>
<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>7C</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="输入数据错">
<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>
<signatureLen len="4" cn="签名的字节长度">
签名的字节长度
</signatureLen>
<signature :len="signatureLen()" cn="签名的 DER 编码">
签名的 DER 编码
</signature>
<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(new String($packet.data.privateKeyTag) ))
{
return true;
}else{
return false;
}
}
function publicKeyLen(){
var data = $packet.data;
return data.publicKey.length;
}
function dataLen(){
return $packet.data.infoData.length;
}
function privateKeyLen(){
var data = $packet.data;
return data.privateKey.length;
}
function signatureLen() {
return Util.a2i( $final.getSection('data').getSection('signatureLen') )
} </script>
</packet>