SymmetricAlgorithm: Key (let) |
Gets the secret key for the symmetric algorithm.
Public Property Let Key( ByRef Value ( ) As Byte ) :
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.
Exception | Condition |
---|---|
ArgumentNullException | An attempt was made to set the key to an uninitialized array. |
CryptographicException | The key size is invalid. |