public static byte[] GeneratePublicKeySecp256k1(byte[] privateKey)
 {
     lock (ecdsaLock)
     {
         return(secp256k1.GetPublicKey(privateKey));
     }
 }
Exemple #2
0
 /// <summary>
 /// Recovers the <see cref="PublicKey"/> for a given <paramref name="privateKey"/>.
 /// </summary>
 /// <param name="privateKey">The private key.</param>
 /// <returns>The public key.</returns>
 public byte[] GetPublicKeyForPrivateKey(byte[] privateKey)
 {
     _algorithm = new Secp256k1();
     return(_algorithm.GetPublicKey(privateKey));
 }
Exemple #3
0
 /// <summary>
 /// Creates a new <see cref="Signer"/> and generates a <see cref="PrivateKey"/> and a <see cref="PublicKey"/>.
 /// </summary>
 public Signer()
 {
     PrivateKey = Secp256k1Manager.GenerateRandomKey();
     PublicKey  = _algorithm.GetPublicKey(PrivateKey);
 }