sydapi/DProto/S7.xml
2021-08-12 10:47:32 +08:00

89 lines
2.3 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>S7</hex>
</command>
<data extend="data">
<storageType len="1" cn="存储类型">
<options>
<option cn="使用内部密钥">
<hex>0</hex>
</option>
<option cn="使用外部密钥">
<hex>1</hex>
</option>
</options>
</storageType>
<algorithmKey len="2" cn="算法类型">
仅支持RSA、SM2
</algorithmKey>
<publicKeyLen len="4" :value="getPublicKeyLen()" :if="1 == $packet.data.storageType$option" cn="公钥长度">
仅当存储类型为1时有效
公钥长度
</publicKeyLen>
<publicKey :if="1 == $packet.data.storageType$option" cn="公钥">
仅当存储类型为1时有效
公钥
</publicKey>
<keyIndex len="27" :if="0 == $packet.data.storageType$option" cn="密钥索引">
内部密钥索引, 接口层对外限制8位通讯层限制27位16位机构号+3位密钥类型+8位密钥索引号。前19位补0
注意后八位密钥索引不允许输入全0
</keyIndex>
<inputDataLen len="4" :value="inputDataLen()" cn="数据长度">
数据长度
</inputDataLen>
<inputData cn="数据">
数据
</inputData>
</data>
</req>
<res>
<command>
<hex>S8</hex>
</command>
<data>
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
<options>
<option cn="无错误">
<hex>00</hex>
</option>
</options>
</error>
<cipherLen len="4" cn="密文长度">
密文长度
</cipherLen>
<cipher :len="getCipherLen()" cn="密文">
密文
</cipher>
</data>
</res>
<script>
function getPublicKeyLen() {
return $packet.data.publicKey.length;
}
function inputDataLen(){
var data = $packet.data;
return data.inputData.length;
}
function getCipherLen(){
return Util.a2i( $final.getSection('data').getSection('cipherLen') )
}
</script>
</packet>