Gets or sets the secret key for the symmetric algorithm.
The secret key to be used for the symmetric algorithm.
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.
Exception Type | Condition |
---|---|
ArgumentNullException | An attempt is made to set the key to a null reference (Nothing in Visual Basic). |
RijndaelCryptoServiceProvider Class | RijndaelCryptoServiceProvider Members | Org.Mentalis.Security.Cryptography Namespace