Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AsymmetricAlgorithm::LegalKeySizes Property

 

Gets the key sizes that are supported by the asymmetric algorithm.

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

public:
property array<KeySizes^>^ LegalKeySizes {
	virtual array<KeySizes^>^ get();
}

Property Value

Type: array<System.Security.Cryptography::KeySizes^>^

An array that contains the key sizes supported by the asymmetric algorithm.

The asymmetric algorithm supports only key sizes that match an entry in this array.

The following code example demonstrates how to call the LegalKeySizes property to retrieve the MinSize, MaxSize, and SkipSize properties. This code example is part of a larger example provided for the AsymmetricAlgorithm class.

array<KeySizes^>^ legalKeySizes = customCryptoAlgorithm->LegalKeySizes;
for (int i = 0; i < legalKeySizes->Length; i++)
{
    Console::WriteLine(
        "Keysize{0} min, max, step: {1}, {2}, {3}, ", i,
        legalKeySizes[i]->MinSize,
        legalKeySizes[i]->MaxSize,
        legalKeySizes[i]->SkipSize);
}

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