public void TestEncryptAndDecrypt() { Assert.Null(token.Signature); _tCS.Sign(token, _account.GetPrivateKeyAsByteArray()); string cipherData = _tCS.Encrypt(token, _account2.GetPublicKeyAsByteArray(), _account.GetPrivateKeyAsByteArray()); Assert.AreNotEqual(null, cipherData); string decryptedData = _tCS.Decrypt(cipherData, _account2.GetPrivateKeyAsByteArray()); Assert.AreNotEqual(cipherData, decryptedData); string[] splittedDecryptedData = decryptedData.Split(':'); splittedDecryptedData = splittedDecryptedData[1].Split('.'); Assert.AreEqual(token.GetEncodedHeader(), splittedDecryptedData[0]); Assert.AreEqual(token.GetEncodedPayload(), splittedDecryptedData[1]); }