AsymmetricAlgorithm.KeySize Property

 

Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.

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

abstract KeySize : int with get, set
override KeySize : int with get, set

Property Value

Type: System.Int32

The size, in bits, of the key modulus used by the asymmetric algorithm.

Exception Condition
CryptographicException

The key modulus size is invalid.

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

The following code example demonstrates how to override the KeySize property to verify that it falls within the range identified in the local keySizes member variable. This code example is part of a larger example provided for the AsymmetricAlgorithm class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Windows Phone Silverlight
Available since 7.1
Return to top
Show: