C# Класс Org.Mentalis.Security.Cryptography.DiffieHellmanManaged

Implements the Diffie-Hellman algorithm.
Наследование: DiffieHellman
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateKeyExchange ( ) : byte[]

Creates the key exchange data.

DecryptKeyExchange ( byte keyEx ) : byte[]

Extracts secret information from the key exchange data.

DiffieHellmanManaged ( ) : System

Initializes a new DiffieHellmanManaged instance.

The default length of the shared secret is 1024 bits.

DiffieHellmanManaged ( byte p, byte g, byte x ) : System

Initializes a new DiffieHellmanManaged instance.

DiffieHellmanManaged ( byte p, byte g, int l ) : System

Initializes a new DiffieHellmanManaged instance.

DiffieHellmanManaged ( int bitlen, int l, DHKeyGeneration keygen ) : System

Initializes a new DiffieHellmanManaged instance.

The larger the bit length, the more secure the algorithm is. The default is 1024 bits. The minimum bit length is 128 bits.
The size of the private value will be one fourth of the bit length specified.

ExportParameters ( bool includePrivateParameters ) : DHParameters

Exports the DHParameters.

ImportParameters ( DHParameters parameters ) : void

Imports the specified DHParameters.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the SymmetricAlgorithm and optionally releases the managed resources.

Приватные методы

Метод Описание
GenerateKey ( int bitlen, DHKeyGeneration keygen, BigInteger &p, BigInteger &g ) : void
Initialize ( BigInteger p, BigInteger g, BigInteger x, int secretLen, bool checkInput ) : void

Описание методов

CreateKeyExchange() публичный Метод

Creates the key exchange data.
public CreateKeyExchange ( ) : byte[]
Результат byte[]

DecryptKeyExchange() публичный Метод

Extracts secret information from the key exchange data.
public DecryptKeyExchange ( byte keyEx ) : byte[]
keyEx byte The key exchange data within which the shared key is hidden.
Результат byte[]

DiffieHellmanManaged() публичный Метод

Initializes a new DiffieHellmanManaged instance.
The default length of the shared secret is 1024 bits.
public DiffieHellmanManaged ( ) : System
Результат System

DiffieHellmanManaged() публичный Метод

Initializes a new DiffieHellmanManaged instance.
or is a null reference (Nothing in Visual Basic). or is invalid.
public DiffieHellmanManaged ( byte p, byte g, byte x ) : System
p byte The P parameter of the Diffie-Hellman algorithm. This is a public parameter.
g byte The G parameter of the Diffie-Hellman algorithm. This is a public parameter.
x byte The X parameter of the Diffie-Hellman algorithm. This is a private parameter. If this parameters is a null reference (Nothing in Visual Basic), a secret value of the default size will be generated.
Результат System

DiffieHellmanManaged() публичный Метод

Initializes a new DiffieHellmanManaged instance.
or is a null reference (Nothing in Visual Basic). is invalid. or is invalid.
public DiffieHellmanManaged ( byte p, byte g, int l ) : System
p byte The P parameter of the Diffie-Hellman algorithm.
g byte The G parameter of the Diffie-Hellman algorithm.
l int The length, in bits, of the private value. If 0 is specified, the default value will be used.
Результат System

DiffieHellmanManaged() публичный Метод

Initializes a new DiffieHellmanManaged instance.
The larger the bit length, the more secure the algorithm is. The default is 1024 bits. The minimum bit length is 128 bits.
The size of the private value will be one fourth of the bit length specified.
The specified bit length is invalid.
public DiffieHellmanManaged ( int bitlen, int l, DHKeyGeneration keygen ) : System
bitlen int The length, in bits, of the public P parameter.
l int The length, in bits, of the secret value X. This parameter can be set to 0 to use the default size.
keygen DHKeyGeneration One of the values.
Результат System

Dispose() защищенный Метод

Releases the unmanaged resources used by the SymmetricAlgorithm and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

ExportParameters() публичный Метод

Exports the DHParameters.
public ExportParameters ( bool includePrivateParameters ) : DHParameters
includePrivateParameters bool true to include private parameters; otherwise, false.
Результат DHParameters

ImportParameters() публичный Метод

Imports the specified DHParameters.
or is a null reference (Nothing in Visual Basic) -or- is not a prime number.
public ImportParameters ( DHParameters parameters ) : void
parameters DHParameters The parameters for .
Результат void