Beispiel #1
0
 /// <summary>
 /// 根据指定的私钥和曲线参数来创建新的ECDsa对象,该对象可用于签名
 /// </summary>
 /// <param name="privateKey">私钥</param>
 /// <param name="curve">椭圆曲线参数</param>
 public ECDsa(byte[] privateKey, ECCurve curve)
     : this(curve.G * privateKey)
 {
     this.privateKey = privateKey;
 }
Beispiel #2
0
 /// <summary>
 /// 根据指定的公钥来创建新的ECDsa对象,该对象可用于验证签名
 /// </summary>
 /// <param name="publicKey">公钥</param>
 public ECDsa(ECPoint publicKey)
 {
     this.publicKey = publicKey;
     this.curve     = publicKey.Curve;
 }
Beispiel #3
0
 public static ECPoint Parse(string value, ECCurve curve)
 {
     return(DecodePoint(value.HexToBytes(), curve));
 }