CertificateRequestProperties.KeySize CertificateRequestProperties.KeySize CertificateRequestProperties.KeySize CertificateRequestProperties.KeySize CertificateRequestProperties.KeySize Property

Definition

Gets or sets the size, in bits, of the private key to be generated.

public : unsigned int KeySize { get; set; }
uint32_t KeySize();

void KeySize(uint32_t keysize);
public uint KeySize { get; set; }
Public ReadWrite Property KeySize As uint
var uint = certificateRequestProperties.keySize;
certificateRequestProperties.keySize = uint;

Property Value

uint uint uint

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.