CertificateRequestProperties.KeySize Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the size, in bits, of the private key to be generated.
public:
property unsigned int KeySize { unsigned int get(); void set(unsigned int value); };
uint32_t KeySize();
void KeySize(uint32_t value);
public uint KeySize { get; set; }
var uInt32 = certificateRequestProperties.keySize;
certificateRequestProperties.keySize = uInt32;
Public Property KeySize As UInteger
Property Value
The size, in bits, of the private key.
Examples
public UInt32 GetSetKeySize(UInt32 sizeIn)
{
// Create a new CertificateRequestProperties object.
CertificateRequestProperties reqProperties = new CertificateRequestProperties();
// The default value is 2048 bits.
UInt32 uDefaultSize = reqProperties.KeySize;
// If the input option does not equal the default option, reset the property value.
if (SizeIn != uDefaultSize)
{
reqProperties.KeySize = SizeIn;
}
// Return the key size.
return reqProperties.KeySize;
}
Remarks
The default key size for RSA and DSA algorithms is 2048 bits. If an elliptic curve cryptographic (ECC) algorithm was specified in the KeyAlgorithmName property, the key size is ignored.