CSharpTest.Net
SaltedData Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace : SaltedData Class

Glossary Item Box

Represents the combination of Salt and Data together

Object Model

SaltedData ClassSalt Class

Syntax

Visual Basic (Declaration) 
Public Class SaltedData 
C# 
public class SaltedData 

Example

Library/Library.Test/TestSalt.cs

C#Copy Code
Salt s = new Salt(Salt.Size.b64);
byte[] testData = new byte[8];

byte[] test1 = new SaltedData(s, testData).ToArray();
Assert.AreEqual(16, test1.Length);
byte[] test2 = IOStream.ReadAllBytes(new SaltedData(s, testData).ToStream());
Assert.AreEqual(16, test2.Length);
byte[] test3 = IOStream.ReadAllBytes(SaltedData.CombineStream(s, new MemoryStream(testData)));
Assert.AreEqual(16, test3.Length);

Assert.AreEqual(test1, test2);
Assert.AreEqual(test1, test3);
Assert.AreEqual(test2, test3);
VB.NETCopy Code
Dim s As New Salt(Salt.Size.b64)
Dim testData As Byte() = New Byte(8) {}

Dim test1 As Byte() = New SaltedData(s, testData).ToArray()
Assert.AreEqual(16, test1.Length)
Dim test2 As Byte() = IOStream.ReadAllBytes(New SaltedData(s, testData).ToStream())
Assert.AreEqual(16, test2.Length)
Dim test3 As Byte() = IOStream.ReadAllBytes(SaltedData.CombineStream(s, New MemoryStream(testData)))
Assert.AreEqual(16, test3.Length)

Assert.AreEqual(test1, test2)
Assert.AreEqual(test1, test3)
Assert.AreEqual(test2, test3)

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Crypto.SaltedData

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys