Пример #1
0
        public static long DecodeDateTime(Byte[] rawData)
        {
            Asn1Data asn1Data = Asn1Parser.ParseFromRawData(rawData);

            switch (asn1Data.Tag)
            {
            case (Byte)Asn1Type.UTCTime: return(Asn1UtcTimeParser.Decode(rawData));

            case (Byte)Asn1Type.Generalizedtime: return(DecodeGeneralizedTime(rawData));

            default:
            {
                return(-1);
            }
            }
        }
Пример #2
0
        public static byte[] DecodeDateTime(Asn1Data asn1Data)
        {
            switch (asn1Data.Tag)
            {
            case (Byte)Asn1Type.UTCTime:
                return(Asn1UtcTimeParser.Decode(asn1Data));

            case (Byte)Asn1Type.Generalizedtime:
                return(Asn1GeneralizedTimeParser.Decode(asn1Data));

            default:
            {
                //todo: Handle exceptions
                return(null);
            }
            }
        }