MACTripleDES.MACTripleDES(Byte[]) Constructor

Initializes a new instance of the MACTripleDES class with the specified key data.

Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)

public MACTripleDES (
	byte[] rgbKey
)
public MACTripleDES (
	byte[] rgbKey
)
public function MACTripleDES (
	rgbKey : byte[]
)
Not applicable.

Parameters

rgbKey

The secret key for MACTripleDES encryption.

Exception typeCondition

ArgumentNullException

The rgbKey parameter is a null reference (Nothing in Visual Basic).

This constructor uses the default implementation of TripleDES. The rgbKey parameter must be 16 or 24 bytes in length.

The following code example demonstrates how to construct a new MACTripleDES using a random key. This code example is part of a larger example provided for the MACTripleDES class.

byte[] keyData = new byte[24];
RandomNumberGenerator.Create().GetBytes(keyData);
MACTripleDES macTriple = new MACTripleDES(keyData);

ubyte keyData[] = new ubyte[24];
RandomNumberGenerator.Create().GetBytes(keyData);
MACTripleDES macTriple = new MACTripleDES(keyData);

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: