ICspAlgorithm::get_IncrementLength method (certenroll.h)

The IncrementLength property retrieves a value, in bits, that can be used to determine valid incremental key lengths for algorithms that support multiple key sizes. This property is web enabled.

This property is read-only.

Syntax

HRESULT get_IncrementLength(
  LONG *pValue
);

Parameters

pValue

Return value

None

Remarks

You can use the value of this property to determine valid key sizes for generated keys. For example, if the minimum key length of a DSA signing key is 512 bits, the maximum length is 1,024 bits, and the increment is 64 bits, valid key sizes include 512, 576, 640 and so in 64 bit increments up to 1,024.

The DefaultLength, IncrementLength, MaxLength, and MinLength properties can vary by algorithm and provider. The following table lists a few algorithms for which multiple key sizes can be set. The list is not inclusive.

Algorithm OID Cryptographic provider Key length (bits)
XCN_OID_RSA_RSA(1.2.840.113549.1.1.1) Microsoft Smart Card Key Storage Provider

Microsoft Base Smart Card Crypto Provider

Minimum: 1,024

Maximum: 4,096

Default: 1,024

Increment: 512

XCN_OID_RSA_RSA(1.2.840.113549.1.1.1) Microsoft Software Key Storage Provider

Microsoft Base Cryptographic Provider v1.0

Microsoft Enhanced Cryptographic Provider v1.0

Microsoft Enhanced RSA and AES Cryptographic Provider

Microsoft RSA Schannel Cryptographic Provider

Microsoft Strong Cryptographic Provider

Minimum: 384

Maximum: 16,384

Default: 1,024

Increment: 8

XCN_OID_X957_DSA(1.2.840.10040.4.1) Microsoft Software Key Storage Provider

Microsoft Base DSS and Diffie-Hellman Cryptographic Provider

Microsoft Base DSS Cryptographic Provider

Microsoft DH Schannel Cryptographic Provider

Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider

Minimum: 512

Maximum: 1,024

Default: 1,024

Increment: 64

XCN_OID_ANSI_X942_DH(1.2.840.10046.2.1) Diffie-Hellman key exchange algorithm. Minimum: 512

Maximum: 1,024

Default: 1,024

Increment: 64

XCN_OID_ANSI_X942_DH(1.2.840.10046.2.1) Microsoft DH Schannel Cryptographic Provider

Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider

Minimum: 512

Maximum: 4,096

Default: 1,024

Increment: 64

XCN_OID_RSA_RC2CBC(1.2.840.113549.3.2) Microsoft Software Key Storage Provider

Microsoft Smart Card Key Storage Provider

Microsoft Base Smart Card Crypto Provider

Microsoft DH Schannel Cryptographic Provider

Microsoft Enhanced Cryptographic Provider v1.0

Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider

Microsoft Enhanced RSA and AES Cryptographic Provider

Microsoft RSA Schannel Cryptographic Provider

Microsoft Strong Cryptographic Provider

Minimum: 40

Maximum: 128

Default: 128

Increment: 8

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header certenroll.h
DLL CertEnroll.dll

See also

DefaultLength

ICspAlgorithm