示例#1
0
 static String DecodeOctetString(Asn1Reader asn)
 {
     return(AsnFormatter.BinaryToString(
                asn.RawData,
                EncodingType.HexRaw,
                EncodingFormat.NOCRLF, asn.PayloadStartOffset, asn.PayloadLength));
 }
示例#2
0
 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));
 }
示例#3
0
 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)
                ));
 }