GetInstance() public static method

public static GetInstance ( object obj ) : MetaData
obj object
return MetaData
Esempio n. 1
0
        private TimeStampedDataParser(Asn1SequenceParser parser)
        {
            this.parser  = parser;
            this.version = DerInteger.GetInstance(parser.ReadObject());

            Asn1Object obj = parser.ReadObject().ToAsn1Object();

            if (obj is DerIA5String)
            {
                this.dataUri = DerIA5String.GetInstance(obj);
                obj          = parser.ReadObject().ToAsn1Object();
            }

            if (//obj is MetaData ||
                obj is Asn1SequenceParser)
            {
                this.metaData = MetaData.GetInstance(obj.ToAsn1Object());
                obj           = parser.ReadObject().ToAsn1Object();
            }

            if (obj is Asn1OctetStringParser)
            {
                this.content = (Asn1OctetStringParser)obj;
            }
        }
Esempio n. 2
0
        private TimeStampedData(Asn1Sequence seq)
        {
            this.version = DerInteger.GetInstance(seq[0]);
            int index = 1;

            if (seq[index] is DerIA5String)
            {
                this.dataUri = DerIA5String.GetInstance(seq[index++]);
            }
            if (seq[index] is MetaData || seq[index] is Asn1Sequence)
            {
                this.metaData = MetaData.GetInstance(seq[index++]);
            }
            if (seq[index] is Asn1OctetString)
            {
                this.content = Asn1OctetString.GetInstance(seq[index++]);
            }
            this.temporalEvidence = Evidence.GetInstance(seq[index]);
        }
Esempio n. 3
0
        private TimeStampedDataParser(Asn1SequenceParser parser)
        {
            this.parser  = parser;
            this.version = DerInteger.GetInstance(parser.ReadObject());
            Asn1Object asn1Object = parser.ReadObject().ToAsn1Object();

            if (asn1Object is DerIA5String)
            {
                this.dataUri = DerIA5String.GetInstance(asn1Object);
                asn1Object   = parser.ReadObject().ToAsn1Object();
            }
            if (asn1Object is Asn1SequenceParser)
            {
                this.metaData = MetaData.GetInstance(asn1Object.ToAsn1Object());
                asn1Object    = parser.ReadObject().ToAsn1Object();
            }
            if (asn1Object is Asn1OctetStringParser)
            {
                this.content = (Asn1OctetStringParser)asn1Object;
            }
        }