SymmetricAlgorithm.KeySize Property

Gets or sets the size, in bits, of the secret key used by the symmetric algorithm.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public virtual int KeySize { get; set; }

Property Value

Type: System.Int32
The size, in bits, of the secret key used by the symmetric algorithm.

ExceptionCondition
CryptographicException

The key size is not valid.

The valid key sizes are specified by the particular symmetric algorithm implementation and are listed in the LegalKeySizes property.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft