コード例 #1
0
        public KeyParameters(Asn1Sequence seq)
        {
            Attributes = seq?.OfType <DerBitString>().FirstOrDefault();
            Algorithm  = seq?.OfType <Asn1TaggedObject>()
                         .Where(x => x.TagNo == 0)
                         .Select(x => AlgorithmIdentifier.GetInstance(x, false))
                         .FirstOrDefault();

            if (Algorithm == null)
            {
                throw new CryptographicException("Ошибка в данных параметров ключа.");
            }
        }