MACTripleDES Constructor (String, Byte[])

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

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

public MACTripleDES (
	string strTripleDES,
	byte[] rgbKey
public MACTripleDES (
	String strTripleDES, 
	byte[] rgbKey
public function MACTripleDES (
	strTripleDES : String, 
	rgbKey : byte[]



The name of the TripleDES implementation to use.


The secret key for MACTripleDES encryption.

Exception typeCondition


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


The strTripleDES parameter is not a valid name of a TripleDES implementation.

The strTripleDES parameter is the friendly name of the TripleDES implementation type. The default implementation is System.Security.Cryptography.TripleDES.

The rgbKey parameter must be 16 or 24 bytes in length.

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

byte[] key = new byte[24];
string tripleDesName = "System.Security.Cryptography.TripleDES";
MACTripleDES macTriple = new MACTripleDES(tripleDesName, key);

ubyte key[] = new ubyte[24];
String tripleDesName = "System.Security.Cryptography.TripleDES";
MACTripleDES macTriple = new MACTripleDES(tripleDesName, key);

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

Community Additions