public void HmacVerficationTest()
    {
        var key  = Encoding.UTF8.GetBytes("HMAC KEY");
        var data = Encoding.UTF8.GetBytes(testMessage);

        var hmac = new HmacAuthentication(key);
        var hash = hmac.ComputeHash(data);

        var isValid = hmac.VerifyHash(hash, data);

        Assert.True(isValid);
    }
    public void RsaSigningTest()
    {
        var     rsa  = new RsaEncryption();
        RsaKeys keys = rsa.GenerateKeys();

        var hmacKey = Encoding.UTF8.GetBytes("HMAC KEY");
        var hmac    = new HmacAuthentication(hmacKey);

        var data = Encoding.UTF8.GetBytes(testMessage);
        var hash = hmac.ComputeHash(data);

        var signature = rsa.SignData(hash, keys.privateKey);
        var isValid   = rsa.VerifySignature(hash, signature, keys.publicKey);

        Assert.True(isValid);
    }