public void DecryptionTest() { Option option = new Option(new MultiLanguageString("Test"), new MultiLanguageString(string.Empty), new MultiLanguageString(string.Empty)); Encrypted<Option> encryptedOption = new Encrypted<Option>(option, this.admin.OnlyPublicPart); Option other = encryptedOption.Decrypt(this.admin); Assert.IsTrue(other.ToBinary().Equal(option.ToBinary())); }
public void SecureDecryptionTest() { Option option = new Option(new MultiLanguageString("Test"), new MultiLanguageString(string.Empty), new MultiLanguageString(string.Empty)); Secure<Option> encryptedOption = new Secure<Option>(option, this.admin.OnlyPublicPart, this.admin); Assert.IsTrue(encryptedOption.Verify(this.storage)); Option other = encryptedOption.Value.Decrypt(this.admin); Assert.IsTrue(other.ToBinary().Equal(option.ToBinary())); }
public void SignedVerifyTest() { Option option = new Option(new MultiLanguageString("Test"), new MultiLanguageString(string.Empty), new MultiLanguageString(string.Empty)); Signed<Option> signed = new Signed<Option>(option, this.admin); Assert.IsTrue(signed.VerifySimple()); Assert.IsTrue(signed.Verify(this.storage)); Assert.IsTrue(signed.Value.ToBinary().Equal(option.ToBinary())); }