CSharpTest.Net
PasswordKey Constructor(String)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > PasswordKey Class > PasswordKey Constructor : PasswordKey Constructor(String)

data

Glossary Item Box

Creates the password from the given password

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal data As String _
)
C# 
public PasswordKey( 
   string data
)

Parameters

data

Example

Library/Library.Test/TestPassword.cs

C#Copy Code
byte[] bytes;
byte[] svalue = Encoding.ASCII.GetBytes("some text value");

using (PasswordKey pk = new PasswordKey(TEST_PASSWORD))
    bytes = pk.Encrypt(svalue);

using (PasswordKey pk = new PasswordKey(TEST_PASSWORD))
    bytes = pk.Decrypt(bytes);

Assert.AreEqual(svalue, bytes);
VB.NETCopy Code
Dim bytes As Byte()
Dim svalue As Byte() = Encoding.ASCII.GetBytes("some text value")

Using pk As New PasswordKey(TEST_PASSWORD)
    bytes = pk.Encrypt(svalue)
End Using

Using pk As New PasswordKey(TEST_PASSWORD)
    bytes = pk.Decrypt(bytes)
End Using

Assert.AreEqual(svalue, bytes)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys