写第一篇测试性文章,试试看效果
下面贴一段代码
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
try{
sb.append(this.sn);
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.modulus)));
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.pri_exp)));
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.pub_exp)));
}catch(Exception e){
e.printStackTrace();
sb = null;
}
if(sb == null){
return null;
}else{
return sb.toString();
}
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
try{
sb.append(this.sn);
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.modulus)));
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.pri_exp)));
sb.append(":");
sb.append(Hex.encodeHexString(stripLeadingZero(this.pub_exp)));
}catch(Exception e){
e.printStackTrace();
sb = null;
}
if(sb == null){
return null;
}else{
return sb.toString();
}
}