示例#1
0
        private LdsSecurityObject(
            Asn1Sequence seq)
        {
            if (seq == null || seq.Count == 0)
            {
                throw new ArgumentException("null or empty sequence passed.");
            }

            IEnumerator e = seq.GetEnumerator();

            // version
            e.MoveNext();
            version = DerInteger.GetInstance(e.Current);
            // digestAlgorithmIdentifier
            e.MoveNext();
            digestAlgorithmIdentifier = AlgorithmIdentifier.GetInstance(e.Current);

            e.MoveNext();
            Asn1Sequence datagroupHashSeq = Asn1Sequence.GetInstance(e.Current);

            if (version.Value.Equals(BigInteger.One))
            {
                e.MoveNext();
                versionInfo = LdsVersionInfo.GetInstance(e.Current);
            }

            CheckDatagroupHashSeqSize(datagroupHashSeq.Count);

            datagroupHash = new DataGroupHash[datagroupHashSeq.Count];
            for (int i = 0; i < datagroupHashSeq.Count; i++)
            {
                datagroupHash[i] = DataGroupHash.GetInstance(datagroupHashSeq[i]);
            }
        }
示例#2
0
        public LdsSecurityObject(
            AlgorithmIdentifier digestAlgorithmIdentifier,
            DataGroupHash[]         datagroupHash,
            LdsVersionInfo versionInfo)
        {
            this.version = new DerInteger(1);
            this.digestAlgorithmIdentifier = digestAlgorithmIdentifier;
            this.datagroupHash             = datagroupHash;
            this.versionInfo = versionInfo;

            CheckDatagroupHashSeqSize(datagroupHash.Length);
        }