Пример #1
0
        internal void OnDeserialized(StreamingContext context)
        {
            // reuse the serializable class's method to deserialize the group
            SubgroupGroup sg =
                this.SubgroupGroupSerializable.ToSubgroupGroup();

            this.P                   = sg.P;
            this.Q                   = sg.Q;
            this.G                   = sg.G;
            this.GroupName           = sg.GroupName;
            this.DomainParameterSeed = sg.DomainParameterSeed;
        }
        /// <summary>
        /// Create a SubgrouGroupSerializable object from a SubgroupGroup.
        /// </summary>
        /// <param name="group">The group to serialize.</param>
        public SubgroupGroupSerializable(SubgroupGroup group)
        {
            if (group.P == null || group.Q == null || group.G == null)
            {
                throw new UProveSerializationException("P, Q, G cannot be null");
            }

            this.p = group.P.ToBase64String();
            this.q = group.Q.ToBase64String();
            this.g = group.G.ToBase64String();
        }