示例#1
0
        public AlgorithmIdentifierAsn1Net(byte[] content)
        {
            BerReader    reader = new BerReader(new MemoryStream(content));
            Asn1Sequence seq;

            reader.ReadOne <Asn1Sequence>(out seq);

            Algorithm  = seq.Content.First() as Asn1ObjectIdentifier;
            Parameters = (seq.Content.Count == 2) ? seq.Content[1] : null;
        }
示例#2
0
        public AlgorithmIdentifierAsn1Net(Asn1ObjectIdentifier algorithm, Asn1ObjectBase parameters)
        {
            if (algorithm == null)
            {
                throw new ArgumentNullException("algorithm");
            }

            Algorithm  = algorithm;
            Parameters = parameters;
        }
示例#3
0
        public AlgorithmIdentifierAsn1Net(Asn1Sequence seq)
        {
            if (seq == null)
            {
                throw new ArgumentNullException("seq");
            }

            if (seq.Content.Count < 1 || seq.Content.Count > 2)
            {
                throw new ArgumentException("Invalid number of sequence members");
            }

            Algorithm  = seq.Content.First() as Asn1ObjectIdentifier;
            Parameters = (seq.Content.Count == 2) ? seq.Content[1] : null;
        }