internal void OnDeserialized()

in UProveCrypto/IssuerParameters.cs [386:437]


        internal void OnDeserialized(StreamingContext context)
        {
            if (_uidp == null)
                throw new UProveSerializationException("uidp");
            if (_group == null)
                throw new UProveSerializationException("descGq");
            if (_uidh == null)
                throw new UProveSerializationException("uidh");
            if (_g == null)
                throw new UProveSerializationException("g");

            this.UidP = _uidp.ToByteArray();
            this.Gq = _group.ToGroup();
            this.UidH = _uidh;

            this.Gd = _gd.ToGroupElement(this.Gq);
            this.E = (_e == null) ? new byte[] { } : _e.ToByteArray();
            this.S = _s.ToByteArray();
            this.digest = new byte[2][];

            ParameterSet defaultParamSet;
            if (ParameterSet.TryGetNamedParameterSet(this.Gq.GroupName, out defaultParamSet)) // named
            {
                if ((_g.Length == 1)) // only have g0
                {
                    ProtocolHelper.GenerateIssuerParametersCryptoData(this, defaultParamSet.G, false);
                    this.G[0] = _g.ToGroupElementArray(this.Gq)[0];
                    this.UsesRecommendedParameters = true;
                }
                else if (_g.Length == E.Length + 2) // we got all the G elements
                {
                    this.G = _g.ToGroupElementArray(this.Gq);
                }
                else
                {
                    throw new UProveSerializationException("Invalid number of elements in G");
                }
                if (this.gd == null)
                {
                    // named group always support devices
                    this.Gd = defaultParamSet.Gd;
                }
            }
            else  // custom - use all provided elements of G
            {
                if (_g.Length != E.Length + 2)
                {
                    throw new UProveSerializationException("Invalid number of elements in G");
                }
                this.G = _g.ToGroupElementArray(this.Gq);
            }
        }