public void GetDecryptionIV_TripleDesUri() { XmlDecryption ex = new XmlDecryption(); EncryptedData encryptedData = new EncryptedData(); encryptedData.CipherData = new CipherData(new byte[16]); Assert.Equal(8, ex.GetDecryptionIV(encryptedData, NS.XmlEncTripleDESUrl).Length); }
public void GetDecryptionIV_StringNull() { XmlDecryption ex = new XmlDecryption(); EncryptedData encryptedData = new EncryptedData(); encryptedData.EncryptionMethod = new EncryptionMethod(NS.XmlEncAES256Url); encryptedData.CipherData = new CipherData(new byte[16]); Assert.Equal(new byte[16], ex.GetDecryptionIV(encryptedData, NS.None)); }
public void GetDecryptionIV_InvalidAlgorithmUri() { XmlDecryption ex = new XmlDecryption(); EncryptedData encryptedData = new EncryptedData(); encryptedData.CipherData = new CipherData(new byte[16]); Assert.Throws <System.Security.Cryptography.CryptographicException>(() => ex.GetDecryptionIV(encryptedData, NS.Invalid)); }
public void GetDecryptionIV_StringNullWithoutEncryptionMethod() { XmlDecryption ex = new XmlDecryption(); EncryptedData encryptedData = new EncryptedData(); encryptedData.CipherData = new CipherData(new byte[16]); Assert.Throws <System.Security.Cryptography.CryptographicException>(() => ex.GetDecryptionIV(encryptedData, NS.None)); }
public void GetDecryptionIV_EncryptedDataNull() { XmlDecryption ex = new XmlDecryption(); Assert.Throws <ArgumentNullException>(() => ex.GetDecryptionIV(null, NS.XmlEncAES128Url)); }