So, I'm trying to decode asn1 sequence.
...
public clas Main {
public static void main(String[] args) throws IOException {
var data = "some hex string";
byte [] binaryData;
binaryData = HexFormat.of().parseHex(data);
ASN1InputStream decoder = new ASN1InputStream(binaryData);
DLSequence seq = (DLSequence) decoder.readObject();
System.out.println(ASN1Dump.dumpAsString(seq));
}
}
It represents the structure just fine, basically I'm dealing with sequences of Integers like:
Sequence
Tagged [CONTEXT 0] IMPLICIT
Sequence
Integer(250)
Integer(450)
The question is that I've got not a slightest idea of how to access the actual integers instead of just printing them. Like no idea. BouncyCastle's documentation seems rather scarse, so I can't really undesrtand what to do. My goal is to get these values into, say, an array, so it would be convenient for future use.