static String DecodeOctetString(Asn1Reader asn) { return(AsnFormatter.BinaryToString( asn.RawData, EncodingType.HexRaw, EncodingFormat.NOCRLF, asn.PayloadStartOffset, asn.PayloadLength)); }
static String DecodeInteger(Asn1Reader asn) { return(Asn1Integer.DecodeIntegerAsInteger ? new BigInteger(asn.GetPayload().Reverse().ToArray()).ToString() : AsnFormatter.BinaryToString( asn.RawData, EncodingType.HexRaw, EncodingFormat.NOCRLF, asn.PayloadStartOffset, asn.PayloadLength)); }
static String DecodeBitString(Asn1Reader asn) { return(String.Format( "Unused bits: {0} : {1}", asn.RawData[asn.PayloadStartOffset], AsnFormatter.BinaryToString( asn.RawData, EncodingType.HexRaw, EncodingFormat.NOCRLF, asn.PayloadStartOffset + 1, asn.PayloadLength - 1) )); }