SymmetricAlgorithm: Key (let)

Key

Gets the secret key for the symmetric algorithm.



 Public Property Let Key(
	  ByRef Value ( ) As Byte ) :

Parameters

Value
[ByRef] Byte. The secret key to use for the symmetric algorithm.

Remarks

The secret key is used both for encryption and for decryption. For a symmetric algorithm to be successful, the secret key must be known only to the sender and the receiver. The valid key sizes are specified by the particular symmetric algorithm implementation and are listed in the LegalKeySizes property.

If a key has not been set, the GenerateKey method will be called to create a new random value.

Read/Write.

Exceptions

ExceptionCondition
ArgumentNullExceptionAn attempt was made to set the key to an uninitialized array.
CryptographicExceptionThe key size is invalid.

See Also

Project CorLib Overview

Class SymmetricAlgorithm Overview