C# Class Org.Mentalis.Security.Cryptography.DiffieHellmanManaged

Implements the Diffie-Hellman algorithm.
Inheritance: DiffieHellman
Afficher le fichier Open project: ElanHasson/SSIS-Extensions Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

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

Private Methods

Méthode Description
GenerateKey ( int bitlen, DHKeyGeneration keygen, BigInteger &p, BigInteger &g ) : void
Initialize ( BigInteger p, BigInteger g, BigInteger x, int secretLen, bool checkInput ) : void

Method Details

CreateKeyExchange() public méthode

Creates the key exchange data.
public CreateKeyExchange ( ) : byte[]
Résultat byte[]

DecryptKeyExchange() public méthode

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.
Résultat byte[]

DiffieHellmanManaged() public méthode

Initializes a new DiffieHellmanManaged instance.
The default length of the shared secret is 1024 bits.
public DiffieHellmanManaged ( ) : System
Résultat System

DiffieHellmanManaged() public méthode

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.
Résultat System

DiffieHellmanManaged() public méthode

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.
Résultat System

DiffieHellmanManaged() public méthode

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.
Résultat System

Dispose() protected méthode

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.
Résultat void

ExportParameters() public méthode

Exports the DHParameters.
public ExportParameters ( bool includePrivateParameters ) : DHParameters
includePrivateParameters bool true to include private parameters; otherwise, false.
Résultat DHParameters

ImportParameters() public méthode

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 .
Résultat void