public void DecryptShouldUseCertificateToDecryptDocument() { var adapter = new X509EncryptedXmlAdapter(_doc, _privateCert); adapter.DecryptDocument(); var decryptedElement = _doc.SelectSingleNode("Test/EncryptedElement/Element"); Assert.NotNull(decryptedElement); Assert.Equal("You should not see this text", decryptedElement.InnerText.Trim()); }
public void DecryptShouldThrowExceptionIfKeyDataIsNull() { var adapter = new X509EncryptedXmlAdapter(_doc, _privateCert); Assert.Throws <ArgumentNullException>(() => adapter.DecryptEncryptedKey(null)); }
public void ConstructorCreatesAdapterIfCertificateHasPrivateKey() { var adapter = new X509EncryptedXmlAdapter(_doc, _privateCert); Assert.NotNull(adapter); }
public void ConstructorDoesntThrowExceptionIfCertificateIsNull() { var adapter = new X509EncryptedXmlAdapter(_doc, null); Assert.NotNull(adapter); }