Beispiel #1
0
        public void Verify()
        {
            string publicKey = "N1X+Fv7soLknpZNtkdW5cRphgzFjqHmOJl9GvVahWxk=";
            string message   = Sha3Util.Sha3_256("test");
            string signature = "bl7EyGwrdDIcHpizHUcDd4Ui34pQRv5VoM69WEPGNveZVOIXJbX3nWhvBvyGXaCxZIuu0THCo5g8PSr2NZJKBg==";

            bool result = Iroha.Verify(publicKey, signature, message);

            Assert.AreEqual(true, result);
        }
Beispiel #2
0
        public void VerifyWithCreateKeyPair()
        {
            KeyPair keyPair = Iroha.CreateKeyPair();
            string  message = "Iroha .NET";

            string signature = Iroha.Sign(keyPair, message);
            bool   result    = Iroha.Verify(keyPair.PublicKey, signature, message);

            Assert.AreEqual(true, result);
        }
Beispiel #3
0
        public void Sign()
        {
            string  publicKey  = "N1X+Fv7soLknpZNtkdW5cRphgzFjqHmOJl9GvVahWxk=";
            string  privateKey = "aFJfbcedA7p6X0b6EdQNovfFtmq4YSGK/+Bw+XBrsnAEBpXRu+Qfw0559lgLwF2QusChGiDEkLAxPqodQH1kbA==";
            KeyPair keyPair    = new KeyPair(privateKey, publicKey);
            string  message    = Sha3Util.Sha3_256("test");
            string  signature  = "bl7EyGwrdDIcHpizHUcDd4Ui34pQRv5VoM69WEPGNveZVOIXJbX3nWhvBvyGXaCxZIuu0THCo5g8PSr2NZJKBg==";

            string result = Iroha.Sign(keyPair, message);

            Assert.AreEqual(signature, result);
        }