public override void Decode(Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
        {
            var tag = new Asn1Tag();
            buffer.Mark();

            var num = buffer.DecodeTagAndLength(tag);

            if (tag.Equals(0, 0, NullTypeCode))
            {
                buffer.Reset();
                var element = new NullParams();

                SetElement(Null, element);
                Element.Decode(buffer, true, num);
            }
            else
            {
                if (!tag.Equals(0, 0x20, SequenceTypeCode))
                {
                    throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidChoiceOptionTagException, tag, buffer.ByteCount);
                }

                buffer.Reset();
                var parameters = new GostR34102001PublicKeyParameters();

                SetElement(Params, parameters);
                Element.Decode(buffer, true, num);
            }
        }
        public override void Decode(Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
        {
            var tag = new Asn1Tag();

            buffer.Mark();

            var num = buffer.DecodeTagAndLength(tag);

            if (tag.Equals(0, 0, NullTypeCode))
            {
                buffer.Reset();
                var element = new NullParams();

                SetElement(Null, element);
                Element.Decode(buffer, true, num);
            }
            else
            {
                if (!tag.Equals(0, 0x20, SequenceTypeCode))
                {
                    throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidChoiceOptionTagException, tag, buffer.ByteCount);
                }

                buffer.Reset();
                var parameters = new GostR341094PublicKeyParameters();

                SetElement(Params, parameters);
                Element.Decode(buffer, true, num);
            }
        }
Exemplo n.º 3
0
        public void Equivalent_ReturnsFalse_ForNullCollections(NullParams @params)
        {
            var first  = @params == NullParams.First || @params == NullParams.Both ? null : _one;
            var second = @params == NullParams.Second || @params == NullParams.Both ? null : _one;

            Assert.False(first.Equivalent(second));
        }
Exemplo n.º 4
0
        public void ArraysEqual_ReturnsNull_ForNullArrays(NullParams @params)
        {
            var first  = @params == NullParams.First || @params == NullParams.Both ? null : _one.ToArray();
            var second = @params == NullParams.Second || @params == NullParams.Both ? null : _one.ToArray();

            Assert.False(first.ArraysEqual(second));
        }
Exemplo n.º 5
0
 public FlatComponentVisitor(NullParams @params) : base(@params)
 {
 }
Exemplo n.º 6
0
 public RemoveConditionVisitor(NullParams @params) : base(@params)
 {
 }