I have following class in TypeScript:
import {
AsnSerializer
} from '@peculiar/asn1-schema';
export class Element {
constructor(
public value: BigInteger
) {}
public ToASN1(): ArrayBuffer {
const element = new Element();
element.value = new Uint8Array(this.value.toByteArray()).buffer;
try {
return new Uint8Array(AsnSerializer.serialize(element));
} catch (error) {
// handle
}
}
And the toASN1
method returns ASN.1 output as:
output ::= SEQUENCE {
INTEGER
}
But I don’t want that outer SEQUENCE
to present and instead I only wish to have:
output ::= INTEGER
Is it achievable at all? I have found some links in the source code, but dunno is that indeed hardcoded into that library and therefore not changeable at all?