ICspInformation::GetCspStatusFromOperations method (certenroll.h)

The GetCspStatusFromOperations method creates an ICspStatus object for the first supported algorithm that is consistent with the specified signature, encryption, hashing, or cipher operation.

Syntax

HRESULT GetCspStatusFromOperations(
  [in, optional] IObjectId               *pAlgorithm,
  [in]           AlgorithmOperationFlags Operations,
  [out]          ICspStatus              **ppValue
);

Parameters

[in, optional] pAlgorithm

Pointer to an IObjectId interface that represents an algorithm OID. This parameter is optional and can be NULL.

  • If you specify an OID and set the Operations parameter to XCN_NCRYPT_SIGNATURE_OPERATION and combine this flag with either XCN_NCRYPT_EXACT_MATCH_OPERATION or XCN_NCRYPT_PREFER_SIGNATURE_ONLY_OPERATION, the first signature algorithm, if any, that matches the OID is used.
  • If you specify an OID but do not set the Operations parameter to XCN_NCRYPT_SIGNATURE_OPERATION, or you set XCN_NCRYPT_SIGNATURE_OPERATION but do not combine it with either XCN_NCRYPT_EXACT_MATCH_OPERATION or XCN_NCRYPT_PREFER_SIGNATURE_ONLY_OPERATION, the first algorithm that can be used for signing or encryption is used.
  • If you do not specify an OID, the first supported algorithm consistent with the flags specified in the Operations parameter is used.

[in] Operations

An AlgorithmOperationFlags enumeration value that identifies the type of algorithm to retrieve. One of the following values must be specified:

  • XCN_NCRYPT_CIPHER_OPERATION
  • XCN_NCRYPT_HASH_OPERATION
  • XCN_NCRYPT_SIGNATURE_OPERATION
  • XCN_NCRYPT_SECRET_AGREEMENT_OPERATION
  • XCN_NCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION

You can refine the search characteristics by combining one of the preceding flags with one of the following:

  • XCN_NCRYPT_PREFER_SIGNATURE_ONLY_OPERATION
  • XCN_NCRYPT_PREFER_NON_SIGNATURE_OPERATION
  • XCN_NCRYPT_EXACT_MATCH_OPERATION

If you set the XCN_NCRYPT_PREFER_SIGNATURE_ONLY_OPERATION or XCN_NCRYPT_PREFER_NON_SIGNATURE_OPERATION preference flags, you cannot also specify either of the following:

  • XCN_NCRYPT_CIPHER_OPERATION
  • XCN_NCRYPT_HASH_OPERATION

[out] ppValue

Address of a variable that receives a pointer to an ICspStatus interface.

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/value Description
CERTSRV_E_PROPERTY_EMPTY
The ICspStatus object could not be found.
OLE_E_BLANK
The ICspInformation object has not been initialized.

Remarks

An ICspStatus object contains status information about a cryptographic provider. Each object is initialized for a specific algorithm supported by the provider. If you do not specify an algorithm in the pAlgorithm parameter, the first supported algorithm that is consistent with the permitted operations is chosen to create the ICspStatus object.

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

ICspInformation