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

88 lines
2.5 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>SD</hex>
</command>
<data extend="data">
<storageType len="1" cn="存储类型">
<options>
<option cn="使用内部密钥">
<hex>0</hex>
</option>
<option cn="使用外部密钥">
<hex>1</hex>
</option>
</options>
</storageType>
<keyIndex len="27" :if="0 == $packet.data.storageType$option" cn="解密密钥索引">
内部密钥索引, 接口层对外限制8位通讯层限制27位16位机构号+3位密钥类型+8位密钥索引号。前19位补0
</keyIndex>
<algorithmKey len="2" cn="解密算法类型">
解密算法
支持算法RSA、SM2
取值参考数据字典
</algorithmKey>
<privateKeyLen len="4" :value="getPrivateKeyLen()" :if="1 == $packet.data.storageType$option" cn="解密私钥长度">
仅当密钥索引全0时存在此域
解密密钥长度
</privateKeyLen>
<privateKey :if="1 == $packet.data.storageType$option" cn="解密私钥">
仅当密钥索引全0时存在此域
解密的非对称密钥私钥密文
</privateKey>
<inputDataLen len="4" :value="getInputDataLen()" cn="数据长度">
待转加密的数据长度
</inputDataLen>
<inputData cn="数据">
待转加密的数据
</inputData>
</data>
</req>
<res>
<command>
<hex>SE</hex>
</command>
<data>
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
<options>
<option cn="无错误">
<hex>00</hex>
</option>
</options>
</error>
<keyCiphertextLen len="4" cn="密钥密文长度">
使用加密机主密钥加密的对称密钥长度
</keyCiphertextLen>
<keyCiphertext :len="getKeyCiphertextLen()" cn="密钥密文">
使用加密机主密钥加密的对称密钥
</keyCiphertext>
</data>
</res>
<script>
function getPrivateKeyLen(){
return $packet.data.privateKey.length;
}
function getInputDataLen(){
return $packet.data.inputData.length;
}
function getKeyCiphertextLen(){
return Util.a2i( $final.getSection('data').getSection('keyCiphertextLen') )
}
</script>
</packet>