public byte[] CalculateCommonSecret(NasECKey publicKey) { var agreement = new ECDHBasicAgreement(); agreement.Init(_ecKey.PrivateKey); var z = agreement.CalculateAgreement(publicKey._ecKey.GetPublicKeyParameters()); return(BigIntegers.AsUnsignedByteArray(agreement.GetFieldSize(), z)); }
public static string GetPublicAddress(string privateKey) { var key = new NasECKey(privateKey.HexToByteArray(), true); return(key.GetPublicAddress()); }