共用方式為


CertificateRequestProperties.KeySize 屬性

定義

取得或設定要產生之私密金鑰的大小,以位為單位。

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

屬性值

UInt32

unsigned int

uint32_t

私密金鑰的大小,以位為單位。

範例

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;
}

備註

RSA 和 DSA 演算法的預設金鑰大小為 2048 位。 如果在 KeyAlgorithmName 屬性中指定了橢圓曲線密碼編譯 (ECC) 演算法,則會忽略金鑰大小。

適用於