Gets or sets the secret key for the symmetric algorithm.

Namespace: LLCryptoLib.Security.Cryptography
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public override byte[] Key { get; set; }
Visual Basic
Public Overrides Property Key As Byte()
	Get
	Set
Visual C++
public:
virtual property array<unsigned char>^ Key {
	array<unsigned char>^ get () override;
	void set (array<unsigned char>^ value) override;
}

Field Value

The secret key to be used for the symmetric algorithm.

Remarks

The secret key is used both for encryption and for decryption. For a symmetric algorithm to be secure, 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 LegalKeySizes.

If this property is a null reference (Nothing in Visual Basic) when it is used, GenerateKey()()()() is called to create a new random value.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionAn attempt is made to set the key to a null reference (Nothing in Visual Basic).

See Also