mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
error handle to all: EncoderException
This commit is contained in:
1 parent
5fc080ca6c
commit
8cf6ed24c9
34 files changed
+700
-233
No files matched your search
@@ -100,27 +100,27 @@ public class SignatureInfo implements TlvComponentBase, IEncodingAble {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int wireEncode(Encoder encoder) {
|
||||
public int wireEncode(Encoder encoder) throws EncoderException {
|
||||
int totalLength=0;
|
||||
// 编码 TLV-VALUE
|
||||
if(!this.keyLocator.isValid()){
|
||||
// KeyLocator 是可选的,如果当前 SignatureInfo 对象有一个有效的 KeyLocator,则对其进行编码
|
||||
int tmplen=this.keyLocator.wireEncode(encoder);
|
||||
if(tmplen<=0){
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmplen;
|
||||
}
|
||||
int tmplen=this.signatureType.wireEncode(encoder);
|
||||
if(tmplen<=0){
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmplen;
|
||||
|
||||
// 编码 TLV-LENGTH
|
||||
tmplen=encoder.prependVarNumber(new VlInt(totalLength));
|
||||
if(tmplen<=0){
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmplen;
|
||||
|
||||
|
||||
Reference in new issue
Block a user