我编写了这段代码来获取带有 ASN.1 生成类的 Int 和 String。它适用于整数,但我不明白如何将 IA5String 转换为字符串。
ServerFirstResponse response1 = new ServerFirstResponse();
ASN1Integer serverNumber= response1.serverInt;
int serverNumbervalue = (int)serverNumber.getValue();
IA5String serverString=response1.serverString;
String serverString = (String) serverString.getBytes();
这是 ASN 序列的描述
ServerFirstResponse ::= SEQUENCE {
serverInt INTEGER ,
serverString IA5String
}