This documentation is archived and is not being maintained.

SymmetricAlgorithm.ValidKeySize Method

Determines whether the specified key size is valid for the current algorithm.

[Visual Basic]
Public Function ValidKeySize( _
   ByVal bitLength As Integer _
) As Boolean
public bool ValidKeySize(
 int bitLength
public: bool ValidKeySize(
 int bitLength
public function ValidKeySize(
   bitLength : int
) : Boolean;


The key size in bits to check for validity

Return Value

true if the specified key size is valid for the current algorithm; otherwise, false.


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

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