ISmimeCapability::Initialize method

The Initialize method initializes the object from a symmetric encryption algorithm object identifier (OID) and an optional key length.

Syntax


HRESULT Initialize(
  [in]  IObjectId *pObjectId,
  [in]  LONG BitCount
);

Parameters

pObjectId [in]

Pointer to an IObjectId interface that represents the OID.

BitCount [in]

A LONG variable that contains the bit length of the symmetric key.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following table. For a list of common error codes, see Common HRESULT Values.

Return code/valueDescription
CERTSRV_E_PROPERTY_EMPTY

The IObjectId pointer is NULL.

 

Remarks

The following symmetric encryption algorithms are supported by the Certificate Enrollment API. Only the RC2 and RC4 algorithms have variable key lengths that can be specified.

OIDKey lengthDescription
XCN_OID_OIWSEC_desCBC

1.3.14.3.2.7

56The key size is of the DES CBC algorithm is 56 bits. You do not need to specify this value.
XCN_OID_RSA_DES_EDE3_CBC

1.2.840.113549.3.7

168The key size is of the 3DES CBC algorithm is 168 bits. You do not need to specify this value.
XCN_OID_RSA_RC2CBC

1.2.840.113549.3.2

40 to 128RC4 is a variable key algorithm. common values are 40, 64, and 128 bits.
XCN_OID_RSA_RC4

1.2.840.113549.3.4

40 to 128RC4 is a variable key algorithm. common values are 40, 64, and 128 bits.
XCN_OID_RSA_SMIMEalgCMS3DESwrap

1.2.840.113549.1.9.16.3.6

168The key size of the MMS Data Encryption Standard (DES) key wrap algorithm is 168 bits. You do not need to specify this value.
XCN_OID_RSA_SMIMEalgCMSRC2wrap

1.2.840.113549.1.9.16.3.7

128The key size of the MMS RC2 key wrap algorithm is 128 bits. You do not need to specify this value.
XCN_OID_NIST_AES128_CBC

2.16.840.1.101.3.4.1.2

128The key size is implied by the OID. You do not need to specify this value.
XCN_OID_NIST_AES192_CBC

2.16.840.1.101.3.4.1.22

192The key size is implied by the OID. You do not need to specify this value.
XCN_OID_NIST_AES256_CBC

2.16.840.1.101.3.4.1.42

256The key size is implied by the OID. You do not need to specify this value.
XCN_OID_NIST_AES128_WRAP

2.16.840.1.101.3.4.1.5

128The key size is implied by the OID. You do not need to specify this value.
XCN_OID_NIST_AES192_WRAP

2.16.840.1.101.3.4.1.25

192The key size is implied by the OID. You do not need to specify this value.
XCN_OID_NIST_AES256_WRAP

2.16.840.1.101.3.4.1.45

256The key size is implied by the OID. You do not need to specify this value.

 

The key length that you specify for RC2 and RC4 algorithms must be consistent with that supported by the cryptographic provider or providers used by the client. For more information, see ICspInformation. You can retrieve the bit length by calling the BitCount property, and you can retrieve the algorithm OID by calling the ObjectId property.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

CertEnroll.h

DLL

CertEnroll.dll

See also

ISmimeCapability
ISmimeCapabilities
IX509ExtensionSmimeCapabilities

 

 

Community Additions

ADD
Show:
© 2014 Microsoft