/// <summary> /// konstruktor /// </summary> /// <param name="name">nazwa użytkownika</param> public Node(string name) { this.name = name; readKeysFromFile(); if (_flagToGenerateKey == true) ECDSASigner = new ECDSASigner(); else ECDSASigner = new ECDSASigner(privateKey); privateKey = ECDSASigner.getPrivateKeyBase58(); publicKey = ECDSASigner.getPublicKeyBase58(); address = Base58CheckEncoding.EncodePlain(hashString.ComputeHash(Base58CheckEncoding.DecodePlain(publicKey))); if (_flagToGenerateKey == true) saveKeysAndAddressToFile(); }
/// <summary> /// metda generująca podpis /// </summary> /// <param name="dataToSign">dane do podpisu</param> /// <returns>podpis</returns> public string getSignature(byte[] dataToSign) { ECDSASigner = new ECDSASigner(privateKey); return ECDSASigner.getSignatureBase58(dataToSign); }