This documentation is archived and is not being maintained.

AsymmetricAlgorithm.KeySize Property

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

[Visual Basic]
Public Overridable Property KeySize As Integer
public virtual int KeySize {get; set;}
public: __property virtual int get_KeySize();
public: __property virtual void set_KeySize(int);
public function get KeySize() : int;
public function set KeySize(int);

Property Value

The size of the key modulus used by the asymmetric algorithm.


Exception Type Condition
CryptographicException The key modulus size is invalid.


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


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

AsymmetricAlgorithm Class | AsymmetricAlgorithm Members | System.Security.Cryptography Namespace | Cryptographic Services