Exemplo n.º 1
0
 /// <summary>
 /// Convert a base64 string to a GroupElement using a specific Group object.
 /// </summary>
 /// <param name="encodedString">The encoded string to convert.</param>
 /// <param name="group">The group object to use.</param>
 /// <returns>The converted object.</returns>
 public static GroupElement ToGroupElement(this String encodedString, Group group)
 {
     if (encodedString == null)
     {
         return(null);
     }
     if (group == null)
     {
         throw new ArgumentNullException("group");
     }
     return(group.CreateGroupElement(encodedString.ToByteArray()));
 }
 public static GroupElement CreateGroupElement(Group Gq, string value)
 {
     if (Gq is SubgroupGroup)
     {
         return Gq.CreateGroupElement(HexToBytes(value));
     }
     else
     {
         ECGroup ecGq = Gq as ECGroup;
         string[] point = value.Split(',');
         return ecGq.CreateGroupElement(HexToBytes(point[0]), HexToBytes(point[1]));
     }
 }
 /// <summary>
 /// Convert a base64 string to a GroupElement using a specific Group object.
 /// </summary>
 /// <param name="encodedString">The encoded string to convert.</param>
 /// <param name="group">The group object to use.</param>
 /// <returns>The converted object.</returns>
 public static GroupElement ToGroupElement(this String encodedString, Group group)
 {
     if (encodedString == null) return null;
     if (group == null) throw new ArgumentNullException("group");
     return group.CreateGroupElement(encodedString.ToByteArray());
 }