CSharpTest.Net
IV Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > PasswordKey Class : IV Property

Glossary Item Box

Sets or Gets the IV used when deriving the encryption key

Syntax

Visual Basic (Declaration) 
Public Overridable Property IV As Byte()
C# 
public virtual byte[] IV {get; set;}

Example

Library/Library.Test/TestPassword.cs

C#Copy Code
using (PasswordKey key = new PasswordKey("bla"))
{
    Assert.AreEqual(AESCryptoKey.ProcessDefaultIV, key.IV);
    byte[] newIv = Guid.NewGuid().ToByteArray();
    key.IV = newIv;

    Assert.AreEqual(newIv, key.IV);
    Assert.AreEqual(newIv, key.CreateKey().IV);
}
VB.NETCopy Code
Using key As New PasswordKey("bla")
    Assert.AreEqual(AESCryptoKey.ProcessDefaultIV, key.IV)
    Dim newIv As Byte() = Guid.NewGuid().ToByteArray()
    key.IV = newIv

    Assert.AreEqual(newIv, key.IV)
    Assert.AreEqual(newIv, key.CreateKey().IV)
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys