This documentation is archived and is not being maintained.

MACTripleDES Constructor (Byte[])

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[]
)

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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: