122 lines
3.1 KiB
XML
122 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
||
<packet extend="base">
|
||
<req>
|
||
|
||
<command>
|
||
<hex>77</hex>
|
||
</command>
|
||
<data extend="data">
|
||
|
||
<AlgorithmKey len="1" cn="算法标识">
|
||
<options>
|
||
<option cn="RSA">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="SM2">
|
||
<hex>1</hex>
|
||
</option>
|
||
</options>
|
||
</AlgorithmKey>
|
||
|
||
<fillKey len="1" cn="填充标识" :if="0 == $packet.data.AlgorithmKey$option">
|
||
<options>
|
||
<option cn="数据长度必须等于密钥长度">
|
||
<hex>0</hex>
|
||
</option>
|
||
<option cn="PKCS#1 v1.5 填充方式">
|
||
<hex>1</hex>
|
||
</option>
|
||
</options>
|
||
</fillKey>
|
||
|
||
<publicKeyLength len="4" :value="publicKeyLen()" cn="公钥的长度(DER)">
|
||
公钥的长度(DER)
|
||
</publicKeyLength>
|
||
|
||
<publicKey cn="公钥的 DER 编码">
|
||
公钥的 DER 编码
|
||
</publicKey>
|
||
|
||
<dataLength len="4" :value="dataLen()" cn="数据长度">
|
||
数据长度
|
||
</dataLength>
|
||
|
||
<infoData cn="数据">
|
||
数据
|
||
</infoData>
|
||
|
||
</data>
|
||
|
||
|
||
|
||
</req>
|
||
<res>
|
||
|
||
<command>
|
||
<hex>78</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>
|
||
|
||
<dataLen len="4" cn="公钥加密的密文长度">
|
||
公钥加密的密文长度
|
||
</dataLen>
|
||
|
||
<cipherData :len="cipherLen()" cn="公钥加密的密文的 DER 编码">
|
||
公钥加密的密文的 DER 编码(对于 RSA 算法,数据类
|
||
型为 BIT).
|
||
</cipherData>
|
||
|
||
</data>
|
||
|
||
|
||
|
||
</res>
|
||
<script>
|
||
function dataLen(){
|
||
var data = $packet.data;
|
||
return data.infoData.length;
|
||
}
|
||
|
||
function publicKeyLen(){
|
||
var data = $packet.data;
|
||
return data.publicKey.length;
|
||
}
|
||
|
||
function cipherLen(){
|
||
return Util.a2i( $final.getSection('data').getSection('dataLen') )
|
||
}
|
||
</script>
|
||
</packet>
|