error handle to all: EncoderException

This commit is contained in:
free will committed 2021-03-18 11:22:49 +08:00
1 parent 5fc080ca6c
commit 8cf6ed24c9
34 files changed
+700 -233

No files matched your search

+4 -4
View File
@@ -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;